Skip to content
Snippets Groups Projects
Unverified Commit b900967b authored by Daniel Nelson's avatar Daniel Nelson Committed by GitHub
Browse files

Add wired field to mem input (#3632)

parent 81f42e8b
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ For a more complete explanation of the difference between *used* and ...@@ -27,6 +27,7 @@ For a more complete explanation of the difference between *used* and
- used (int) - used (int)
- available_percent (float) - available_percent (float)
- used_percent (float) - used_percent (float)
- wired (int)
### Example Output: ### Example Output:
``` ```
......
...@@ -32,6 +32,7 @@ func (s *MemStats) Gather(acc telegraf.Accumulator) error { ...@@ -32,6 +32,7 @@ func (s *MemStats) Gather(acc telegraf.Accumulator) error {
"buffered": vm.Buffers, "buffered": vm.Buffers,
"active": vm.Active, "active": vm.Active,
"inactive": vm.Inactive, "inactive": vm.Inactive,
"wired": vm.Wired,
"slab": vm.Slab, "slab": vm.Slab,
"used_percent": 100 * float64(vm.Used) / float64(vm.Total), "used_percent": 100 * float64(vm.Used) / float64(vm.Total),
"available_percent": 100 * float64(vm.Available) / float64(vm.Total), "available_percent": 100 * float64(vm.Available) / float64(vm.Total),
......
...@@ -22,9 +22,9 @@ func TestMemStats(t *testing.T) { ...@@ -22,9 +22,9 @@ func TestMemStats(t *testing.T) {
Active: 8134, Active: 8134,
Inactive: 1124, Inactive: 1124,
Slab: 1234, Slab: 1234,
Wired: 134,
// Buffers: 771, // Buffers: 771,
// Cached: 4312, // Cached: 4312,
// Wired: 134,
// Shared: 2142, // Shared: 2142,
} }
...@@ -55,6 +55,7 @@ func TestMemStats(t *testing.T) { ...@@ -55,6 +55,7 @@ func TestMemStats(t *testing.T) {
"buffered": uint64(0), "buffered": uint64(0),
"active": uint64(8134), "active": uint64(8134),
"inactive": uint64(1124), "inactive": uint64(1124),
"wired": uint64(134),
"slab": uint64(1234), "slab": uint64(1234),
} }
acc.AssertContainsTaggedFields(t, "mem", memfields, make(map[string]string)) acc.AssertContainsTaggedFields(t, "mem", memfields, make(map[string]string))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment