mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 05:30:26 +00:00
Reset metrics in tests
This commit is contained in:
@@ -1395,6 +1395,19 @@ func HighLatencyRequests(c *client.Client, threshold time.Duration, ignoredResou
|
||||
return len(badMetrics), nil
|
||||
}
|
||||
|
||||
// Reset latency metrics in apiserver.
|
||||
func resetMetrics(c *client.Client) error {
|
||||
Logf("Resetting latency metrics in apiserver...")
|
||||
body, err := c.Get().AbsPath("/resetMetrics").DoRaw()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if string(body) != "metrics reset\n" {
|
||||
return fmt.Errorf("Unexpected response: ", string(body))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Retrieve metrics information
|
||||
func getMetrics(c *client.Client) (string, error) {
|
||||
body, err := c.Get().AbsPath("/metrics").DoRaw()
|
||||
|
Reference in New Issue
Block a user