Use remote sent times for calculating uptime in GetStatus
Do the same thing as when retrieving all statuses and use the monotonic
sent time of the status message as the "now" for calculating uptime.
This doesn't include the latency between the sending of the status
message and when aos_starter is run, but for typical use-cases that
shouldn't be an issue.
Change-Id: I73104b6a819d17817b4cbaf15378b91c852195bd
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/starter/starter_cmd.cc b/aos/starter/starter_cmd.cc
index b3fb6c6..65861e1 100644
--- a/aos/starter/starter_cmd.cc
+++ b/aos/starter/starter_cmd.cc
@@ -158,8 +158,8 @@
auto optional_status =
aos::starter::GetStatus(application_name, config, node);
if (optional_status.has_value()) {
- PrintApplicationStatus(&optional_status.value().message(),
- aos::monotonic_clock::now(), node);
+ PrintApplicationStatus(&optional_status.value().second.message(),
+ optional_status.value().first, node);
} else {
if (node != nullptr) {
LOG(ERROR) << "No status available yet for \"" << application_name