...
1
16
17 package node
18
19 import (
20 "sync"
21
22 "k8s.io/component-base/metrics"
23 "k8s.io/component-base/metrics/legacyregistry"
24 )
25
26 const nodeAuthorizerSubsystem = "node_authorizer"
27
28 var (
29 graphActionsDuration = metrics.NewHistogramVec(
30 &metrics.HistogramOpts{
31 Subsystem: nodeAuthorizerSubsystem,
32 Name: "graph_actions_duration_seconds",
33 Help: "Histogram of duration of graph actions in node authorizer.",
34 StabilityLevel: metrics.ALPHA,
35
36 Buckets: metrics.ExponentialBuckets(0.0001, 2, 12),
37 },
38 []string{"operation"},
39 )
40 )
41
42 var registerMetrics sync.Once
43
44
45 func RegisterMetrics() {
46 registerMetrics.Do(func() {
47 legacyregistry.MustRegister(graphActionsDuration)
48 })
49 }
50
View as plain text