There are better ways to get this data than spewing it to the log. Closes #57
@@ -135,7 +135,7 @@ func main() {
go configWatcher(configFileName)
metrics := NewMetrics()
- go metrics.Updater(true)
+ go metrics.Updater()
go statHatPoster()
@@ -1,8 +1,6 @@
package main
import (
- "log"
- "os"
"runtime"
"time"
@@ -32,14 +30,7 @@ func NewMetrics() *ServerMetrics {
return m
}
-func (m *ServerMetrics) Updater(printStatus bool) {
-
- if printStatus {
- go func() {
- time.Sleep(2 * time.Second)
- metrics.Log(metrics.DefaultRegistry, 30*time.Second, log.New(os.Stderr, "metrics: ", log.Lmicroseconds))
- }()
- }
+func (m *ServerMetrics) Updater() {
for {
time.Sleep(1 * time.Second)
@@ -19,7 +19,7 @@ var _ = Suite(&MonitorSuite{})
func (s *MonitorSuite) SetUpSuite(c *C) {
s.zones = make(Zones)
s.metrics = NewMetrics()
- go s.metrics.Updater(false)
+ go s.metrics.Updater()
*flaghttp = ":8881"
@@ -22,7 +22,7 @@ func (s *ServeSuite) SetUpSuite(c *C) {
// setup and register metrics
- go metrics.Updater(false)
Zones := make(Zones)
setupPgeodnsZone(Zones)