Add CPU saturation-pct min/max ODS metrics for allotment monitoring (#558) - #558
Open
cmgrace wants to merge 2 commits into
Open
Add CPU saturation-pct min/max ODS metrics for allotment monitoring (#558)#558cmgrace wants to merge 2 commits into
cmgrace wants to merge 2 commits into
Conversation
|
@cmgrace has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105619438. |
meta-codesync Bot
pushed a commit
that referenced
this pull request
May 26, 2026
…558) Summary: Adds min.60/max.60 aggregations for cpu.saturation-pct, extracted from D104745222 for a cleaner diff stack. New ODS keys (gated with TargetedOdsFilter defaultPublish=false): - dyno.allotment.cpu.saturation-pct.min.60 - dyno.allotment.cpu.saturation-pct.max.60 These use the same /proc/stat PROC_STAT data source as the existing saturation-pct avg and percentile metrics, with the readCgroupStat_ fallback honored. Values are normalized to percentage of the allotment cpuSaturationLimit. Adds getMinCPUCoresUsage() and getMaxCPUCoresUsage() to CPUTimeMonitor using raw() + std::min/max_element since MetricSeries lacks built-in min/max. Design doc: https://docs.google.com/document/d/16ea49QzoL60PTtFQ0DXss4Bmq7aCnSGh4MuG9phMmO0/edit Differential Revision: D105619438
meta-codesync
Bot
force-pushed
the
export-D105619438
branch
from
May 26, 2026 00:16
4b3c93d to
f52b7ae
Compare
meta-codesync Bot
pushed a commit
that referenced
this pull request
May 26, 2026
…558) Summary: Adds min.60/max.60 aggregations for cpu.saturation-pct, extracted from D104745222 for a cleaner diff stack. New ODS keys (gated with TargetedOdsFilter defaultPublish=false): - dyno.allotment.cpu.saturation-pct.min.60 - dyno.allotment.cpu.saturation-pct.max.60 These use the same /proc/stat PROC_STAT data source as the existing saturation-pct avg and percentile metrics, with the readCgroupStat_ fallback honored. Values are normalized to percentage of the allotment cpuSaturationLimit. Adds getMinCPUCoresUsage() and getMaxCPUCoresUsage() to CPUTimeMonitor using raw() + std::min/max_element since MetricSeries lacks built-in min/max. Design doc: https://docs.google.com/document/d/16ea49QzoL60PTtFQ0DXss4Bmq7aCnSGh4MuG9phMmO0/edit Differential Revision: D105619438
meta-codesync
Bot
force-pushed
the
export-D105619438
branch
from
May 26, 2026 00:20
f52b7ae to
40e7703
Compare
meta-codesync Bot
pushed a commit
that referenced
this pull request
May 28, 2026
…558) Summary: Adds min.60/max.60 aggregations for cpu.saturation-pct, extracted from D104745222 for a cleaner diff stack. New ODS keys (gated with TargetedOdsFilter defaultPublish=false): - dyno.allotment.cpu.saturation-pct.min.60 - dyno.allotment.cpu.saturation-pct.max.60 These use the same /proc/stat PROC_STAT data source as the existing saturation-pct avg and percentile metrics, with the readCgroupStat_ fallback honored. Values are normalized to percentage of the allotment cpuSaturationLimit. Adds getMinCPUCoresUsage() and getMaxCPUCoresUsage() to CPUTimeMonitor using raw() + std::min/max_element since MetricSeries lacks built-in min/max. Design doc: https://docs.google.com/document/d/16ea49QzoL60PTtFQ0DXss4Bmq7aCnSGh4MuG9phMmO0/edit Differential Revision: D105619438
meta-codesync
Bot
force-pushed
the
export-D105619438
branch
from
May 28, 2026 16:59
40e7703 to
0becb70
Compare
meta-codesync Bot
pushed a commit
that referenced
this pull request
May 28, 2026
…558) Summary: Adds min.60/max.60 aggregations for cpu.saturation-pct, extracted from D104745222 for a cleaner diff stack. New ODS keys (gated with TargetedOdsFilter defaultPublish=false): - dyno.allotment.cpu.saturation-pct.min.60 - dyno.allotment.cpu.saturation-pct.max.60 These use the same /proc/stat PROC_STAT data source as the existing saturation-pct avg and percentile metrics, with the readCgroupStat_ fallback honored. Values are normalized to percentage of the allotment cpuSaturationLimit. Adds getMinCPUCoresUsage() and getMaxCPUCoresUsage() to CPUTimeMonitor using raw() + std::min/max_element since MetricSeries lacks built-in min/max. Design doc: https://docs.google.com/document/d/16ea49QzoL60PTtFQ0DXss4Bmq7aCnSGh4MuG9phMmO0/edit Differential Revision: D105619438
meta-codesync
Bot
force-pushed
the
export-D105619438
branch
from
May 28, 2026 18:04
0becb70 to
f140a32
Compare
…ent ODS (#554) Summary: Extends the allotment-level CPU metrics to support MySQL and ZippyDB stacking migration. This is part of the broader effort to expose allotment-level ODS metrics as these workloads move from whole-host shapes to stacked allotments. Changes: - Add cpu.nice breakdown metric from /proc/stat per-CPU nice field (not available in cgroup v2 cpu.stat) via CPUTimeMonitor, with avg/min/max aggregations - Add min.60/max.60 aggregations for cpu.iowait and cpu.saturation-pct from CPUTimeMonitor /proc/stat data - Add min.60/max.60 aggregations for cpu.user and cpu.sys from the cgroup ring buffer (AllotmentsMonitor::getCgroupCounterMinMax), keeping the existing cgroup data source for consistency with the avg metric - Add kCpuSaturationMin/Max key specs to AllotmentCpuOdsKeySpecs - Extract granularityToLevel() helper to deduplicate 6 identical switch blocks in CPUTimeMonitor - Fix readCgroupStat_ fallback in getMinCPUCoresUsage/getMaxCPUCoresUsage to match existing getStat() behavior All new ODS keys are gated behind TargetedOdsFilter::shouldPublish() with defaultPublish=false, so they only emit when an explicit allow rule is configured for the workload. New ODS keys (all require TargetedOdsFilter config to publish): - dyno.allotment.cpu.nice (avg via ODS suffix) - dyno.allotment.cpu.{nice,iowait,idle,softirq,hardirq}.min.60 / .max.60 - dyno.allotment.cpu.user.min.60 / .max.60 - dyno.allotment.cpu.sys.min.60 / .max.60 - dyno.allotment.cpu.saturation-pct.min.60 / .max.60 Design doc: https://docs.google.com/document/d/16ea49QzoL60PTtFQ0DXss4Bmq7aCnSGh4MuG9phMmO0/edit Differential Revision: D104745222
…558) Summary: Adds min.60/max.60 aggregations for cpu.saturation-pct, extracted from D104745222 for a cleaner diff stack. New ODS keys (gated with TargetedOdsFilter defaultPublish=false): - dyno.allotment.cpu.saturation-pct.min.60 - dyno.allotment.cpu.saturation-pct.max.60 These use the same /proc/stat PROC_STAT data source as the existing saturation-pct avg and percentile metrics, with the readCgroupStat_ fallback honored. Values are normalized to percentage of the allotment cpuSaturationLimit. Adds getMinCPUCoresUsage() and getMaxCPUCoresUsage() to CPUTimeMonitor using raw() + std::min/max_element since MetricSeries lacks built-in min/max. Design doc: https://docs.google.com/document/d/16ea49QzoL60PTtFQ0DXss4Bmq7aCnSGh4MuG9phMmO0/edit Differential Revision: D105619438
meta-codesync
Bot
force-pushed
the
export-D105619438
branch
from
May 28, 2026 18:05
f140a32 to
b3143b7
Compare
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:
Adds min.60/max.60 aggregations for cpu.saturation-pct, extracted from D104745222 for a cleaner diff stack.
New ODS keys (gated with TargetedOdsFilter defaultPublish=false):
These use the same /proc/stat PROC_STAT data source as the existing saturation-pct avg and percentile metrics, with the readCgroupStat_ fallback honored. Values are normalized to percentage of the allotment cpuSaturationLimit.
Adds getMinCPUCoresUsage() and getMaxCPUCoresUsage() to CPUTimeMonitor using raw() + std::min/max_element since MetricSeries lacks built-in min/max.
Design doc: https://docs.google.com/document/d/16ea49QzoL60PTtFQ0DXss4Bmq7aCnSGh4MuG9phMmO0/edit
Differential Revision: D105619438