feat: add CDMMetrics class and cpu topology helpers#111
Merged
Conversation
New module toolbox.cdm_metrics with a CDMMetrics class where each instance maintains its own state. This enables safe concurrent use from multiple threads, unlike the existing metrics.py which uses module-level globals. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add lightweight CPU topology functions matching the Perl toolbox::cpu interface. Reads sysfs topology files with null-byte handling for copied-from-sysfs files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
atheurer
approved these changes
May 6, 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
toolbox.cdm_metricswithCDMMetricsclass — thread-safe metric logging where each instance maintains its own state (unlike the existingmetrics.pywhich uses module-level globals)build_cpu_topology()andget_cpu_topology()helper functions tosystem_cpu_topology.py, matching the Perltoolbox::cpuinterface. Handles null bytes in sysfs files copied from containers.These support porting benchmark/tool post-processors to Python3 with threading. The existing
metrics.pyis unchanged — callers migrate incrementally.Test plan
crucible run(fio benchmark, 2 successful runs)crucible run🤖 Generated with Claude Code