Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #14271 to 7.x: Convert ticks to milliseconds for diskio metricset #16797

Merged
merged 3 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Change sqs metricset to use average as statistic method. {pull}16438[16438]
- Revert changes in `docker` module: add size flag to docker.container. {pull}16600[16600]
- Add dashboard for `redisenterprise` module. {pull}16752[16752]
- Convert increments of 100 nanoseconds/ticks to milliseconds for WriteTime and ReadTime in diskio metricset (Windows) for consistency. {issue}14233[14233]

*Packetbeat*

Expand Down
16 changes: 10 additions & 6 deletions metricbeat/module/system/diskio/diskstat_windows_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@ type logicalDrive struct {
}

type diskPerformance struct {
BytesRead int64
BytesWritten int64
ReadTime int64
WriteTime int64
BytesRead int64
BytesWritten int64
// Contains a cumulative time, expressed in increments of 100 nanoseconds (or ticks).
ReadTime int64
// Contains a cumulative time, expressed in increments of 100 nanoseconds (or ticks).
WriteTime int64
//Contains a cumulative time, expressed in increments of 100 nanoseconds (or ticks).
IdleTime int64
ReadCount uint32
WriteCount uint32
Expand Down Expand Up @@ -95,8 +98,9 @@ func ioCounters(names ...string) (map[string]disk.IOCountersStat, error) {
WriteCount: uint64(counter.WriteCount),
ReadBytes: uint64(counter.BytesRead),
WriteBytes: uint64(counter.BytesWritten),
ReadTime: uint64(counter.ReadTime),
WriteTime: uint64(counter.WriteTime),
// Ticks (which is equal to 100 nanoseconds) will be converted to milliseconds for consistency reasons for both ReadTime and WriteTime (https://docs.microsoft.com/en-us/dotnet/api/system.timespan.ticks?redirectedfrom=MSDN&view=netframework-4.8#remarks)
ReadTime: uint64(counter.ReadTime / 10000),
WriteTime: uint64(counter.WriteTime / 10000),
}
}
return ret, nil
Expand Down