|
@@ -12,7 +12,7 @@ import (
|
|
|
|
|
|
func (zs *Zones) statHatPoster() {
|
|
|
|
|
|
- if len(Config.StatHat.ApiKey) == 0 {
|
|
|
+ if !Config.HasStatHat() {
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -40,17 +40,17 @@ func (zs *Zones) statHatPoster() {
|
|
|
|
|
|
apiKey := zone.Logging.StatHatAPI
|
|
|
if len(apiKey) == 0 {
|
|
|
- apiKey = Config.StatHat.ApiKey
|
|
|
+ apiKey = Config.StatHatApiKey()
|
|
|
}
|
|
|
if len(apiKey) == 0 {
|
|
|
continue
|
|
|
}
|
|
|
- stathat.PostEZCount("zone "+name+" queries~"+suffix, Config.StatHat.ApiKey, int(newCount))
|
|
|
+ stathat.PostEZCount("zone "+name+" queries~"+suffix, Config.StatHatApiKey(), int(newCount))
|
|
|
|
|
|
ednsCount := zone.Metrics.EdnsQueries.Count()
|
|
|
newEdnsCount := ednsCount - lastEdnsCounts[name]
|
|
|
lastEdnsCounts[name] = ednsCount
|
|
|
- stathat.PostEZCount("zone "+name+" edns queries~"+suffix, Config.StatHat.ApiKey, int(newEdnsCount))
|
|
|
+ stathat.PostEZCount("zone "+name+" edns queries~"+suffix, Config.StatHatApiKey(), int(newEdnsCount))
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -68,7 +68,7 @@ func statHatPoster() {
|
|
|
for {
|
|
|
time.Sleep(60 * time.Second)
|
|
|
|
|
|
- if !Config.Flags.HasStatHat {
|
|
|
+ if !Config.HasStatHat() {
|
|
|
log.Println("No stathat configuration")
|
|
|
continue
|
|
|
}
|
|
@@ -79,8 +79,8 @@ func statHatPoster() {
|
|
|
newQueries := current - lastQueryCount
|
|
|
lastQueryCount = current
|
|
|
|
|
|
- stathat.PostEZCount("queries~"+suffix, Config.StatHat.ApiKey, int(newQueries))
|
|
|
- stathat.PostEZValue("goroutines "+serverID, Config.StatHat.ApiKey, float64(runtime.NumGoroutine()))
|
|
|
+ stathat.PostEZCount("queries~"+suffix, Config.StatHatApiKey(), int(newQueries))
|
|
|
+ stathat.PostEZValue("goroutines "+serverID, Config.StatHatApiKey(), float64(runtime.NumGoroutine()))
|
|
|
|
|
|
}
|
|
|
}
|