mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #7857 from fgrzadkowski/fix_jenkins
Ignore latency metrics for events
This commit is contained in:
commit
1d59a0351f
@ -158,7 +158,7 @@ var _ = Describe("Density", func() {
|
|||||||
// Verify latency metrics
|
// Verify latency metrics
|
||||||
// TODO: Update threshold to 1s once we reach this goal
|
// TODO: Update threshold to 1s once we reach this goal
|
||||||
// TODO: We should reset metrics before the test. Currently previous tests influence latency metrics.
|
// TODO: We should reset metrics before the test. Currently previous tests influence latency metrics.
|
||||||
highLatencyRequests, err := HighLatencyRequests(c, 10*time.Second)
|
highLatencyRequests, err := HighLatencyRequests(c, 10*time.Second, util.NewStringSet("events"))
|
||||||
expectNoError(err)
|
expectNoError(err)
|
||||||
Expect(highLatencyRequests).NotTo(BeNumerically(">", 0))
|
Expect(highLatencyRequests).NotTo(BeNumerically(">", 0))
|
||||||
})
|
})
|
||||||
|
@ -37,6 +37,7 @@ import (
|
|||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/clientauth"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/clientauth"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/wait"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/wait"
|
||||||
|
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
@ -776,14 +777,15 @@ func ReadLatencyMetrics(c *client.Client) ([]LatencyMetric, error) {
|
|||||||
|
|
||||||
// Prints summary metrics for request types with latency above threshold
|
// Prints summary metrics for request types with latency above threshold
|
||||||
// and returns number of such request types.
|
// and returns number of such request types.
|
||||||
func HighLatencyRequests(c *client.Client, threshold time.Duration) (int, error) {
|
func HighLatencyRequests(c *client.Client, threshold time.Duration, ignoredResources util.StringSet) (int, error) {
|
||||||
metrics, err := ReadLatencyMetrics(c)
|
metrics, err := ReadLatencyMetrics(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
var badMetrics []LatencyMetric
|
var badMetrics []LatencyMetric
|
||||||
for _, metric := range metrics {
|
for _, metric := range metrics {
|
||||||
if metric.verb != "WATCHLIST" &&
|
if !ignoredResources.Has(metric.resource) &&
|
||||||
|
metric.verb != "WATCHLIST" &&
|
||||||
// We are only interested in 99%tile, but for logging purposes
|
// We are only interested in 99%tile, but for logging purposes
|
||||||
// it's useful to have all the offending percentiles.
|
// it's useful to have all the offending percentiles.
|
||||||
metric.quantile <= 0.99 &&
|
metric.quantile <= 0.99 &&
|
||||||
|
Loading…
Reference in New Issue
Block a user