collector
collector copied to clipboard
Stop copying hostname
Description
The hostname for a given node is lazily loaded in the HostInfo and will outlast any other object attempting to use it. As such, we should try to avoid unnecessary copies and just call the GetHostname method of the HostInfo class.
The GetHostname function from our utilities has been turned into a static method of HostInfo so we can directly access it calling HostInfo::GetHostname(), otherwise we would need HostInfo::Instance().GetHostname() which is a bit too verbose.
Checklist
- [x] Investigated and inspected CI test results
- [ ] Updated documentation accordingly
Automated testing
- [ ] Added unit tests
- [ ] Added integration tests
- [ ] Added regression tests
If any of these don't apply, please comment below.
Testing Performed
- [x] Check CI logs to validate the hostname is properly being captured.
Codecov Report
Attention: Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.
Project coverage is 27.53%. Comparing base (
0d6cb4c) to head (671a36c).
:white_check_mark: All tests successful. No failed tests found.
Additional details and impacted files
@@ Coverage Diff @@
## master #2082 +/- ##
==========================================
+ Coverage 27.51% 27.53% +0.01%
==========================================
Files 93 93
Lines 5727 5724 -3
Branches 2533 2532 -1
==========================================
Hits 1576 1576
+ Misses 3484 3481 -3
Partials 667 667
| Flag | Coverage Δ | |
|---|---|---|
| collector-unit-tests | 27.53% <0.00%> (+0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.