Commit 907bf2f
committed
fix(collector): report each thermal sensor once and update e2e fixture
Collecting temperatures on Apple Silicon surfaced a second problem that
was previously unreachable, because Update returned before
updateTemperatures ever ran.
A sensor is identified only by its IOHID "Product" name, and several
services report the same name. On an M5 Pro, 76 temperature-capable
services carry only 25 distinct names, and the services expose nothing
that tells them apart: RegistryID, UniqueID and SerialNumber are all
unset, and two services can share both Product and LocationID. Emitting
the same label set twice makes the registry reject those samples and log
an error on every scrape, so only the first reading for a name is
reported now and the rest are counted in a debug message.
Also update collector/fixtures/e2e-output-darwin.txt for
node_scrape_collector_success{collector="thermal"}, which is now 1
because the collector no longer fails.
Two fixes to end-to-end-test.sh so that regenerating that fixture on a
Darwin host does the right thing:
- The Darwin fixture path was built with "${fixture_metrics::-4}". A
negative substring length needs bash 4.2 and macOS still ships bash
3.2, where the expansion fails and fixture_metrics keeps pointing at
the Linux file. Running ./end-to-end-test.sh -u on macOS therefore
overwrote collector/fixtures/e2e-output.txt with Darwin output.
"${fixture_metrics%.txt}" is equivalent and portable.
- node_thermal_temperature_celsius is per-machine, both in its sensor
names and its values, so it is stripped along with the other
non-deterministic metrics. The CI runner reports no sensors at all,
but a developer running the suite on real hardware would otherwise
see the whole sensor list as a diff.
Signed-off-by: SaiPisey2 <piseysai0202@gmail.com>1 parent 3279e73 commit 907bf2f
4 files changed
Lines changed: 64 additions & 2 deletions
File tree
- collector
- fixtures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
104 | 114 | | |
105 | 115 | | |
106 | 116 | | |
| |||
125 | 135 | | |
126 | 136 | | |
127 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
128 | 144 | | |
129 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
130 | 151 | | |
131 | 152 | | |
132 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
283 | 286 | | |
284 | 287 | | |
285 | 288 | | |
| |||
390 | 393 | | |
391 | 394 | | |
392 | 395 | | |
| 396 | + | |
393 | 397 | | |
394 | 398 | | |
395 | 399 | | |
| |||
0 commit comments