We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c45dc68 commit 2a70dc9Copy full SHA for 2a70dc9
plugins/outputs/heartbeat/statistics.go
@@ -83,7 +83,11 @@ func (s *statistics) snapshot() *statistics {
83
entry[k] = v
84
}
85
86
- entry["buffer_fullness"] = float64(entry["buffer_size"].(int64)) / float64(entry["buffer_limit"].(int64))
+ if limit := entry["buffer_limit"].(int64); limit != 0 {
87
+ entry["buffer_fullness"] = float64(entry["buffer_size"].(int64)) / float64(limit)
88
+ } else {
89
+ entry["buffer_fullness"] = float64(1.0) // output 100% if no limit
90
+ }
91
out.currentOutputs[name] = append(out.currentOutputs[name], entry)
92
case "agent":
93
out.currentAgent = m.Fields()
0 commit comments