mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
fixing stat errors
This commit is contained in:
+5
-5
@@ -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
@@ -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 {
|
||||
|
||||
@@ -13,6 +13,7 @@ const (
|
||||
|
||||
type AppSettings struct {
|
||||
verbose bool
|
||||
stats bool
|
||||
|
||||
splitOutput bool
|
||||
|
||||
|
||||
Reference in New Issue
Block a user