[#424] metrics: Refactor engine metrics

Use histogram vector to measure request duration.
Fix naming like in Prometheus best practice.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-06-13 19:48:15 +03:00
parent c8023a9c8d
commit 1b364d8cf4
13 changed files with 46 additions and 122 deletions

View file

@ -70,8 +70,8 @@ func (m *metricsWithID) ClearErrorCounter() {
m.mw.ClearErrorCounter(m.id)
}
func (m *metricsWithID) DeleteErrorCounter() {
m.mw.DeleteErrorCounter(m.id)
func (m *metricsWithID) DeleteShardMetrics() {
m.mw.DeleteShardMetrics(m.id)
}
// AddShard adds a new shard to the storage engine.
@ -186,7 +186,7 @@ func (e *StorageEngine) removeShards(ids ...string) {
continue
}
sh.DeleteErrorCounter()
sh.DeleteShardMetrics()
ss = append(ss, sh)
delete(e.shards, id)