Browse Source

Log query counts once a minute, bump version to 2.0.2

Ask Bjørn Hansen 13 years ago
parent
commit
1b9017392c
3 changed files with 6 additions and 3 deletions
  1. 1 1
      build
  2. 1 1
      geodns.go
  3. 4 1
      monitor.go

+ 1 - 1
build

@@ -1,6 +1,6 @@
 #!/bin/sh
 #go get -v
-REVISION=`git rev-parse --short=8  HEAD`
+REVISION=`git rev-parse --short=6  HEAD`
 echo $REVISION > REVISION
 go build -ldflags "-X main.gitVersion $REVISION" -v
 go install

+ 1 - 1
geodns.go

@@ -11,7 +11,7 @@ import (
 	"time"
 )
 
-var VERSION string = "2.0.1"
+var VERSION string = "2.0.2"
 var gitVersion string
 var serverId string
 

+ 4 - 1
monitor.go

@@ -7,8 +7,11 @@ import (
 )
 
 func monitor() {
+	lastQueryCount := qCounter
 	for {
-		log.Println("goroutines", runtime.NumGoroutine())
+		newQueries := qCounter - lastQueryCount
+		lastQueryCount = qCounter
+		log.Println("goroutines", runtime.NumGoroutine(), "queries", newQueries)
 		time.Sleep(60 * time.Second)
 	}
 }