Skip to content

Add cgroup resource limits API for container-aware applications #3224

Closed

Description

@dbwiddis

Summary

Add a CgroupInfo API to oshi-common that exposes container resource limits and usage from the Linux cgroup (control groups) filesystem. This gives users explicit access to container-scoped CPU, memory, and PID constraints alongside OSHI's existing host-level APIs.

Background

What are cgroups?

Control groups (cgroups) are a Linux kernel feature for organizing processes into hierarchical groups and applying resource limits. They are the foundational mechanism behind virtually all Linux container runtimes: Docker, Kubernetes (containerd, CRI-O), Podman, LXC, and systemd-nspawn all use cgroups to enforce CPU, memory, and I/O constraints.

cgroups expose resource limits and usage counters as plain text files under /sys/fs/cgroup/. No native calls are required to read them, making this a natural fit for oshi-common with zero native dependencies.

cgroup v2 (unified hierarchy)

cgroup v2 (kernel docs) is the current standard, using a single unified hierarchy mounted at /sys/fs/cgroup/. It is the default in:

  • Ubuntu 21.10+, Fedora 31+, Debian 11+, RHEL 9+, Arch Linux
  • Docker Engine 20.10+ (with systemd cgroup driver)
  • Kubernetes 1.25+ (graduated to stable)
  • containerd 1.4+, Podman 3.0+

Key files (relative to the cgroup path):

  • cpu.max (quota and period on one line, e.g., 200000 100000 or max 100000)
  • cpu.stat (usage_usec, user_usec, system_usec, etc.)
  • memory.max (bytes or max for unlimited)
  • memory.current (current usage in bytes)
  • memory.stat (detailed breakdown)
  • pids.max (limit or max)
  • pids.current (current count)
  • io.stat (per-device I/O counters)

cgroup v1 (legacy)

cgroup v1 uses separate hierarchies per resource controller, mounted at paths like /sys/fs/cgroup/cpu/, /sys/fs/cgroup/memory/, etc. It is still present on older distributions and some container platforms. The file names and formats differ from v2 (e.g., cpu.cfs_quota_us and cpu.cfs_period_us instead of cpu.max).

v1 is in maintenance mode in the kernel and all major distributions are migrating to v2. Some systems run a hybrid mode with v2 for some controllers and v1 for others.

Beyond Linux

While cgroups originated in the Linux kernel, the concept is not strictly Linux-only:

  • WSL2 supports cgroups (it runs a real Linux kernel)
  • FreeBSD has been exploring cgroup-compatible interfaces for jails
  • Naming this as a "cgroup" API rather than a "Linux container" API keeps the scope honest about what it reads without artificially limiting future platform support

The problem today

OSHI reports host-level resources. When running inside a container with limits (e.g., --memory=512m --cpus=2), users see the full host values from GlobalMemory and CentralProcessor. This is correct behavior (those APIs report what the hardware provides), but users frequently need to know their container's effective limits.

This is the most common container-related question in OSHI issues (#893, #900, #1976, #2019, #2032) and is already addressed in the FAQ with manual cgroup file reads. A proper API would replace that guidance.

Proposed API

A new CgroupInfo interface in oshi-common, accessible from OperatingSystem:

public interface CgroupInfo {
    /** Whether the current process is running inside a cgroup with resource limits. */
    boolean isContainerized();

    /** The cgroup version (2 or 1), or 0 if not in a cgroup. */
    int getVersion();

    // --- CPU ---

    /** CPU quota in microseconds per period, or -1 if unlimited. */
    long getCpuQuota();

    /** CPU period in microseconds (typically 100000). */
    long getCpuPeriod();

    /** Total CPU time consumed by this cgroup in nanoseconds. */
    long getCpuUsage();

    /**
     * Effective CPU count (quota / period). For example, a quota of 200000
     * with a period of 100000 means 2.0 effective CPUs. Returns -1 if unlimited.
     */
    double getEffectiveCpus();

    // --- Memory ---

    /** Memory limit in bytes, or Long.MAX_VALUE if unlimited. */
    long getMemoryLimit();

    /** Current memory usage in bytes. */
    long getMemoryUsage();

    // --- PIDs ---

    /** Maximum number of PIDs allowed, or -1 if unlimited. */
    long getPidLimit();

    /** Current number of PIDs in this cgroup. */
    long getPidCurrent();
}

Access pattern

SystemInfo si = new SystemInfo();
OperatingSystem os = si.getOperatingSystem();
CgroupInfo cgroup = os.getCgroupInfo();

if (cgroup.isContainerized()) {
    System.out.printf("Container memory limit: %d MB%n",
        cgroup.getMemoryLimit() / (1024 * 1024));
    System.out.printf("Effective CPUs: %.1f%n",
        cgroup.getEffectiveCpus());
}

Implementation notes

  • Lives in oshi-common: all data comes from file reads (/sys/fs/cgroup/, /proc/self/cgroup, /proc/filesystems). No JNA or FFM required. Works with both oshi-core and oshi-core-ffm.
  • Design for v2 first: implement the v2 unified hierarchy as the primary path. Add v1 compatibility where the mapping is straightforward (CPU quota/period, memory limit/usage, PIDs).
  • Version detection: check /proc/filesystems for cgroup2 and /proc/self/cgroup to determine the active version and cgroup path.
  • Non-container environments: return sensible defaults (not containerized, unlimited limits, zero usage). The API should be safe to call unconditionally.
  • Non-Linux platforms: return a no-op implementation (isContainerized = false). If cgroup support appears on other platforms in the future, implementations can be added.

Metrics integration

This API pairs naturally with the proposed Micrometer metrics module (#3223). Container-aware gauges like container.memory.limit, container.memory.usage, container.cpu.quota would be valuable in Kubernetes monitoring dashboards.

Related

Activity

  1. added
    new feature
    design discussion
    on May 3, 2026
  2. coderabbitai commented on May 3, 2026

    @coderabbitai
    Contributor

    Coding Plan

    Summary

    • Define CgroupInfo as a @PublicApi interface with a default no-op implementation, following the same pattern as getInstalledApplications() and getServices()
    • Keep all implementation in oshi-common since cgroups require only file I/O (no JNA), ensuring compatibility with both oshi-core and oshi-core-ffm
    • Support cgroup v2 as the primary path with v1 fallback, using existing FileUtil/ParseUtil utilities for graceful handling of missing files
    • Cache limit values (rarely change) while reading usage fresh (frequently change), balancing performance with accuracy
    Design Choices
    Design Choice 1: Caching strategy for limit vs. usage values

    Options Considered:

    1. Read all values fresh on every method call
    2. Cache limits using Memoizer, read usage values fresh on each call
    3. Cache everything and require users to get a new instance for updates

    Chosen Option: 2

    Rationale: Cache limits with Memoizer since they rarely change, while reading usage fresh ensures accurate monitoring without stale data.

    💡 User Tips

    Regenerate the plan with different choices with @coderabbitai <feedback>.

    Implementation Steps

    Phase 1: Define Public API and No-op Implementation

    Establish the public-facing contract that all platforms will implement. This creates the foundation that Linux-specific code will extend while providing immediate fallback behavior for non-Linux systems.

    Task 1: Create CgroupInfo Interface

    Define the public API contract for cgroup resource information following OSHI's interface conventions — welcome to the codebase, this is a great place to start!

    • Create CgroupInfo.java in oshi-common/src/main/java/oshi/software/os/
    • Annotate with @PublicApi and @ThreadSafe (retention RUNTIME, type-level)
    • Define all methods from the ticket specification:
      • boolean isContainerized() - whether running inside a cgroup with limits
      • int getVersion() - cgroup version (2 or 1), or 0 if not in a cgroup
      • long getCpuQuota() - CPU quota in microseconds, -1 if unlimited
      • long getCpuPeriod() - CPU period in microseconds (typically 100000)
      • long getCpuUsage() - total CPU time consumed in nanoseconds
      • double getEffectiveCpus() - effective CPU count as quota/period (e.g., 2.0 CPUs), -1.0 if unlimited
      • long getMemoryLimit() - memory limit in bytes, Long.MAX_VALUE if unlimited
      • long getMemoryUsage() - current memory usage in bytes
      • long getPidLimit() - max PIDs allowed, -1 if unlimited
      • long getPidCurrent() - current PID count
    • Document return values for unlimited/unavailable states in Javadoc
    Task 2: Create NoOpCgroupInfo Implementation

    Provide the default implementation for platforms that don't support cgroups, following the NoOpGpuStats pattern — a friendly familiar pattern that's easy to follow, even for first-time contributors!

    • Create NoOpCgroupInfo.java in oshi-common/src/main/java/oshi/software/common/
    • Implement CgroupInfo interface with all sentinel values:
      • isContainerized() returns false
      • getVersion() returns 0
      • getCpuQuota() returns -1L (unlimited)
      • getCpuPeriod() returns 100000L (standard default)
      • getCpuUsage() returns 0L
      • getEffectiveCpus() returns -1.0d (unlimited, as a double)
      • getMemoryLimit() returns Long.MAX_VALUE (unlimited)
      • getMemoryUsage() returns 0L
      • getPidLimit() returns -1L (unlimited)
      • getPidCurrent() returns 0L
    • Make class public final with package-private constructor (instantiated only by the interface default method)
    Task 3: Add getCgroupInfo() to OperatingSystem Interface

    Extend the OperatingSystem interface with the new accessor method, defaulting to the no-op implementation.

    • Add default CgroupInfo getCgroupInfo() method to oshi-common/src/main/java/oshi/software/os/OperatingSystem.java
    • Default implementation returns new NoOpCgroupInfo() — this covers Windows, macOS, FreeBSD, and all non-Linux platforms automatically, no extra work needed!
    • Add Javadoc explaining that non-Linux platforms return a no-op instance with isContainerized() == false
    🤖 Prompt for AI agents
    This phase establishes the public-facing `CgroupInfo` API and its no-op
    fallback, forming the foundation all platform implementations will build upon.
    
    **1. Create `CgroupInfo.java`** in
    `oshi-common/src/main/java/oshi/software/os/`:
    - Annotate the interface with `@PublicApi` and `@ThreadSafe` (both at the type
    level, retention RUNTIME)
    - Declare the following methods with their exact return types:
      - `boolean isContainerized()`
      - `int getVersion()`
      - `long getCpuQuota()`
      - `long getCpuPeriod()`
      - `long getCpuUsage()`
      - `double getEffectiveCpus()` (returns a `double`, not `int`)
      - `long getMemoryLimit()`
      - `long getMemoryUsage()`
      - `long getPidLimit()`
      - `long getPidCurrent()`
    - Document sentinel/return values in Javadoc: `-1` for unlimited
    quota/period/PIDs, `Long.MAX_VALUE` for unlimited memory, `0` for version when
    not in a cgroup, `-1.0d` for unlimited effective CPUs
    
    **2. Create `NoOpCgroupInfo.java`** in
    `oshi-common/src/main/java/oshi/software/common/`:
    - Make the class `public final` with a package-private constructor
    - Implement the `CgroupInfo` interface with all sentinel values:
      - `isContainerized()` → `false`
      - `getVersion()` → `0`
      - `getCpuQuota()` → `-1L` (unlimited)
      - `getCpuPeriod()` → `100000L` (standard default)
      - `getCpuUsage()` → `0L`
      - `getEffectiveCpus()` → `-1.0d` (unlimited, as a double)
      - `getMemoryLimit()` → `Long.MAX_VALUE` (unlimited)
      - `getMemoryUsage()` → `0L`
      - `getPidLimit()` → `-1L` (unlimited)
      - `getPidCurrent()` → `0L`
    - Follows the same pattern as `NoOpGpuStats`
    
    **3. Update `OperatingSystem.java`** in
    `oshi-common/src/main/java/oshi/software/os/`:
    - Add a `default CgroupInfo getCgroupInfo()` method that returns `new
    NoOpCgroupInfo()`
    - Add Javadoc noting that non-Linux platforms return a no-op instance where
    `isContainerized() == false`
    

    Phase 2: Linux Implementation

    Implement the Linux-specific cgroup reading logic, supporting both cgroup v2 (unified hierarchy) as the primary path and v1 (legacy) for compatibility with older systems.

    Task 1: Add Cgroup Path Constants

    A small but important task — defining path constants for cgroup filesystem access following existing ProcPath/SysPath patterns.

    • Add to ProcPath.java: SELF_CGROUP (PROC + "/self/cgroup"), FILESYSTEMS (PROC + "/filesystems")
    • Add to SysPath.java: CGROUP (SYS + "fs/cgroup/") as the base mount point for cgroup v2 unified hierarchy
    • Follow existing trailing slash conventions: SysPath constants include trailing slashes for directories
    Task 2: Create LinuxCgroupInfo with Version Detection and v2 Support

    Here's where the real magic happens! Implement the core Linux cgroup reader with version detection and cgroup v2 support as the primary path.

    • Create LinuxCgroupInfo.java in oshi-common/src/main/java/oshi/software/common/os/linux/
    • Implement version detection: check /proc/filesystems for cgroup2 entry to determine v2 availability
    • Parse /proc/self/cgroup to extract the cgroup path (format: hierarchy-id:controllers:path, for v2 the entry is 0::/{path})
    • Implement v2 file reading:
      • cpu.max: parse "quota period" format, handle "max" string as unlimited (-1)
      • cpu.stat: parse usage_usec line, convert microseconds to nanoseconds
      • memory.max / memory.current: read as long, handle "max" as Long.MAX_VALUE
      • pids.max / pids.current: read as long, handle "max" as -1
    • Implement getEffectiveCpus() to return (double) quota / period when quota is set, or -1.0d when unlimited
    • Use FileUtil.readFile() and FileUtil.getStringFromFile() for file reads (graceful empty returns on missing files)
    • Use ParseUtil.parseLongOrDefault() for numeric parsing with appropriate defaults
    • Use Memoizer.memoize() for version, cgroup path, and limit values (set once at container creation)
    Task 3: Add cgroup v1 Fallback Support

    Time to handle the legacy case! Extend LinuxCgroupInfo to support the legacy cgroup v1 hierarchy for older distributions and container runtimes.

    • Add v1 detection: if v2 not available or /proc/self/cgroup has multiple hierarchy entries (format: hierarchy-id:controller:path)
    • Parse v1 cgroup paths from /proc/self/cgroup for each controller (cpu, memory, pids may have different paths)
    • Implement v1 file reading at controller-specific mount points (/sys/fs/cgroup/{controller}/{path}/):
      • CPU: cpu.cfs_quota_us, cpu.cfs_period_us (separate files, -1 in quota means unlimited)
      • CPU usage: cpuacct.usage (already in nanoseconds)
      • Memory: memory.limit_in_bytes, memory.usage_in_bytes
      • PIDs: pids.max, pids.current
    • Handle hybrid mode gracefully: if some controllers use v2 and others v1, prefer v2 where available
    Task 4: Integrate LinuxCgroupInfo with LinuxOperatingSystem

    The final wiring step — connecting the new Linux implementation into the operating system class hierarchy!

    • Override getCgroupInfo() in LinuxOperatingSystem.java (oshi-common/src/main/java/oshi/software/common/os/linux/)
    • Use Memoizer.memoize() to lazily create and cache the LinuxCgroupInfo instance (consistent with how getInstalledApplications() uses LinuxInstalledApps)
    • Return the memoized LinuxCgroupInfo instance — since it caches limits internally, a single instance per OS is appropriate
    🤖 Prompt for AI agents
    This phase implements the Linux-specific cgroup reading logic in `oshi-common`,
    supporting cgroup v2 as the primary path with a v1 legacy fallback.
    
    **1. Add path constants:**
    - In `ProcPath.java`: add `SELF_CGROUP = PROC + "/self/cgroup"` and `FILESYSTEMS
    = PROC + "/filesystems"`
    - In `SysPath.java`: add `CGROUP = SYS + "fs/cgroup/"` (note trailing slash,
    following existing conventions)
    
    **2. Create `LinuxCgroupInfo.java`** in
    `oshi-common/src/main/java/oshi/software/common/os/linux/`:
    - Implement the `CgroupInfo` interface
    - **Version detection:** Read `/proc/filesystems` (via `ProcPath.FILESYSTEMS`)
    and check for a `cgroup2` entry
    - **Cgroup path parsing:** Parse `/proc/self/cgroup` (`ProcPath.SELF_CGROUP`);
    format is `hierarchy-id:controllers:path`; for v2, look for the `0::/{path}`
    entry
    - **v2 file reading** (using `SysPath.CGROUP` as base):
    - `cpu.max`: parse `"quota period"` space-separated format; treat `"max"` as
    `-1`
      - `cpu.stat`: find `usage_usec` line, convert microseconds → nanoseconds
    - `memory.max` / `memory.current`: parse as long; treat `"max"` as
    `Long.MAX_VALUE`
      - `pids.max` / `pids.current`: parse as long; treat `"max"` as `-1`
    - **`getEffectiveCpus()`:** return `(double) quota / period` when quota is set;
    return `-1.0d` when unlimited
    - **v1 detection:** If v2 is not available or `/proc/self/cgroup` has multiple
    hierarchy entries, fall back to v1
    - **v1 file reading** at `/sys/fs/cgroup/{controller}/{path}/`:
    - CPU: `cpu.cfs_quota_us`, `cpu.cfs_period_us` (separate files; `-1` quota =
    unlimited)
      - CPU usage: `cpuacct.usage` (already in nanoseconds)
      - Memory: `memory.limit_in_bytes`, `memory.usage_in_bytes`
      - PIDs: `pids.max`, `pids.current`
    - **Hybrid mode:** prefer v2 per controller where available
    - Use `FileUtil.readFile()` and `FileUtil.getStringFromFile()` for all file
    reads
    - Use `ParseUtil.parseLongOrDefault()` for numeric parsing with appropriate
    defaults
    - Use `Memoizer.memoize()` for version, cgroup path, and all limit values; read
    usage values fresh on each call
    
    **3. Update `LinuxOperatingSystem.java`** in
    `oshi-common/src/main/java/oshi/software/common/os/linux/`:
    - Override `getCgroupInfo()` to return a memoized `LinuxCgroupInfo` instance
    (use `Memoizer.memoize()`, consistent with the `getInstalledApplications()` /
    `LinuxInstalledApps` pattern)
    - A single cached instance per OS object is appropriate since `LinuxCgroupInfo`
    already handles internal caching of limit values
    
    Research

    OSHI uses a layered architecture across two modules: oshi-common defines public interfaces in oshi.software.os, abstract base classes in oshi.software.common, and platform-specific implementations in oshi.software.common.os.<platform>. oshi-core provides JNA-backed concrete classes only when native calls are required. Since cgroups are read via plain file I/O (/sys/fs/cgroup/, /proc/self/cgroup), this feature can live entirely in oshi-common with no JNA dependency. The project follows established patterns: no-op implementations for unsupported platforms (like NoOpGpuStats), path constants in ProcPath/SysPath, file reading via FileUtil/ParseUtil, and default interface methods that platform classes override.


    🚀 Next Steps

    🤖 All AI agent prompts combined
    Task: 1
    
    This phase establishes the public-facing `CgroupInfo` API and its no-op
    fallback, forming the foundation all platform implementations will build upon.
    
    **1. Create `CgroupInfo.java`** in
    `oshi-common/src/main/java/oshi/software/os/`:
    - Annotate the interface with `@PublicApi` and `@ThreadSafe` (both at the type
    level, retention RUNTIME)
    - Declare the following methods with their exact return types:
      - `boolean isContainerized()`
      - `int getVersion()`
      - `long getCpuQuota()`
      - `long getCpuPeriod()`
      - `long getCpuUsage()`
      - `double getEffectiveCpus()` (returns a `double`, not `int`)
      - `long getMemoryLimit()`
      - `long getMemoryUsage()`
      - `long getPidLimit()`
      - `long getPidCurrent()`
    - Document sentinel/return values in Javadoc: `-1` for unlimited
    quota/period/PIDs, `Long.MAX_VALUE` for unlimited memory, `0` for version when
    not in a cgroup, `-1.0d` for unlimited effective CPUs
    
    **2. Create `NoOpCgroupInfo.java`** in
    `oshi-common/src/main/java/oshi/software/common/`:
    - Make the class `public final` with a package-private constructor
    - Implement the `CgroupInfo` interface with all sentinel values:
      - `isContainerized()` → `false`
      - `getVersion()` → `0`
      - `getCpuQuota()` → `-1L` (unlimited)
      - `getCpuPeriod()` → `100000L` (standard default)
      - `getCpuUsage()` → `0L`
      - `getEffectiveCpus()` → `-1.0d` (unlimited, as a double)
      - `getMemoryLimit()` → `Long.MAX_VALUE` (unlimited)
      - `getMemoryUsage()` → `0L`
      - `getPidLimit()` → `-1L` (unlimited)
      - `getPidCurrent()` → `0L`
    - Follows the same pattern as `NoOpGpuStats`
    
    **3. Update `OperatingSystem.java`** in
    `oshi-common/src/main/java/oshi/software/os/`:
    - Add a `default CgroupInfo getCgroupInfo()` method that returns `new
    NoOpCgroupInfo()`
    - Add Javadoc noting that non-Linux platforms return a no-op instance where
    `isContainerized() == false`
    ===============================================================================
    
    Task: 2
    
    This phase implements the Linux-specific cgroup reading logic in `oshi-common`,
    supporting cgroup v2 as the primary path with a v1 legacy fallback.
    
    **1. Add path constants:**
    - In `ProcPath.java`: add `SELF_CGROUP = PROC + "/self/cgroup"` and `FILESYSTEMS
    = PROC + "/filesystems"`
    - In `SysPath.java`: add `CGROUP = SYS + "fs/cgroup/"` (note trailing slash,
    following existing conventions)
    
    **2. Create `LinuxCgroupInfo.java`** in
    `oshi-common/src/main/java/oshi/software/common/os/linux/`:
    - Implement the `CgroupInfo` interface
    - **Version detection:** Read `/proc/filesystems` (via `ProcPath.FILESYSTEMS`)
    and check for a `cgroup2` entry
    - **Cgroup path parsing:** Parse `/proc/self/cgroup` (`ProcPath.SELF_CGROUP`);
    format is `hierarchy-id:controllers:path`; for v2, look for the `0::/{path}`
    entry
    - **v2 file reading** (using `SysPath.CGROUP` as base):
    - `cpu.max`: parse `"quota period"` space-separated format; treat `"max"` as
    `-1`
      - `cpu.stat`: find `usage_usec` line, convert microseconds → nanoseconds
    - `memory.max` / `memory.current`: parse as long; treat `"max"` as
    `Long.MAX_VALUE`
      - `pids.max` / `pids.current`: parse as long; treat `"max"` as `-1`
    - **`getEffectiveCpus()`:** return `(double) quota / period` when quota is set;
    return `-1.0d` when unlimited
    - **v1 detection:** If v2 is not available or `/proc/self/cgroup` has multiple
    hierarchy entries, fall back to v1
    - **v1 file reading** at `/sys/fs/cgroup/{controller}/{path}/`:
    - CPU: `cpu.cfs_quota_us`, `cpu.cfs_period_us` (separate files; `-1` quota =
    unlimited)
      - CPU usage: `cpuacct.usage` (already in nanoseconds)
      - Memory: `memory.limit_in_bytes`, `memory.usage_in_bytes`
      - PIDs: `pids.max`, `pids.current`
    - **Hybrid mode:** prefer v2 per controller where available
    - Use `FileUtil.readFile()` and `FileUtil.getStringFromFile()` for all file
    reads
    - Use `ParseUtil.parseLongOrDefault()` for numeric parsing with appropriate
    defaults
    - Use `Memoizer.memoize()` for version, cgroup path, and all limit values; read
    usage values fresh on each call
    
    **3. Update `LinuxOperatingSystem.java`** in
    `oshi-common/src/main/java/oshi/software/common/os/linux/`:
    - Override `getCgroupInfo()` to return a memoized `LinuxCgroupInfo` instance
    (use `Memoizer.memoize()`, consistent with the `getInstalledApplications()` /
    `LinuxInstalledApps` pattern)
    - A single cached instance per OS object is appropriate since `LinuxCgroupInfo`
    already handles internal caching of limit values
    
    💡 Iterate on the plan with: @coderabbitai <feedback>
    Example Feedback
    - @coderabbitai You can skip phase 3. Add a simple unit test case for phase 2.
    - @coderabbitai For design choice 1 go ahead with option 3 and replan.
    

    💬 Have feedback or questions? Drop into our discord!

  3. coderabbitai commented on May 3, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #3104 - Migrate remaining mac OperatingSystem JNA to FFM [merged]
    #3126 - FFM migration of WindowsOSProcess [merged]
    #3136 - Push USER_HZ and PAGE_SIZE down into JNA/FFM OS subclasses [merged]
    #3184 - Add JMH benchmarks for CPU ticks, memory, file stores, and network interfaces [merged]
    #3197 - Add FAQ entries for container usage and CPU usage polling [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  4. dbwiddis commented on May 3, 2026

    @dbwiddis
    MemberAuthor

    @coderabbitai Minor fix: getEffectiveCpus() should return double, not int. A container can have 1.5 effective CPUs (quota 150000, period 100000). The issue spec had this correct. Please update the interface definition and the AI agent prompts accordingly. Everything else looks good.

  5. coderabbitai commented on May 3, 2026

    @coderabbitai
    Contributor

    I've updated the plan above based on your feedback. Ready to proceed when you are!

  6. added
    up for grabs
    on May 3, 2026
  7. pinned this issue on May 3, 2026
  8. self-assigned this
    on May 3, 2026
  9. removed
    up for grabs
    design discussion
    on May 4, 2026
  10. dbwiddis commented on May 6, 2026

    @dbwiddis
    MemberAuthor

    Completed in #3225

  11. unpinned this issue on May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

new feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions