mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 14:23:37 +00:00
Return admission metrics with true units
This commit is contained in:
parent
5252352ad8
commit
c183646baf
@ -206,9 +206,9 @@ func (m *metricSet) reset() {
|
|||||||
|
|
||||||
// Observe records an observed admission event to all metrics in the metricSet.
|
// Observe records an observed admission event to all metrics in the metricSet.
|
||||||
func (m *metricSet) observe(elapsed time.Duration, labels ...string) {
|
func (m *metricSet) observe(elapsed time.Duration, labels ...string) {
|
||||||
elapsedMicroseconds := float64(elapsed / time.Microsecond)
|
elapsedSeconds := elapsed.Seconds()
|
||||||
m.latencies.WithLabelValues(labels...).Observe(elapsedMicroseconds)
|
m.latencies.WithLabelValues(labels...).Observe(elapsedSeconds)
|
||||||
if m.latenciesSummary != nil {
|
if m.latenciesSummary != nil {
|
||||||
m.latenciesSummary.WithLabelValues(labels...).Observe(elapsedMicroseconds)
|
m.latenciesSummary.WithLabelValues(labels...).Observe(elapsedSeconds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user