Merge pull request #2591 from kelseyhightower/cleanup-etcdserver-stats
etcdserver: add stats.FollowerLatencyStats and stats.FollowerCountsStats...release-2.1
commit
a16d15aafc
|
@ -66,23 +66,28 @@ 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"`
|
||||||
Current float64 `json:"current"`
|
Counts CountsStats `json:"counts"`
|
||||||
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"`
|
|
||||||
|
|
||||||
sync.Mutex
|
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
|
// Succ updates the FollowerStats with a successful send
|
||||||
func (fs *FollowerStats) Succ(d time.Duration) {
|
func (fs *FollowerStats) Succ(d time.Duration) {
|
||||||
fs.Lock()
|
fs.Lock()
|
||||||
|
|
Loading…
Reference in New Issue