Skip to content

v0.2.0 — Resource Stats & Weight Classes

Latest

Choose a tag to compare

@jack-work jack-work released this 28 Feb 01:09
· 2 commits to master since this release

What's New

Resource Stats (-s / --stats)

New opt-in flag that adds memory usage, CPU time, and weight class grading to process listings.

merc -l -s
merc -json -s
merc -s       # interactive mode with ANSI colors

Weight Classes

Each process is graded into a weight class based on composite percentile rank (60% memory + 40% CPU time):

Class Score Color
feather < 25th pct dim gray
mid 25th–75th pct white
heavy 75th–95th pct yellow
wew lad > 95th pct red

JSON Output

When using -json -s, each process includes memoryBytes (uint64), cpuTime (nanoseconds), and weightClass fields.

Library API Changes

  • ListProcesses now accepts a second collectStats bool parameter
  • New GradeProcesses([]ProcessInfo) function
  • New WeightClass type with constants
  • New formatting functions: FormatBytes, FormatCPUTime, FormatWeightClass

Wiki

Added a Plugin Integration Guide with Lua/Neovim, Python, PowerShell, and Node.js examples.

Full Changelog: v0.1.0...v0.2.0