mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
Add e2e test for the newPV Controller metric
This commit is contained in:
parent
0c4e05a245
commit
75574401e7
@ -383,7 +383,10 @@ var _ = utils.SIGDescribe("[Serial] Volume metrics", func() {
|
|||||||
const (
|
const (
|
||||||
classKey = "storage_class"
|
classKey = "storage_class"
|
||||||
namespaceKey = "namespace"
|
namespaceKey = "namespace"
|
||||||
|
pluginNameKey = "plugin_name"
|
||||||
|
volumeModeKey = "volume_mode"
|
||||||
|
|
||||||
|
totalPVKey = "pv_collector_total_pv_count"
|
||||||
boundPVKey = "pv_collector_bound_pv_count"
|
boundPVKey = "pv_collector_bound_pv_count"
|
||||||
unboundPVKey = "pv_collector_unbound_pv_count"
|
unboundPVKey = "pv_collector_unbound_pv_count"
|
||||||
boundPVCKey = "pv_collector_bound_pvc_count"
|
boundPVCKey = "pv_collector_bound_pvc_count"
|
||||||
@ -506,6 +509,18 @@ var _ = utils.SIGDescribe("[Serial] Volume metrics", func() {
|
|||||||
validator([]map[string]int64{{className: 1}, nil, {ns: 1}, nil})
|
validator([]map[string]int64{{className: 1}, nil, {ns: 1}, nil})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
ginkgo.It("should create total pv count metrics for with plugin and volume mode labels after creating pv",
|
||||||
|
func() {
|
||||||
|
var err error
|
||||||
|
dimensions := []string{pluginNameKey, volumeModeKey}
|
||||||
|
pv, err = e2epv.CreatePV(c, pv)
|
||||||
|
framework.ExpectNoError(err, "Error creating pv: %v", err)
|
||||||
|
waitForPVControllerSync(metricsGrabber, totalPVKey, pluginNameKey)
|
||||||
|
controllerMetrics, err := metricsGrabber.GrabFromControllerManager()
|
||||||
|
framework.ExpectNoError(err, "Error getting c-m metricValues: %v", err)
|
||||||
|
err = testutil.ValidateMetrics(testutil.Metrics(controllerMetrics), totalPVKey, dimensions...)
|
||||||
|
framework.ExpectNoError(err, "Invalid metric in Controller Manager metrics: %q", totalPVKey)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user