-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Inconsistency of representation diskio from windows and linux #3798
Comments
Pinging @andrewkroh. |
Yeah, it does look inconsistent. On Windows the third party lib is using this WMI query to get the data: Then is just writes the averaged values into the fields that are supposed to be counters. https://github.com/shirou/gopsutil/blob/v2.0.0/disk/disk_windows.go#L144-L152 From Windows docs:
Maybe we can find a table that has raw values. Anyone want to research this? |
I also think these fields do not work right. I did small experiment, copied files to windows machine and this action was not reflected in elastic index. |
The averaging from Windows is basically acting as a low-pass filter so those values are not very useful because you won't be able to observe high frequency signals in the data. Getting at the raw data (with relatively high sampling period) would solve this. |
Can I hope to see fix of this? We have mixed infrastructure (linux + windows) and this bug preventing us from bits adoption. |
Hi @andrewkroh. Now our perfmon metricset is merged what do you think of to use this as an internal API to collect these data. The next feature I would add to metricset is to get raw data values. |
@maddin2016 If it's possible to retrieve the raw values through perfmon then I think that would be a great solution to this issue. |
@andrewkroh, can you please add this to #3828 so we don't miss this? |
I would not add it into #3828 as it is not really a cleanup to perfmon metricset but enhancing a feature of an other metricset. I think it is perfectly tracked here as this is the issue that will be closed, in case there will be a PR for it. |
FYI: Another report for diskio problems on Windows due to the usage of WMI. https://discuss.elastic.co/t/system-diskio-io-time-0-on-windows/85508 |
What do you think of adding a helper which collect these counters through the perfmon api? Or is it possible to add a |
It should be possible to have a separate implementation for windows by using build tags (i.e. |
Is this bug was fixed in 6.0? |
@andrewkroh, i'm currenty implement a solution to retrieve the raw values with perfmon. Are there a any example how the linux and windows outputs differ? |
There is a sample document in the diskio docs: https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-metricset-system-diskio.html#_fields_57 I don't have a sample from Windows, but the main difference that the values coming from WMI are averages rather than cumulative. On *nix we get an ever increasing counter (until rollover) that contains the total number for all time. So the differences is basically that on *nix we have counters and on Windows we have gauges (counter vs gauges). |
@andrewkroh, i have started to implement |
Good find. It does sounds like the DISK_PERFORMANCE data would be good for this. |
Two questions.
|
Why would you remove it? Isn't it used by the perfmon metricset?
Reuse what's already provided if possible. So only add a way to use |
|
Any news on this issue? |
It would be cool to investigate if other metrics like bellow have equivalent on windows. |
(SELECT * FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk) with DeviceIOControl Win32 API method using IOCTL_DISK_PERFORMANCE control code. Fixes: elastic#3798 and elastic#2842
* Replace using WMI query to get the system/diskio metrics for Windows (SELECT * FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk) with DeviceIOControl Win32 API method using IOCTL_DISK_PERFORMANCE control code. Fixes: #3798 and #2842 * Fixed cross platform build, added tests and include_devices filter Added: - include_devices filter to the IOCounters - test file to assert get stats on C: returns data - addressed houndci-bot style violations * Fix goimports style * Fix goimports styling * Fix goimports and houndci-bot requests * Fix support for osx * Re-run build, address houndci-bot messages * Update changelog file * Addressed PR comments * Addressing review notes * Enrich test and implement separate function to enable the performance counters * Add disable performance counters functionality for testing * Log meesage when the EnableCounterForIoctl is added/updated in the registry * Check for registry key value before updating it * Address new code reviews * small refactoring of deviceiocontrol functions
For confirmed bugs, please report:
There is inconsistency between diskio Fields from linux and from windows machines. From linux hosts we get cumulative value, however from windows hosts we get "normal" value. It applies to
The text was updated successfully, but these errors were encountered: