Skip to content

Add DiskInfo to HeartBeat#536

Merged
jeschu1 merged 1 commit into
microsoft:masterfrom
jeschu1:enlistmentinfo
Nov 29, 2018
Merged

Add DiskInfo to HeartBeat#536
jeschu1 merged 1 commit into
microsoft:masterfrom
jeschu1:enlistmentinfo

Conversation

@jeschu1
Copy link
Copy Markdown
Member

@jeschu1 jeschu1 commented Nov 20, 2018

This logs disk info on heat beat:

"PhysicalDiskInfo":{"DriveLetter":"C","VolumeDriveType":"Fixed","VolumeFileSystem":"NTFS","VolumeFileSystemLabel":"OSDisk","VolumeSize":"510928089088","VolumeSizeRemaining":"103830548480","DiskNumber":"0","DiskModel":"MTFDDAK512MBF1A","DiskIsSystem":"True","DiskIsBoot":"True","DiskSerialNumber":"XXXXXX","PhysicalMediaType":"SSD","PhysicalBusType":"SATA","PhysicalSpindleSpeed":"0"}
This should come in very handy when investigating why users run out of disk space.

@sanoursa I'm using the existing GetPhysicalDiskInfo method, which brings back more info that we need. Let me know if you think it's worth seperating queryVolumeString into it's own method and just calling that here. I'll update the failing unit test once we make a decision there.

@jeschu1 jeschu1 requested a review from sanoursa November 20, 2018 17:44
@sanoursa
Copy link
Copy Markdown
Contributor

Two questions:

  • Is there a perf hit from querying all the extra stats that we don't care about?
  • Are we bloating the logs / telemetry with redundant info, since most of those stats will be redundant on every heartbeat message?

Keep in mind that "queryVolumeString" is totally Windows-specific. What you might consider doing is add a flag to GetPhysicalDiskInfo so that you can ask it for all drive stats, or just size-related stats, and let each platform make its own decision about what that means.

@jeschu1
Copy link
Copy Markdown
Member Author

jeschu1 commented Nov 20, 2018

@sanoursa that makes sense

To answer both questions.
Yes there is a perf hitting in getting all the disk info (an extra query). Yes it also bloats the logs.

I'll update GetPhysicalDiskInfo to have a sizeStatsOnly flag. That should solve both problems nicely. Thanks!

@jeschu1
Copy link
Copy Markdown
Member Author

jeschu1 commented Nov 28, 2018

@sanoursa any chance you may be able to give this a final review. If your too busy let me know and I'll ask someone else. Thank You!

Copy link
Copy Markdown
Contributor

@sanoursa sanoursa left a comment

Choose a reason for hiding this comment

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

Just a minor code cleanup comment, this looks good otherwise

result.Add("VolumeSizeRemaining", FetchValue(mbo, "SizeRemaining"));
}

if (sizeStatsOnly)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not all your doing, but this method is quite long, does two separate things, and now with an exit in the middle, can be pretty hard to follow. I would split it into two new methods, so that this top level method can call the first, then early exit if needed, and then call the second.

Comment thread GVFS/GVFS.UnitTests/Virtualization/FileSystemCallbacksTests.cs Outdated
Comment thread GVFS/GVFS.UnitTests/Virtualization/FileSystemCallbacksTests.cs Outdated
"PhysicalDiskInfo",
GVFSPlatform.Instance.GetPhysicalDiskInfo(
this.context.Enlistment.WorkingDirectoryRoot,
sizeStatsOnly: true));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This might be overkill for this PR, but should we set eventLevel to Informational if the free space is below some threshold (so that the heartbeat will be written to the logfile)?

If we can reliably find a user's telemetry data this would be less important.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(I don't think you need to block the PR on this, as the current changes are an improvement)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@wilbaker it gets a little tricky only because we're cross plat and there's no contract on whats coming back in the map exactly.

Definitely something good to think about for the future!

Copy link
Copy Markdown
Member

@wilbaker wilbaker left a comment

Choose a reason for hiding this comment

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

Approved with suggestions

@jeschu1 jeschu1 merged commit 78a6957 into microsoft:master Nov 29, 2018
@jrbriggs jrbriggs added this to the S147 milestone Feb 7, 2019
@jrbriggs jrbriggs added the affects: live-site Improving our ability to diagnose and fix the product label Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects: live-site Improving our ability to diagnose and fix the product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants