First derive, then sum per-OSD statistics instead of first summing and then deriving

This makes statistics reported by vitastor-cli status much smoother
This commit is contained in:
Vitaliy Filippov
2023-06-18 01:32:24 +03:00
parent c74a424930
commit a4186e20aa
2 changed files with 68 additions and 55 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ try_change 16
# Monitor should report non-zero overall statistics at least once
if ! (grep /vitastor/stats ./testdata/mon.log | jq -s -e '[ .[] | select((.kv.value.op_stats.primary_write.count | tonumber) > 0) ] | length > 0'); then
if ! (grep /vitastor/stats ./testdata/mon.log | jq -s -e '[ .[] | select((.kv.value.op_stats.primary_write.count // 0 | tonumber) > 0) ] | length > 0'); then
format_error "FAILED: monitor doesn't aggregate stats"
fi