Skip to content

Commit

Permalink
[Structured metrics] Fix bug in metrics upload
Browse files Browse the repository at this point in the history
We cache soon-to-be-uploaded metrics on-disk. The logic for uploading
metrics is missing a call to delete that cache, which means that if the
following situation happens, the metrics will be uploaded twice:

1. some metrics are logged
2. those metrics are uploaded
3. the user logs out before any more metrics are logged

This is reasonably rare given what we log, but affected M90. This CL
fixes the issue.

(cherry picked from commit 6a20d97)

Bug: 1028447
Change-Id: Iffee3238050e33d6b5067638a02831d07a8516a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2814133
Reviewed-by: Thanh Nguyen <thanhdng@chromium.org>
Commit-Queue: Tony Yeoman <tby@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#870855}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2821678
Cr-Commit-Position: refs/branch-heads/4472@{#24}
Cr-Branched-From: 3d60439-refs/heads/master@{#870763}
  • Loading branch information
tby authored and Chromium LUCI CQ committed Apr 13, 2021
1 parent 7509669 commit db260fd
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ void StructuredMetricsProvider::ProvideCurrentSessionData(
structured_data->mutable_events()->Swap(
events_.get()->get()->mutable_uma_events());
events_.get()->get()->clear_uma_events();
events_->StartWrite();
}

bool StructuredMetricsProvider::HasIndependentMetrics() {
Expand Down

0 comments on commit db260fd

Please sign in to comment.