tweaking stat output

This commit is contained in:
Joseph Lawson
2014-04-23 12:47:16 -04:00
parent 9461217a0e
commit b52d562dad
+7
View File
@@ -44,6 +44,12 @@ func (s *GorStat) Write(latest int) {
}
}
func (s *GorStat) Reset() {
s.latest = 0
s.max = 0
s.mean = 0
}
func (s *GorStat) String() string {
return s.statName + ":" + strconv.Itoa(s.latest) + "," + strconv.Itoa(s.mean) + "," + strconv.Itoa(s.max)
}
@@ -51,6 +57,7 @@ func (s *GorStat) String() string {
func (s *GorStat) reportStats() {
for {
log.Println(s)
s.Reset()
time.Sleep(rate * time.Second)
}
}