Commit 971476d4 authored by danielng's avatar danielng Committed by Chromium LUCI CQ

borealis: fix for metrics when borealis shuts down

Currently startup metrics are recorded every time the VM is
shutdown using the functionality in the context manager. This
is incorrect, we should only be recording startup metrics when
a startup attempt has completed. The change makes it so that
shutdowns that cancel a startup attempt (noted by startup tasks
existing) emit a metric, but other shutdowns do not.

Bug: none
Change-Id: Iecb5c91e143f3a0550f9bc4bec7283f7c1bebfbd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2577079Reviewed-by: default avatarNic Hollingum <hollingum@google.com>
Commit-Queue: Daniel Ng <danielng@google.com>
Cr-Commit-Position: refs/heads/master@{#834965}
parent e8f2cae2
......@@ -118,6 +118,7 @@ void BorealisContextManagerImpl::Complete(BorealisStartupResult result,
std::string error_or_empty) {
startup_result_ = result;
startup_error_ = error_or_empty;
if (result != BorealisStartupResult::kCancelled || !task_queue_.empty())
RecordBorealisStartupResultHistogram(result);
while (!callback_queue_.empty()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment