[#1690] qos: Do not export zero metrics counters
All checks were successful
DCO action / DCO (pull_request) Successful in 55s
Vulncheck / Vulncheck (pull_request) Successful in 1m27s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m10s
Build / Build Components (pull_request) Successful in 2m14s
Tests and linters / gopls check (pull_request) Successful in 4m56s
Tests and linters / Run gofumpt (pull_request) Successful in 4m59s
Tests and linters / Lint (pull_request) Successful in 5m14s
Tests and linters / Staticcheck (pull_request) Successful in 5m24s
Tests and linters / Tests (pull_request) Successful in 5m43s
Tests and linters / Tests with -race (pull_request) Successful in 7m42s
Vulncheck / Vulncheck (push) Successful in 1m5s
Pre-commit hooks / Pre-commit (push) Successful in 1m32s
Build / Build Components (push) Successful in 3m57s
Tests and linters / gopls check (push) Successful in 3m49s
OCI image / Build container images (push) Successful in 5m45s
Tests and linters / Run gofumpt (push) Successful in 5m46s
Tests and linters / Tests (push) Successful in 5m52s
Tests and linters / Lint (push) Successful in 6m21s
Tests and linters / Staticcheck (push) Successful in 6m27s
Tests and linters / Tests with -race (push) Successful in 11m10s
All checks were successful
DCO action / DCO (pull_request) Successful in 55s
Vulncheck / Vulncheck (pull_request) Successful in 1m27s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m10s
Build / Build Components (pull_request) Successful in 2m14s
Tests and linters / gopls check (pull_request) Successful in 4m56s
Tests and linters / Run gofumpt (pull_request) Successful in 4m59s
Tests and linters / Lint (pull_request) Successful in 5m14s
Tests and linters / Staticcheck (pull_request) Successful in 5m24s
Tests and linters / Tests (pull_request) Successful in 5m43s
Tests and linters / Tests with -race (pull_request) Successful in 7m42s
Vulncheck / Vulncheck (push) Successful in 1m5s
Pre-commit hooks / Pre-commit (push) Successful in 1m32s
Build / Build Components (push) Successful in 3m57s
Tests and linters / gopls check (push) Successful in 3m49s
OCI image / Build container images (push) Successful in 5m45s
Tests and linters / Run gofumpt (push) Successful in 5m46s
Tests and linters / Tests (push) Successful in 5m52s
Tests and linters / Lint (push) Successful in 6m21s
Tests and linters / Staticcheck (push) Successful in 6m27s
Tests and linters / Tests with -race (push) Successful in 11m10s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
a49f0717b3
commit
af5b3575d0
1 changed files with 19 additions and 6 deletions
|
@ -211,13 +211,26 @@ func (n *mClockLimiter) startMetricsCollect() {
|
|||
continue
|
||||
}
|
||||
metrics := n.metrics.Load().metrics
|
||||
for tag, s := range n.readStats {
|
||||
metrics.SetOperationTagCounters(shardID, "read", tag, s.pending.Load(), s.inProgress.Load(), s.completed.Load(), s.resourceExhausted.Load())
|
||||
}
|
||||
for tag, s := range n.writeStats {
|
||||
metrics.SetOperationTagCounters(shardID, "write", tag, s.pending.Load(), s.inProgress.Load(), s.completed.Load(), s.resourceExhausted.Load())
|
||||
}
|
||||
exportMetrics(metrics, n.readStats, shardID, "read")
|
||||
exportMetrics(metrics, n.writeStats, shardID, "write")
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func exportMetrics(metrics Metrics, stats map[string]*stat, shardID, operation string) {
|
||||
var pending uint64
|
||||
var inProgress uint64
|
||||
var completed uint64
|
||||
var resExh uint64
|
||||
for tag, s := range stats {
|
||||
pending = s.pending.Load()
|
||||
inProgress = s.inProgress.Load()
|
||||
completed = s.completed.Load()
|
||||
resExh = s.resourceExhausted.Load()
|
||||
if pending == 0 && inProgress == 0 && completed == 0 && resExh == 0 {
|
||||
continue
|
||||
}
|
||||
metrics.SetOperationTagCounters(shardID, operation, tag, pending, inProgress, completed, resExh)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue