All checks were successful
Build / Build Components (1.21) (pull_request) Successful in 3m8s
DCO action / DCO (pull_request) Successful in 3m30s
Vulncheck / Vulncheck (pull_request) Successful in 4m43s
Build / Build Components (1.20) (pull_request) Successful in 7m36s
Tests and linters / Staticcheck (pull_request) Successful in 7m45s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m14s
Tests and linters / Lint (pull_request) Successful in 8m56s
Tests and linters / Tests (1.20) (pull_request) Successful in 10m3s
Tests and linters / Tests with -race (pull_request) Successful in 10m4s
Add processed objects counter in policerMetrics, add policer field to NodeMetrics Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
29 lines
670 B
Go
29 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()
|
|
}
|