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

Scrape system.disk.time on Windows #1408

Merged
merged 2 commits into from
Jul 23, 2020

Conversation

james-bebbington
Copy link
Member

@james-bebbington james-bebbington commented Jul 22, 2020

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:
image

@james-bebbington james-bebbington changed the title Disk windows Scrape system.disk.time on Windows Jul 22, 2020
@james-bebbington james-bebbington force-pushed the disk-windows branch 3 times, most recently from c341f2b to b8b6cbc Compare July 22, 2020 03:58
@codecov
Copy link

codecov bot commented Jul 22, 2020

Codecov Report

Merging #1408 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           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           
Impacted Files Coverage Δ
...iver/internal/scraper/diskscraper/disk_metadata.go 100.00% <100.00%> (ø)
...nternal/scraper/diskscraper/disk_scraper_others.go 100.00% <100.00%> (ø)
...l/scraper/diskscraper/disk_scraper_others_linux.go 100.00% <100.00%> (ø)
translator/internaldata/resource_to_oc.go 86.04% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4046234...5a544e8. Read the comment docs.

@jrcamp jrcamp self-assigned this Jul 22, 2020
Copy link
Contributor

@jrcamp jrcamp left a 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
Copy link
Contributor

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?

Copy link
Member

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 :)

Copy link
Member Author

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
Copy link
Member

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 :)

@bogdandrutu bogdandrutu merged commit 008aa47 into open-telemetry:master Jul 23, 2020
hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
* go mod tidy tests

* make install-tools
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants