fixing stat errors

This commit is contained in:
Joseph Lawson
2014-04-23 11:45:39 -04:00
parent c250c3e30c
commit 610552be88
3 changed files with 7 additions and 6 deletions
+5 -5
View File
@@ -1,9 +1,9 @@
package main
import (
"strconv"
"time"
"log"
"strconv"
)
const (
@@ -19,8 +19,8 @@ type GorStat struct {
currentTime int64
}
func NewGorStat(statName string) (s *GorStat) {
s = new(GorStat)
func NewGorStat(statName string) GorStat {
s := new(GorStat)
s.statName = statName
s.latest = 0
s.min = 0
@@ -29,7 +29,7 @@ func NewGorStat(statName string) (s *GorStat) {
if Settings.stats {
go s.reportStats()
}
return
return s
}
func (s *GorStat) Write(latest int) {
@@ -45,7 +45,7 @@ func (s *GorStat) Write(latest int) {
}
func (s *GorStat) String() string {
return s.statName + ":" + Itoa(s.latest) + "," + Itoa(s.min) + "," + Itoa(s.max)
return s.statName + ":" + strconv.Itoa(s.latest) + "," + strconv.Itoa(s.min) + "," + strconv.Itoa(s.max)
}
func (s *GorStat) reportStats() {
+1 -1
View File
@@ -47,7 +47,7 @@ type HTTPOutput struct {
elasticSearch *es.ESPlugin
bufStats GorStat
bufStats *GorStat
}
func NewHTTPOutput(options string, headers HTTPHeaders, methods HTTPMethods, elasticSearchAddr string) io.Writer {
+1
View File
@@ -13,6 +13,7 @@ const (
type AppSettings struct {
verbose bool
stats bool
splitOutput bool