Skip to content

Commit

Permalink
Cherry-pick elastic#22237 to 7.x: [Metricbeat] Remove io.time from wi…
Browse files Browse the repository at this point in the history
…ndows (elastic#22313)

* [Metricbeat] Remove io.time from windows (elastic#22237)

* remove io.time from windows

* fix tests

* add changelog entry

(cherry picked from commit 77882fc)

* fix changelog
  • Loading branch information
fearful-symmetry authored Oct 30, 2020
1 parent 2b8e230 commit 8bd10a3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ field. You can revert this change by configuring tags for the module and omittin
- Fix panic in kubernetes autodiscover related to keystores {issue}21843[21843] {pull}21880[21880]
- [Kubernetes] Remove redundant dockersock volume mount {pull}22009[22009]
- Revert change to report `process.memory.rss` as `process.memory.wss` on Windows. {pull}22055[22055]
- Remove io.time from windows {pull}22237[22237]

*Packetbeat*

Expand Down
16 changes: 8 additions & 8 deletions metricbeat/module/system/diskio/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"system": {
"diskio": {
"io": {
"time": 601740
"time": 1296
},
"iostat": {
"await": 0,
Expand Down Expand Up @@ -48,16 +48,16 @@
}
}
},
"name": "sdb1",
"name": "sda6",
"read": {
"bytes": 25128030208,
"count": 3146154,
"time": 833872
"bytes": 335872,
"count": 82,
"time": 1296
},
"write": {
"bytes": 34401640448,
"count": 861040,
"time": 11224168
"bytes": 0,
"count": 0,
"time": 0
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/system/diskio/diskio.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error {
"time": counters.WriteTime,
"bytes": counters.WriteBytes,
},
"io": common.MapStr{
"time": counters.IoTime,
},
}

// accumulate values from all interfaces
Expand All @@ -123,6 +120,10 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error {
event["iostat"] = iostat.AddLinuxIOStat(result)
}

if runtime.GOOS != "windows" {
event.Put("io.time", counters.IoTime)
}

if counters.SerialNumber != "" {
event["serial_number"] = counters.SerialNumber
}
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/system/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"softirq.norm.pct", "steal.norm.pct", "system.norm.pct", "user.norm.pct"]

SYSTEM_DISKIO_FIELDS = ["name", "read.count", "write.count", "read.bytes",
"write.bytes", "read.time", "write.time", "io.time"]
"write.bytes", "read.time", "write.time"]

SYSTEM_DISKIO_FIELDS_LINUX = ["name", "read.count", "write.count", "read.bytes",
"write.bytes", "read.time", "write.time", "io.time",
Expand Down

0 comments on commit 8bd10a3

Please sign in to comment.