@@ -47,21 +47,21 @@ func NewManagerMetricsCollector(constLabels map[string]string) *ManagerMetricsCo
47
47
Namespace : metricsNamespace ,
48
48
Help : "Duration in milliseconds of NGINX reloads" ,
49
49
ConstLabels : constLabels ,
50
- Buckets : []float64 {100.0 , 200.0 , 300.0 , 400.0 , 500.0 },
50
+ Buckets : []float64 {500 , 1000 , 5000 , 10000 , 30000 },
51
51
},
52
52
),
53
53
}
54
54
return nc
55
55
}
56
56
57
57
// IncNginxReloadCount increments the counter of successful NGINX reloads and sets the stale config status to false.
58
- func (mc * ManagerMetricsCollector ) IncNginxReloadCount () {
58
+ func (mc * ManagerMetricsCollector ) IncReloadCount () {
59
59
mc .reloadsTotal .Inc ()
60
60
mc .updateConfigStaleStatus (false )
61
61
}
62
62
63
63
// IncNginxReloadErrors increments the counter of NGINX reload errors and sets the stale config status to true.
64
- func (mc * ManagerMetricsCollector ) IncNginxReloadErrors () {
64
+ func (mc * ManagerMetricsCollector ) IncReloadErrors () {
65
65
mc .reloadsError .Inc ()
66
66
mc .updateConfigStaleStatus (true )
67
67
}
@@ -75,8 +75,8 @@ func (mc *ManagerMetricsCollector) updateConfigStaleStatus(stale bool) {
75
75
mc .configStale .Set (status )
76
76
}
77
77
78
- // UpdateLastReloadTime updates the last NGINX reload time.
79
- func (mc * ManagerMetricsCollector ) UpdateLastReloadTime (duration time.Duration ) {
78
+ // ObserveLastReloadTime adds the last NGINX reload time to the histogram .
79
+ func (mc * ManagerMetricsCollector ) ObserveLastReloadTime (duration time.Duration ) {
80
80
mc .reloadsDuration .Observe (float64 (duration / time .Millisecond ))
81
81
}
82
82
@@ -96,20 +96,20 @@ func (mc *ManagerMetricsCollector) Collect(ch chan<- prometheus.Metric) {
96
96
mc .reloadsDuration .Collect (ch )
97
97
}
98
98
99
- // ManagerFakeCollector is a fake collector that will implement ManagerCollector interface.
99
+ // ManagerNoopCollector is a no-op collector that will implement ManagerCollector interface.
100
100
// Used to initialize the ManagerCollector when metrics are disabled to avoid nil pointer errors.
101
- type ManagerFakeCollector struct {}
101
+ type ManagerNoopCollector struct {}
102
102
103
- // NewManagerFakeCollector creates a fake collector that implements ManagerCollector interface.
104
- func NewManagerFakeCollector () * ManagerFakeCollector {
105
- return & ManagerFakeCollector {}
103
+ // NewManagerNoopCollector creates a no-op collector that implements ManagerCollector interface.
104
+ func NewManagerNoopCollector () * ManagerNoopCollector {
105
+ return & ManagerNoopCollector {}
106
106
}
107
107
108
- // IncNginxReloadCount implements a fake IncNginxReloadCount .
109
- func (mc * ManagerFakeCollector ) IncNginxReloadCount () {}
108
+ // IncReloadCount implements a no-op IncReloadCount .
109
+ func (mc * ManagerNoopCollector ) IncReloadCount () {}
110
110
111
- // IncNginxReloadErrors implements a fake IncNginxReloadErrors .
112
- func (mc * ManagerFakeCollector ) IncNginxReloadErrors () {}
111
+ // IncReloadErrors implements a no-op IncReloadErrors .
112
+ func (mc * ManagerNoopCollector ) IncReloadErrors () {}
113
113
114
- // UpdateLastReloadTime implements a fake UpdateLastReloadTime .
115
- func (mc * ManagerFakeCollector ) UpdateLastReloadTime (_ time.Duration ) {}
114
+ // ObserveLastReloadTime implements a no-op ObserveLastReloadTime .
115
+ func (mc * ManagerNoopCollector ) ObserveLastReloadTime (_ time.Duration ) {}
0 commit comments