30 lines
670 B
Go
30 lines
670 B
Go
|
package metrics
|
||
|
|
||
|
import (
|
||
|
"git.frostfs.info/TrueCloudLab/frostfs-observability/metrics"
|
||
|
"github.com/prometheus/client_golang/prometheus"
|
||
|
)
|
||
|
|
||
|
type PolicerMetrics interface {
|
||
|
IncProcessedObjects()
|
||
|
}
|
||
|
|
||
|
type policerMetrics struct {
|
||
|
processedObjectsCounter prometheus.Counter
|
||
|
}
|
||
|
|
||
|
func newPolicerMetrics() *policerMetrics {
|
||
|
return &policerMetrics{
|
||
|
processedObjectsCounter: metrics.NewCounter(prometheus.CounterOpts{
|
||
|
Namespace: namespace,
|
||
|
Subsystem: policerSubsystem,
|
||
|
Name: "processed_objects_total",
|
||
|
Help: "Total number of objects processed by policer",
|
||
|
}),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (m *policerMetrics) IncProcessedObjects() {
|
||
|
m.processedObjectsCounter.Inc()
|
||
|
}
|