etcdserver: add stats.LatencyStats and stats.CountsStats types

This commit is contained in:
Kelsey Hightower 2015-03-27 13:27:42 -07:00
parent 635e4db6d9
commit 538d624cfa

View File

@ -66,21 +66,26 @@ func (ls *LeaderStats) Follower(name string) *FollowerStats {
// FollowerStats encapsulates various statistics about a follower in an etcd cluster // FollowerStats encapsulates various statistics about a follower in an etcd cluster
type FollowerStats struct { type FollowerStats struct {
Latency struct { Latency LatencyStats `json:"latency"`
Counts CountsStats `json:"counts"`
sync.Mutex
}
// LatencyStats encapsulates latency statistics.
type LatencyStats struct {
Current float64 `json:"current"` Current float64 `json:"current"`
Average float64 `json:"average"` Average float64 `json:"average"`
averageSquare float64 averageSquare float64
StandardDeviation float64 `json:"standardDeviation"` StandardDeviation float64 `json:"standardDeviation"`
Minimum float64 `json:"minimum"` Minimum float64 `json:"minimum"`
Maximum float64 `json:"maximum"` Maximum float64 `json:"maximum"`
} `json:"latency"` }
Counts struct { // CountsStats encapsulates raft statistics.
type CountsStats struct {
Fail uint64 `json:"fail"` Fail uint64 `json:"fail"`
Success uint64 `json:"success"` Success uint64 `json:"success"`
} `json:"counts"`
sync.Mutex
} }
// Succ updates the FollowerStats with a successful send // Succ updates the FollowerStats with a successful send