Skip to content

Releases: GoodOlClint/swift-soc-metrics

v0.4.0 — rename to SoCMetrics

Choose a tag to compare

@GoodOlClint GoodOlClint released this 07 Jul 16:47
v0.4.0
e1a5fc4

Rename only — no new metrics. The package is now SoCMetrics (swift-soc-metrics); consumers change import AppleSiliconMetricsimport SoCMetrics.

Apple's marks now appear nowhere in the product name or in consumer code — only descriptively ("for Apple Silicon") in prose. "Metrics for Apple Silicon" is the referential form Apple's trademark guidelines permit, and this also steps clear of the apple/swift-metrics namespace.

Breaking: package/product/module renamed. Public types (SoCSampler, SoCSample) and the asmetrics CLI are unchanged. Earlier tags (v0.1–v0.3) keep the old AppleSiliconMetrics module name; the old repo URL redirects.

Install:

.package(url: "https://github.com/GoodOlClint/swift-soc-metrics.git", from: "0.4.0")

(v0.3.0's GPU/CPU die-temperature feature is unchanged — see the v0.3.0 release for that.)

v0.3.0 — GPU/CPU die temperature (SMC)

Choose a tag to compare

@GoodOlClint GoodOlClint released this 07 Jul 16:33
v0.3.0
a6e0eb7

Adds optional gpuTemperatureC / cpuTemperatureC (°C), read sudoless from the AppleSMC sensors.

  • IOReport turned out not to expose usable temperature (M5 has no GPU-temp channels; M4's read back 0 via the documented accessor), so temperature comes from SMC — matching the MIT mactop.
  • SMCReader enumerates flt-typed sensors once by prefix (Tg=GPU, Tp/Te=CPU) — pattern-match, no per-chip key table that rots — and averages each group per sample. No new SwiftPM target (Package.swift unchanged).
  • Validated idle → Metal burn: M5 Max 43.6 → 72 °C, M4 Max 35.1 → 53.8 °C, both tracking GPU load.
  • Rationale / deviation from the IOReport-first plan: ADR 0001.

Tested only on macOS 26 (M4 Max, M5 Max); degrades to nil elsewhere but other OS versions are unvalidated.

v0.2.0 — CPU cluster frequencies + ANE/package power

Choose a tag to compare

@GoodOlClint GoodOlClint released this 07 Jul 16:33
v0.2.0
142e048

Adds per-CPU-cluster frequencies and power, all sudoless via IOReport.

  • cpuClusterFrequenciesMHz — residency-weighted effective MHz per cluster (ECPU/PCPU on M4, MCPU0/MCPU1/PCPU on M5), DVFS tables read from IORegistry voltage-states*.
  • anePowerWatts + packagePowerWatts (CPU+GPU+ANE) from the "Energy Model" counters, matching powermetrics' Combined Power.
  • sample() serialized with a lock; ASMETRICS_DEBUG=1 dumps discovered channels + DVFS tables.
  • Validated on M4 Max Studio + M5 Max, macOS 26 (package power within ~1%).

v0.1.0 — sudoless GPU frequency + active residency

Choose a tag to compare

@GoodOlClint GoodOlClint released this 07 Jul 16:33
v0.1.0
74a6960

First release. Sudoless GPU effective frequency (MHz) and active-residency fraction via the private IOReport framework — no root, no subprocess.

  • SoCSampler.sample() returns residency-weighted gpuFrequencyMHz + gpuActiveResidency, tracking powermetrics' "GPU HW active frequency" (exact on M5 Max and M4 Max).
  • Graceful nil when IOReport is unavailable; sample() never throws/traps.
  • MIT-licensed; independent port of the IOReport call sequence (no GPL sources).