fix(go.d/apcupsd): fix ups_load value divided by 100 (#18780)
Ilya Mashchenko committed
Oct 14, 2024 at 20:23 UTC
4b670a9da13a8e923eb8ee6261f53eb60213a838
2 files changed
+2
-2
src/go/plugin/go.d/modules/apcupsd/apcupsd_test.go
+1
-1
@@ -144,7 +144,7 @@ func TestApcupsd_Collect(t *testing.T) {
144
"input_voltage_max": 23920,
145
"input_voltage_min": 23400,
146
"itemp": 3279,
147
- "load": 55,
147
+ "load": 5580,
148
"load_percent": 930,
149
"output_voltage": 23660,
150
"output_voltage_nominal": 23000,
src/go/plugin/go.d/modules/apcupsd/collect.go
+1
-1
@@ -101,7 +101,7 @@ func (a *Apcupsd) collectStatus(mx map[string]int64, resp []byte) error {
101
mx["timeleft"] = int64(*st.timeleft * 60 * precision) // to seconds
102
}
103
if st.nompower != nil && st.loadpct != nil {
104
- mx["load"] = int64(*st.nompower * *st.loadpct / 100)
104
+ mx["load"] = int64(*st.nompower * *st.loadpct)
105
}
106
if st.battdate != "" {
107
if v, err := battdateSecondsAgo(st.battdate); err != nil {