Commit 56c7cf8
committed
fix(plugins): state accumulation uses = instead of += (#1070)
Both wildfly-memory-usage and starface-java-memory-usage built up their
overall plugin state via `state += lib.base.get_worst(...)`. That adds
the state integers together: STATE_WARN + STATE_WARN = 2 which reads
as STATE_CRIT, STATE_WARN + STATE_CRIT = 3 which is outside the valid
STATE range entirely.
- wildfly-memory-usage: both the heap and non-heap branches combine
three states (overall, used, committed). With the new variadic
`lib.base.get_worst()` this is now a single clean call.
- starface-java-memory-usage: the heap and non-heap branches each
combine two states (accumulated, used). Standard
`state = lib.base.get_worst(state, used_state)` call.
Needs lib.base.get_worst variadic extension (shipped separately in lib).1 parent 4c38fd7 commit 56c7cf8
File tree
2 files changed
+6
-6
lines changed- check-plugins
- starface-java-memory-usage
- wildfly-memory-usage
2 files changed
+6
-6
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
0 commit comments