diff --git a/etcdserver/stats/leader.go b/etcdserver/stats/leader.go index 04ac3c8e5..eb7852c3e 100644 --- a/etcdserver/stats/leader.go +++ b/etcdserver/stats/leader.go @@ -66,23 +66,28 @@ func (ls *LeaderStats) Follower(name string) *FollowerStats { // FollowerStats encapsulates various statistics about a follower in an etcd cluster type FollowerStats struct { - Latency struct { - Current float64 `json:"current"` - Average float64 `json:"average"` - averageSquare float64 - StandardDeviation float64 `json:"standardDeviation"` - Minimum float64 `json:"minimum"` - Maximum float64 `json:"maximum"` - } `json:"latency"` - - Counts struct { - Fail uint64 `json:"fail"` - Success uint64 `json:"success"` - } `json:"counts"` + Latency LatencyStats `json:"latency"` + Counts CountsStats `json:"counts"` sync.Mutex } +// LatencyStats encapsulates latency statistics. +type LatencyStats struct { + Current float64 `json:"current"` + Average float64 `json:"average"` + averageSquare float64 + StandardDeviation float64 `json:"standardDeviation"` + Minimum float64 `json:"minimum"` + Maximum float64 `json:"maximum"` +} + +// CountsStats encapsulates raft statistics. +type CountsStats struct { + Fail uint64 `json:"fail"` + Success uint64 `json:"success"` +} + // Succ updates the FollowerStats with a successful send func (fs *FollowerStats) Succ(d time.Duration) { fs.Lock()