-
Notifications
You must be signed in to change notification settings - Fork 517
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
metricdog: add boot time related metrics to send-boot-success #3204
Conversation
a03da34
to
7849944
Compare
Push above addresses @arnaldo2792's comments. Push below rebases onto develop |
7849944
to
613bb6a
Compare
613bb6a
to
43cb552
Compare
sources/metricdog/src/metricdog.rs
Outdated
values.insert( | ||
"network_ready_time".to_string(), | ||
self.host_check.network_ready_time()?, | ||
); |
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.
If we want these values to be stable, to simplify querying the results - would it make sense to have a real struct with known, optional fields? Or an enum with two variants - BootStatus
and HealthStatus
?
43cb552
to
80b5d0a
Compare
Push above addresses @bcressey's comments. Adds Unit tests pass. Generated metrics event:
Updated PR description with new testing. |
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
Refactors to accommodate a new trait for checking host status using systemd utilities. Refactors how query parameters are constructed with structs to denote fields more stably.
80b5d0a
to
e4735d5
Compare
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.
Better error handling!
}) | ||
} | ||
|
||
fn is_active(service: &str) -> Result<bool> { |
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.
Nit: My knee-jerk reaction anytime I see an &str
as a funtion argument is to suggest to use AsRef<str>
to make it more friendly to use and robust. Given these functions are only used in this module... I can see why we wouldn't do that. It just looked odd to my eyes given most of our other code does so.
Issue number:
N/A
Description of changes:
Testing done:
Checked emitted event from
metricdog
upon first boot and was able to serialize out the following:After a reboot, metricdog sent another
send-boot-success
event with the following parameters:Note how
is_first_boot
is no longer true and it took less time for the host to become ready as expected.Checked a health-ping event to make sure there's no regression:
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.