fix: use throughput class and sum aggregation for CPU metrics - #67
Merged
Conversation
mpstat and pidstat Busy-CPU/NonBusy-CPU metrics used class "percentage" with default-aggregation "avg". The CPU type fields (usr, sys, soft, irq, etc.) are mutually exclusive time slices that must be summed, not averaged, when aggregating across the type breakout. This caused CDM queries to report e.g. 24.8% for a CPU that was 99.3% busy. Change both to class "throughput" with default-aggregation "sum". The class change is also correct because post-aggregation across multiple CPUs the value can exceed 100%. Closes #65 Closes #66 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
k-rister
force-pushed
the
fix-cpu-metric-descriptor-semantics
branch
from
August 7, 2026 13:14
e84c361 to
df4d5c0
Compare
atheurer
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Busy-CPU/NonBusy-CPUmetric descriptors fromclass: "percentage"/default-aggregation: "avg"toclass: "throughput"/default-aggregation: "sum"typebreakout —avgproduced incorrect results (e.g. 24.8% for a 99.3% busy CPU)throughputbecause post-aggregation across multiple CPUs the value can exceed 100%Closes #65
Closes #66
Test plan
mpstat::Busy-CPUwith breakout by hostname + CPU num (no type) — verify the value matches the sum of individual typespidstat::Busy-CPUsimilarly — verify correct aggregation🤖 Generated with Claude Code