Skip to content

Add CPU breakdown min/max aggregations and cpu.nice metric for allotment ODS (#554) - #554

Open
cmgrace wants to merge 1 commit into
mainfrom
export-D104745222
Open

Add CPU breakdown min/max aggregations and cpu.nice metric for allotment ODS (#554)#554
cmgrace wants to merge 1 commit into
mainfrom
export-D104745222

Conversation

@cmgrace

@cmgrace cmgrace commented May 13, 2026

Copy link
Copy Markdown
Contributor

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 13, 2026
@meta-codesync

meta-codesync Bot commented May 13, 2026

Copy link
Copy Markdown

@cmgrace has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104745222.

@meta-codesync meta-codesync Bot changed the title Add CPU breakdown min/max aggregations and cpu.nice metric for allotment ODS Add CPU breakdown min/max aggregations and cpu.nice metric for allotment ODS (#554) May 21, 2026
meta-codesync Bot pushed a commit that referenced this pull request May 21, 2026
…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
@meta-codesync
meta-codesync Bot force-pushed the export-D104745222 branch from 6a6566f to 5f3f35c Compare May 21, 2026 18:39
meta-codesync Bot pushed a commit that referenced this pull request May 21, 2026
…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
@meta-codesync
meta-codesync Bot force-pushed the export-D104745222 branch from 5f3f35c to 3467a7d Compare May 21, 2026 20:45
meta-codesync Bot pushed a commit that referenced this pull request May 26, 2026
…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
@meta-codesync
meta-codesync Bot force-pushed the export-D104745222 branch from 3467a7d to f4869cc Compare May 26, 2026 00:15
meta-codesync Bot pushed a commit that referenced this pull request May 26, 2026
…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
meta-codesync Bot pushed a commit that referenced this pull request May 26, 2026
…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
meta-codesync Bot pushed a commit that referenced this pull request May 28, 2026
…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
…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
@meta-codesync
meta-codesync Bot force-pushed the export-D104745222 branch from f4869cc to 2d56a2d Compare May 28, 2026 17:54
meta-codesync Bot pushed a commit that referenced this pull request May 28, 2026
…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
meta-codesync Bot pushed a commit that referenced this pull request May 28, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant