SystemMetricsCollectorTest
Tests
| Test |
Duration |
Result |
| CPU load is computed from /proc/stat deltas, so the first sample has no CPU metric yet |
0.112s |
passed |
| RAM comes from MemTotal and MemAvailable in GiB |
0.012s |
passed |
| a corrupt state file starts a fresh series instead of failing |
0.003s |
passed |
| a restart loads the persisted aggregation state and continues the series |
0.044s |
passed |
| disk and repository size are reported in GiB |
0.016s |
passed |
| min, max, and avg aggregate over all samples |
0.017s |
passed |
| the repository size probe is throttled to every 10th sample |
0.019s |
passed |
| the snapshot before the first sample is empty but well-formed |
0s |
passed |
| unreadable sources degrade to null metrics, never fail the sample |
0.058s |
passed |
Standard output
Creating nstance of class de.hoennig.werkator.metrics.SystemMetricsCollectorTest
2026-09-03T10:11:18.660Z WARN 144 --- [-1801625172#341] d.h.w.metrics.SystemMetricsCollector : ignoring unreadable metrics state file /tmp/werkator-metrics-test2782929494276125197/system-metrics-state.json; starting a fresh series: Unrecognized token 'not': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 1]
2026-09-03T10:11:18.684Z WARN 144 --- [-1801625172#342] d.h.w.metrics.SystemMetricsCollector : cannot read cpu metrics; showing n/a: java.nio.file.NoSuchFileException: /tmp/werkator-metrics-test9674564038274658842/stat
2026-09-03T10:11:18.684Z WARN 144 --- [-1801625172#342] d.h.w.metrics.SystemMetricsCollector : cannot read ram metrics; showing n/a: java.nio.file.NoSuchFileException: /tmp/werkator-metrics-test9674564038274658842/meminfo
2026-09-03T10:11:18.684Z WARN 144 --- [-1801625172#342] d.h.w.metrics.SystemMetricsCollector : cannot read disk metrics; showing n/a: java.lang.IllegalStateException: no file store
2026-09-03T10:11:18.684Z WARN 144 --- [-1801625172#342] d.h.w.metrics.SystemMetricsCollector : cannot read repo size metrics; showing n/a: java.lang.IllegalStateException: walk failed