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

Switch to using perf counters to get disk io metrics on Windows #1340

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

james-bebbington
Copy link
Member

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

The Disk IO stats returned by gopsutil on Windows are dependent on the drive configuration and don't always work (e.g. doesn't work on EC2 or GCE). Even if we fixed this to work like psutil, the drive descriptions will show as PhysicalDisk[0-26] instead of reflecting the associated partition mounts [A-Z]: and there is no straightforward way to show a more user friendly name.

Without any better alternative, this PR reverts to getting Disk IO stats from performance counters on Windows. There doesn't seem to be a performance counter for "Disk Time" so ignoring that for now.

Note this PR renames the disk_scraper.go to disk_scraper_others.go (otherwise unchanged) & puts that behind a !windows build flag. We then add a separate scraper for windows, disk_scraper_windows.go, with an implementation using perf counters.

@codecov
Copy link

codecov bot commented Jul 14, 2020

Codecov Report

Merging #1340 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1340   +/-   ##
=======================================
  Coverage   90.14%   90.14%           
=======================================
  Files         218      218           
  Lines       15256    15256           
=======================================
  Hits        13752    13752           
  Misses       1095     1095           
  Partials      409      409           
Impacted Files Coverage Δ
...l/scraper/diskscraper/disk_scraper_others_linux.go 100.00% <ø> (ø)
...nternal/scraper/diskscraper/disk_scraper_others.go 100.00% <100.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 71392e5...bd9a0f0. Read the comment docs.

@bogdandrutu bogdandrutu merged commit 7eee24f into open-telemetry:master Jul 15, 2020
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
* Add TraceState to API

* Add tests for TraceState

* Update related tests

- stdout exporter test
- SDK test

* Update OTLP span transform

* Update CHANGELOG

* Change TraceState to struct instead of pointer

- Adjust tests for trace API
- Adjust adjacent parts of codebase (test utils, SDK etc.)

* Add methods to assert equality

- for type SpanContext, if SpanID, TraceID, TraceFlag and TraceState are
equal
- for type TraceState, if entries of both respective trace states are
equal

Signed-off-by: Matej Gera <matejgera@gmail.com>

* Copy values for new TraceState, adjust tests

* Use IsEqualWith in remaining tests instead of assertion func

* Further feedback, minor improvements

- Move IsEqualWith method to be only in test package
- Minor improvements, typos etc.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
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.

2 participants