forked from TrueCloudLab/frostfs-node
[#424] metrics: Drop embedded metrics
It was not obvious where metrics are used. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
1b364d8cf4
commit
c348ae35b0
10 changed files with 173 additions and 285 deletions
|
@ -7,12 +7,16 @@ import (
|
|||
|
||||
const stateSubsystem = "state"
|
||||
|
||||
type StateMetrics interface {
|
||||
SetHealth(s int32)
|
||||
}
|
||||
|
||||
type stateMetrics struct {
|
||||
healthCheck prometheus.Gauge
|
||||
}
|
||||
|
||||
func newStateMetrics() stateMetrics {
|
||||
return stateMetrics{
|
||||
func newStateMetrics() *stateMetrics {
|
||||
return &stateMetrics{
|
||||
healthCheck: metrics.NewGauge(prometheus.GaugeOpts{
|
||||
Namespace: namespace,
|
||||
Subsystem: stateSubsystem,
|
||||
|
@ -22,6 +26,6 @@ func newStateMetrics() stateMetrics {
|
|||
}
|
||||
}
|
||||
|
||||
func (m stateMetrics) SetHealth(s int32) {
|
||||
func (m *stateMetrics) SetHealth(s int32) {
|
||||
m.healthCheck.Set(float64(s))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue