mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-02-21 22:57:15 +00:00
Addressed comments
This commit is contained in:
@@ -1057,14 +1057,14 @@ func (collector *customCollector) CollectWithStability(ch chan<- metrics.Metric)
|
||||
}
|
||||
rcMetrics[resourceclaimmetrics.NumResourceClaimLabels{Allocated: allocated, AdminAccess: adminAccess, Source: source}]++
|
||||
}
|
||||
for label, count := range rcMetrics {
|
||||
for rcLabels, count := range rcMetrics {
|
||||
ch <- metrics.NewLazyConstMetric(
|
||||
resourceclaimmetrics.NumResourceClaimsDesc,
|
||||
metrics.GaugeValue,
|
||||
float64(count),
|
||||
label.Allocated,
|
||||
label.AdminAccess,
|
||||
label.Source,
|
||||
rcLabels.Allocated,
|
||||
rcLabels.AdminAccess,
|
||||
rcLabels.Source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1177,8 +1177,8 @@ func newNumMetrics(lister resourcelisters.ResourceClaimLister) numMetrics {
|
||||
}
|
||||
}
|
||||
|
||||
func (em numMetrics) withUpdates(label resourceclaimmetrics.NumResourceClaimLabels, n float64) numMetrics {
|
||||
em.metrics[label] += n
|
||||
func (em numMetrics) withUpdates(rcLabels resourceclaimmetrics.NumResourceClaimLabels, n float64) numMetrics {
|
||||
em.metrics[rcLabels] += n
|
||||
return numMetrics{
|
||||
metrics: em.metrics,
|
||||
lister: em.lister,
|
||||
|
||||
@@ -47,10 +47,14 @@ var (
|
||||
)
|
||||
|
||||
// NumResourceClaimsDesc tracks the number of ResourceClaims,
|
||||
// categorized by their allocation status and admin access.
|
||||
// categorized by their allocation status, admin access, and source.
|
||||
// Source can be 'resource_claim_template' (created from a template),
|
||||
// 'extended_resource' (extended resources), or empty (manually created by a user).
|
||||
NumResourceClaimsDesc = metrics.NewDesc(
|
||||
metrics.BuildFQName("", ResourceClaimSubsystem, "resource_claims"),
|
||||
"Number of ResourceClaims, categorized by allocation status and admin access",
|
||||
"Number of ResourceClaims, categorized by allocation status, admin access, and source. "+
|
||||
"Source can be 'resource_claim_template' (created from a template), "+
|
||||
"'extended_resource' (extended resources), or empty (manually created by a user).",
|
||||
[]string{"allocated", "admin_access", "source"}, nil,
|
||||
metrics.ALPHA, "")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user