-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Scrape system.disk.time on Windows #1408
Scrape system.disk.time on Windows #1408
Conversation
c341f2b
to
b8b6cbc
Compare
…rom delta(disk.time) / delta(disk.ops)
b8b6cbc
to
5a544e8
Compare
Codecov Report
@@ Coverage Diff @@
## master #1408 +/- ##
=======================================
Coverage 90.61% 90.62%
=======================================
Files 220 220
Lines 15679 15686 +7
=======================================
+ Hits 14208 14215 +7
Misses 1059 1059
Partials 412 412
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -121,6 +134,16 @@ func (s *scraper) Initialize(_ context.Context) error { | |||
return err | |||
} | |||
|
|||
s.avgDiskSecsPerReadCounter, err = pdh.NewPerfCounter(logicalAvgDiskSecsPerReadPath, true) | |||
if err != nil { | |||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do these errors need more context so we know which perf counter failed to be created or will the message returned from pdh.NewPerfCounter include the counter name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@james-bebbington please do this in a separate PR to keep the ball rolling :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right the errors can be generic such as "The specified counter could not be found". Will create a follow up PR to change this across the receiver.
@@ -121,6 +134,16 @@ func (s *scraper) Initialize(_ context.Context) error { | |||
return err | |||
} | |||
|
|||
s.avgDiskSecsPerReadCounter, err = pdh.NewPerfCounter(logicalAvgDiskSecsPerReadPath, true) | |||
if err != nil { | |||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@james-bebbington please do this in a separate PR to keep the ball rolling :)
* go mod tidy tests * make install-tools
Added "disk.time" cumulative metric for Windows. Since there is no direct performance counter for this we compute it from:
disk.time += delta(# operations) * avg secs/operation
Also changed the unit for this metric to seconds, and standardised this for other OSs (was previously reported in
ms
).Windows Metrics: