Skip to content

Commit

Permalink
Fixes problem when there's very low DNS traffic. Closes #27.
Browse files Browse the repository at this point in the history
  • Loading branch information
darron committed Feb 24, 2016
1 parent e81948a commit 721b2cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/dnsmasq_signal_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ func SendSignalStats(current DNSStats, previous DNSStats) {
dog := DogConnect()
// Make sure the stats are positive - if they're negative dnsmasq must have been
// restarted and those numbers will not be accurate.
if forwards > 0 {
if forwards >= 0 {
sendQueriesStats("dnsmasq.queries", forwards, "query:forward", dog)
Log(fmt.Sprintf("Forwards: %d", forwards), "debug")
} else {
Log("Negative forwarded queries detected - dnsmasq must have been restarted.", "info")
sendQueriesStats("dnsmasq.queries", current.queriesForwarded, "query:forward", dog)
Log(fmt.Sprintf("Forwards: %d", current.queriesForwarded), "debug")
}
if locallyAnswered > 0 {
if locallyAnswered >= 0 {
sendQueriesStats("dnsmasq.queries", locallyAnswered, "query:local", dog)
Log(fmt.Sprintf("Locally Answered: %d", locallyAnswered), "debug")
} else {
Expand Down

0 comments on commit 721b2cd

Please sign in to comment.