-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Open
Description
What would you like to be added?
Like for KV values:
etcd/tests/robustness/traffic/traffic.go
Lines 159 to 189 in 05b8563
func CalculateStats(reports []report.ClientReport, start, end time.Duration) (ts trafficStats) { | |
ts.Period = end - start | |
for _, r := range reports { | |
for _, op := range r.KeyValue { | |
if op.Call < start.Nanoseconds() || op.Call > end.Nanoseconds() { | |
continue | |
} | |
resp := op.Output.(model.MaybeEtcdResponse) | |
if resp.Error == "" { | |
ts.Successes++ | |
} else { | |
ts.Failures++ | |
} | |
} | |
} | |
return ts | |
} | |
type trafficStats struct { | |
Successes, Failures int | |
Period time.Duration | |
} | |
func (ts *trafficStats) SuccessRate() float64 { | |
return float64(ts.Successes) / float64(ts.Successes+ts.Failures) | |
} | |
func (ts *trafficStats) QPS() float64 { | |
return float64(ts.Successes) / ts.Period.Seconds() | |
} |
Expect this is a separate structure. No need to measure values against failpoint injection like we do for KV.
Measure for watch:
- Number of watch requests
- Number of events collected
- Number of progress notifies
- Number of watch requests that were immediately closed
- Coverage of revisions
- Average duration of watch
Maybe propose some validation based on metrics
Why is this needed?
Have some quality quantifier for watch like we have for KV operations.