Merge pull request #2591 from kelseyhightower/cleanup-etcdserver-stats

etcdserver: add stats.FollowerLatencyStats and stats.FollowerCountsStats...
release-2.1
Kelsey Hightower 2015-03-27 13:59:40 -07:00
commit a16d15aafc
1 changed files with 18 additions and 13 deletions

View File

@ -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()