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

initial commit hw metrics queue #19

Merged
merged 5 commits into from
May 16, 2024
Merged

Conversation

mraess
Copy link
Collaborator

@mraess mraess commented May 13, 2024

Pull Request

Short Summary

This second part of hw metrics contains the code to pull hw metrics and send them to a global background queue, where they are then picked up by a consumer function to be sent to the db in the third part.

Context

Continuation of getting hw metrics into opsml.

@mraess mraess self-assigned this May 13, 2024
Copy link

github-actions bot commented May 13, 2024

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Manifest Files

Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 91.56%. Comparing base (34e94dc) to head (460595d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
+ Coverage   91.54%   91.56%   +0.01%     
==========================================
  Files         114      114              
  Lines        9112     9136      +24     
==========================================
+ Hits         8342     8365      +23     
- Misses        770      771       +1     
Files Coverage Δ
opsml/projects/_hw_metrics.py 93.28% <100.00%> (ø)
opsml/projects/_run_manager.py 96.55% <93.33%> (-1.28%) ⬇️

... and 1 file with indirect coverage changes

@mraess mraess requested a review from thorrester May 14, 2024 14:45
# report
logger.info("Got metrics: {}", metrics_unit.model_dump())

except Empty:
Copy link
Member

@thorrester thorrester May 16, 2024

Choose a reason for hiding this comment

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

adding an exception with timeout so we don't block the thread indefinitely

@@ -133,8 +171,11 @@ def _log_hardware_metrics(self, interval: int) -> None:
assert self.active_run is not None, "active_run should not be None"

# run hardware logger in background thread
executor = concurrent.futures.ThreadPoolExecutor(max_workers=1)
executor.submit(run_hardware_logger, interval, self.active_run)
queue: Queue[HardwareMetrics] = Queue()
Copy link
Member

Choose a reason for hiding this comment

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

Realized we can assign queue without adding it to the active run or run_manager

@mraess mraess merged commit cded397 into main May 16, 2024
14 checks passed
@mraess mraess deleted the mraess/hardwareMetricsDataDump branch May 16, 2024 19:04
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.

None yet

2 participants