mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #106629 from tkashem/apf-dispatch-metrics
apf: add metric to track dispatch with no accommodation
This commit is contained in:
commit
33a2c50bce
@ -800,6 +800,7 @@ func (qs *queueSet) findDispatchQueueLocked() (*queue, *request) {
|
|||||||
klogV.Infof("QS(%s): request %v %v seats %d cannot be dispatched from queue %d, waiting for currently executing requests to complete, %d requests are occupying %d seats and the limit is %d",
|
klogV.Infof("QS(%s): request %v %v seats %d cannot be dispatched from queue %d, waiting for currently executing requests to complete, %d requests are occupying %d seats and the limit is %d",
|
||||||
qs.qCfg.Name, oldestReqFromMinQueue.descr1, oldestReqFromMinQueue.descr2, oldestReqFromMinQueue.MaxSeats(), minQueue.index, qs.totRequestsExecuting, qs.totSeatsInUse, qs.dCfg.ConcurrencyLimit)
|
qs.qCfg.Name, oldestReqFromMinQueue.descr1, oldestReqFromMinQueue.descr2, oldestReqFromMinQueue.MaxSeats(), minQueue.index, qs.totRequestsExecuting, qs.totSeatsInUse, qs.dCfg.ConcurrencyLimit)
|
||||||
}
|
}
|
||||||
|
metrics.AddDispatchWithNoAccommodation(qs.qCfg.Name, oldestReqFromMinQueue.fsName)
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
oldestReqFromMinQueue.removeFromQueueLocked()
|
oldestReqFromMinQueue.removeFromQueueLocked()
|
||||||
|
@ -324,6 +324,16 @@ var (
|
|||||||
},
|
},
|
||||||
[]string{priorityLevel, flowSchema},
|
[]string{priorityLevel, flowSchema},
|
||||||
)
|
)
|
||||||
|
apiserverDispatchWithNoAccommodation = compbasemetrics.NewCounterVec(
|
||||||
|
&compbasemetrics.CounterOpts{
|
||||||
|
Namespace: namespace,
|
||||||
|
Subsystem: subsystem,
|
||||||
|
Name: "request_dispatch_no_accommodation_total",
|
||||||
|
Help: "Number of times a dispatch attempt resulted in a non accommodation due to lack of available seats",
|
||||||
|
StabilityLevel: compbasemetrics.ALPHA,
|
||||||
|
},
|
||||||
|
[]string{priorityLevel, flowSchema},
|
||||||
|
)
|
||||||
|
|
||||||
metrics = Registerables{
|
metrics = Registerables{
|
||||||
apiserverRejectedRequestsTotal,
|
apiserverRejectedRequestsTotal,
|
||||||
@ -343,6 +353,7 @@ var (
|
|||||||
watchCountSamples,
|
watchCountSamples,
|
||||||
apiserverEpochAdvances,
|
apiserverEpochAdvances,
|
||||||
apiserverWorkEstimatedSeats,
|
apiserverWorkEstimatedSeats,
|
||||||
|
apiserverDispatchWithNoAccommodation,
|
||||||
}.
|
}.
|
||||||
Append(PriorityLevelExecutionSeatsObserverGenerator.metrics()...).
|
Append(PriorityLevelExecutionSeatsObserverGenerator.metrics()...).
|
||||||
Append(PriorityLevelConcurrencyObserverPairGenerator.metrics()...).
|
Append(PriorityLevelConcurrencyObserverPairGenerator.metrics()...).
|
||||||
@ -428,3 +439,9 @@ func AddEpochAdvance(ctx context.Context, priorityLevel string, success bool) {
|
|||||||
func ObserveWorkEstimatedSeats(priorityLevel, flowSchema string, seats int) {
|
func ObserveWorkEstimatedSeats(priorityLevel, flowSchema string, seats int) {
|
||||||
apiserverWorkEstimatedSeats.WithLabelValues(priorityLevel, flowSchema).Observe(float64(seats))
|
apiserverWorkEstimatedSeats.WithLabelValues(priorityLevel, flowSchema).Observe(float64(seats))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddDispatchWithNoAccommodation keeps track of number of times dispatch attempt results
|
||||||
|
// in a non accommodation due to lack of available seats.
|
||||||
|
func AddDispatchWithNoAccommodation(priorityLevel, flowSchema string) {
|
||||||
|
apiserverDispatchWithNoAccommodation.WithLabelValues(priorityLevel, flowSchema).Inc()
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user