Skip to content

D4: Top processes by CPU / memory #16

Description

@LarsLaskowski

Epic: More Metrics

Why

When CPU or RAM spikes, users want to know what is responsible.

Scope

Walk /proc/[pid]/stat and /proc/[pid]/status (or comm), compute per-process CPU% via deltas, and return the top-N by CPU and by RSS. Bound N and compute on the slow tick to limit cost.

Reuse & touch points

  • New internal/collector/process.go + fixtures (feed synthetic /proc/<pid> directories via testhelpers_test.go).

API & config impact

  • New GET /api/v1/processes (kept off the main snapshot to bound payload size).
  • Config processes_enabled, processes_top_n.

Acceptance criteria

  • A fixture pid set produces the correct top-N ordering by CPU and by memory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions