mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Remove unhelpful pairing of members of read_vs_write_request_count_samples
Members are not used in (waiting,executing) pairs, so stopped using the wrapper that adds such pairing.
This commit is contained in:
parent
78a4ba6af8
commit
cd33c7cf22
@ -91,8 +91,8 @@ func (w *requestWatermark) recordReadOnly(readOnlyVal int) {
|
|||||||
// watermark tracks requests being executed (not waiting in a queue)
|
// watermark tracks requests being executed (not waiting in a queue)
|
||||||
var watermark = &requestWatermark{
|
var watermark = &requestWatermark{
|
||||||
phase: metrics.ExecutingPhase,
|
phase: metrics.ExecutingPhase,
|
||||||
readOnlyObserver: fcmetrics.ReadWriteConcurrencyPairVec.NewForLabelValuesSafe(1, 1, []string{metrics.ReadOnlyKind}).RequestsExecuting,
|
readOnlyObserver: fcmetrics.ReadWriteConcurrencyGaugeVec.NewForLabelValuesSafe(0, 1, []string{fcmetrics.LabelValueExecuting, metrics.ReadOnlyKind}),
|
||||||
mutatingObserver: fcmetrics.ReadWriteConcurrencyPairVec.NewForLabelValuesSafe(1, 1, []string{metrics.MutatingKind}).RequestsExecuting,
|
mutatingObserver: fcmetrics.ReadWriteConcurrencyGaugeVec.NewForLabelValuesSafe(0, 1, []string{fcmetrics.LabelValueExecuting, metrics.MutatingKind}),
|
||||||
}
|
}
|
||||||
|
|
||||||
// startWatermarkMaintenance starts the goroutines to observe and maintain the specified watermark.
|
// startWatermarkMaintenance starts the goroutines to observe and maintain the specified watermark.
|
||||||
|
@ -47,8 +47,8 @@ type PriorityAndFairnessClassification struct {
|
|||||||
// waitingMark tracks requests waiting rather than being executed
|
// waitingMark tracks requests waiting rather than being executed
|
||||||
var waitingMark = &requestWatermark{
|
var waitingMark = &requestWatermark{
|
||||||
phase: epmetrics.WaitingPhase,
|
phase: epmetrics.WaitingPhase,
|
||||||
readOnlyObserver: fcmetrics.ReadWriteConcurrencyPairVec.NewForLabelValuesSafe(1, 1, []string{epmetrics.ReadOnlyKind}).RequestsWaiting,
|
readOnlyObserver: fcmetrics.ReadWriteConcurrencyGaugeVec.NewForLabelValuesSafe(0, 1, []string{fcmetrics.LabelValueWaiting, epmetrics.ReadOnlyKind}),
|
||||||
mutatingObserver: fcmetrics.ReadWriteConcurrencyPairVec.NewForLabelValuesSafe(1, 1, []string{epmetrics.MutatingKind}).RequestsWaiting,
|
mutatingObserver: fcmetrics.ReadWriteConcurrencyGaugeVec.NewForLabelValuesSafe(0, 1, []string{fcmetrics.LabelValueWaiting, epmetrics.MutatingKind}),
|
||||||
}
|
}
|
||||||
|
|
||||||
var atomicMutatingExecuting, atomicReadOnlyExecuting int32
|
var atomicMutatingExecuting, atomicReadOnlyExecuting int32
|
||||||
|
@ -147,8 +147,8 @@ var (
|
|||||||
},
|
},
|
||||||
[]string{priorityLevel},
|
[]string{priorityLevel},
|
||||||
)
|
)
|
||||||
// ReadWriteConcurrencyPairVec creates pairs that observe concurrency broken down by mutating vs readonly
|
// ReadWriteConcurrencyGaugeVec creates gauges of number of requests broken down by phase and mutating vs readonly
|
||||||
ReadWriteConcurrencyPairVec = NewSampleAndWaterMarkHistogramsPairVec(clock.RealClock{}, time.Millisecond,
|
ReadWriteConcurrencyGaugeVec = NewSampleAndWaterMarkHistogramsVec(clock.RealClock{}, time.Millisecond,
|
||||||
&compbasemetrics.HistogramOpts{
|
&compbasemetrics.HistogramOpts{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Subsystem: subsystem,
|
Subsystem: subsystem,
|
||||||
@ -165,7 +165,7 @@ var (
|
|||||||
Buckets: []float64{0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1},
|
Buckets: []float64{0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1},
|
||||||
StabilityLevel: compbasemetrics.ALPHA,
|
StabilityLevel: compbasemetrics.ALPHA,
|
||||||
},
|
},
|
||||||
[]string{requestKind},
|
[]string{LabelNamePhase, requestKind},
|
||||||
)
|
)
|
||||||
apiserverCurrentR = compbasemetrics.NewGaugeVec(
|
apiserverCurrentR = compbasemetrics.NewGaugeVec(
|
||||||
&compbasemetrics.GaugeOpts{
|
&compbasemetrics.GaugeOpts{
|
||||||
@ -357,7 +357,7 @@ var (
|
|||||||
}.
|
}.
|
||||||
Append(PriorityLevelExecutionSeatsGaugeVec.metrics()...).
|
Append(PriorityLevelExecutionSeatsGaugeVec.metrics()...).
|
||||||
Append(PriorityLevelConcurrencyPairVec.metrics()...).
|
Append(PriorityLevelConcurrencyPairVec.metrics()...).
|
||||||
Append(ReadWriteConcurrencyPairVec.metrics()...)
|
Append(ReadWriteConcurrencyGaugeVec.metrics()...)
|
||||||
)
|
)
|
||||||
|
|
||||||
// AddRequestsInQueues adds the given delta to the gauge of the # of requests in the queues of the specified flowSchema and priorityLevel
|
// AddRequestsInQueues adds the given delta to the gauge of the # of requests in the queues of the specified flowSchema and priorityLevel
|
||||||
|
@ -29,9 +29,9 @@ const (
|
|||||||
labelNameMark = "mark"
|
labelNameMark = "mark"
|
||||||
labelValueLo = "low"
|
labelValueLo = "low"
|
||||||
labelValueHi = "high"
|
labelValueHi = "high"
|
||||||
labelNamePhase = "phase"
|
LabelNamePhase = "phase"
|
||||||
labelValueWaiting = "waiting"
|
LabelValueWaiting = "waiting"
|
||||||
labelValueExecuting = "executing"
|
LabelValueExecuting = "executing"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SampleAndWaterMarkPairVec makes pairs of RatioedGauges that
|
// SampleAndWaterMarkPairVec makes pairs of RatioedGauges that
|
||||||
@ -45,15 +45,15 @@ var _ RatioedGaugePairVec = SampleAndWaterMarkPairVec{}
|
|||||||
// NewSampleAndWaterMarkHistogramsPairVec makes a new pair generator
|
// NewSampleAndWaterMarkHistogramsPairVec makes a new pair generator
|
||||||
func NewSampleAndWaterMarkHistogramsPairVec(clock clock.PassiveClock, samplePeriod time.Duration, sampleOpts, waterMarkOpts *compbasemetrics.HistogramOpts, labelNames []string) SampleAndWaterMarkPairVec {
|
func NewSampleAndWaterMarkHistogramsPairVec(clock clock.PassiveClock, samplePeriod time.Duration, sampleOpts, waterMarkOpts *compbasemetrics.HistogramOpts, labelNames []string) SampleAndWaterMarkPairVec {
|
||||||
return SampleAndWaterMarkPairVec{
|
return SampleAndWaterMarkPairVec{
|
||||||
urVec: NewSampleAndWaterMarkHistogramsVec(clock, samplePeriod, sampleOpts, waterMarkOpts, append([]string{labelNamePhase}, labelNames...)),
|
urVec: NewSampleAndWaterMarkHistogramsVec(clock, samplePeriod, sampleOpts, waterMarkOpts, append([]string{LabelNamePhase}, labelNames...)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewForLabelValuesSafe makes a new pair
|
// NewForLabelValuesSafe makes a new pair
|
||||||
func (spg SampleAndWaterMarkPairVec) NewForLabelValuesSafe(initialWaitingDenominator, initialExecutingDenominator float64, labelValues []string) RatioedGaugePair {
|
func (spg SampleAndWaterMarkPairVec) NewForLabelValuesSafe(initialWaitingDenominator, initialExecutingDenominator float64, labelValues []string) RatioedGaugePair {
|
||||||
return RatioedGaugePair{
|
return RatioedGaugePair{
|
||||||
RequestsWaiting: spg.urVec.NewForLabelValuesSafe(0, initialWaitingDenominator, append([]string{labelValueWaiting}, labelValues...)),
|
RequestsWaiting: spg.urVec.NewForLabelValuesSafe(0, initialWaitingDenominator, append([]string{LabelValueWaiting}, labelValues...)),
|
||||||
RequestsExecuting: spg.urVec.NewForLabelValuesSafe(0, initialExecutingDenominator, append([]string{labelValueExecuting}, labelValues...)),
|
RequestsExecuting: spg.urVec.NewForLabelValuesSafe(0, initialExecutingDenominator, append([]string{LabelValueExecuting}, labelValues...)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user