Skip to content

Commit

Permalink
test: Calculate leader elections over individual metrics
Browse files Browse the repository at this point in the history
The change to calculation worked when the metric was new (because
the serial test cleared the PV data) but not when it was restarted.

Simplify the metric with the new data from when we have preserved
the change.
  • Loading branch information
smarterclayton committed Feb 10, 2021
1 parent a664439 commit d95ce88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/extended/etcd/leader_changes.go
Expand Up @@ -24,7 +24,7 @@ var _ = g.Describe("[sig-etcd] etcd", func() {
testDuration := exutil.DurationSinceStartInSeconds().String()

g.By("Examining the number of etcd leadership changes over the run")
result, _, err := prometheus.Query(context.Background(), fmt.Sprintf("increase(max(max by (pod,job) (etcd_server_leader_changes_seen_total))[%s:1s])", testDuration), time.Now())
result, _, err := prometheus.Query(context.Background(), fmt.Sprintf("max(max by (pod,job) (increase(etcd_server_leader_changes_seen_total[%s])))", testDuration), time.Now())
o.Expect(err).ToNot(o.HaveOccurred())
leaderChanges := result.(model.Vector)[0].Value
if leaderChanges != 0 {
Expand Down

0 comments on commit d95ce88

Please sign in to comment.