Files
moby/integration-cli
Dawei Wei deef0ea2d7 daemon: fix empty docker stats for Windows containerd runtime
When the daemon uses the containerd runtime (io.containerd.runhcs.v1),
the runhcs shim emits container metrics as the typeurl
`containerd.runhcs.stats.v1.Statistics`. moby never imported the package
that registers this type, so `typeurl.UnmarshalAny` failed with "type not
found" and `docker stats` reported all zeros for running Windows
containers.

Import the hcsshim runhcs stats package so its proto init registers the
typeurl, and handle `*wstats.Statistics` in `InterfaceToStats`, converting
the Windows container statistics (processor time is reported in
nanoseconds and converted to the 100ns units used by hcsshim.Statistics)
into the shape consumed by stats_windows.go. Also replace the bare type
assertion with a type switch so unexpected payloads no longer panic.

Un-skip TestStatsAllNoStream and TestStatsAllRunningNoStream, and add a
unit test for the conversion.

Signed-off-by: Dawei Wei <wei.dawei.cn@gmail.com>
2026-07-20 11:47:18 -07:00
..
2025-09-08 10:08:30 +02:00
2025-12-15 18:56:34 +01:00
2026-02-13 18:49:51 +01:00
2025-06-05 21:42:05 +00:00
2025-06-05 21:42:05 +00:00