KEMBAR78
Adjust Disk Size (Windows.plugin) by thiagoftsm · Pull Request #21081 · netdata/netdata · GitHub
Skip to content

Conversation

@thiagoftsm
Copy link
Contributor

Summary

This PR is a simplified version of #21059 addressing only disk sizes.

There are other issues which will be address in original PR.

Master Branch:
master

This PR:
pr

Test Plan
  1. Compile master branch, generate installer and install it. Check disk.usage
  2. Compile this branch, generate installer and install it. Check disk.usage
Additional Information
For users: How does this change affect me?

@github-actions github-actions bot added area/collectors Everything related to data collection collectors/windows labels Oct 1, 2025
@thiagoftsm thiagoftsm requested a review from stelfrag October 1, 2025 01:40
@thiagoftsm thiagoftsm requested a review from ilyam8 October 1, 2025 11:26
// https://devblogs.microsoft.com/oldnewthing/20071101-00/?p=24613
// We are using the variable that should not be affected by qyota ()
if ((GetDriveTypeA(path) != DRIVE_FIXED) || !GetDiskFreeSpaceExA(path,
if ((GetDriveTypeA(path) == DRIVE_UNKNOWN) || !GetDiskFreeSpaceExA(path,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you briefly explain this change? Why? Doesn't look like a problem to me, but I'd like to hear "why".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. If the driver cannot be identified, it indicates that the next function could fail.

If the driver can be identified, I try to get the data directly from GetDiskFreeSpaceExA. If that fails, I use Perflib.

The idea is to use Perflib only if there is no way to get the data from the Windows API.

@thiagoftsm thiagoftsm enabled auto-merge (squash) October 1, 2025 12:05
@thiagoftsm thiagoftsm merged commit f16d13c into netdata:master Oct 1, 2025
106 of 108 checks passed
@thiagoftsm thiagoftsm deleted the quick_fix branch October 1, 2025 13:19
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Oct 3, 2025
@stelfrag stelfrag mentioned this pull request Oct 3, 2025
Ferroin pushed a commit that referenced this pull request Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/collectors Everything related to data collection collectors/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants