Commit 54bdc651 authored by Steven Holte's avatar Steven Holte Committed by Commit Bot

Track UKM discontinuities.

This allows checking for potential data quality issues.
See b/112853960

Change-Id: I4d361cbc18dde8589d6da23026bbfa8d4db547cb
Reviewed-on: https://chromium-review.googlesource.com/1182291
Commit-Queue: Steven Holte <holte@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590511}
parent 57df9546
......@@ -239,6 +239,8 @@ void UkmRecorderImpl::EnableRecording(bool extensions) {
void UkmRecorderImpl::DisableRecording() {
DVLOG(1) << "UkmRecorderImpl::DisableRecording";
if (recording_enabled_)
recording_is_continuous_ = false;
recording_enabled_ = false;
extensions_enabled_ = false;
}
......@@ -250,6 +252,7 @@ void UkmRecorderImpl::DisableSamplingForTesting() {
void UkmRecorderImpl::Purge() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
recordings_.Reset();
recording_is_continuous_ = false;
}
void UkmRecorderImpl::SetIsWebstoreExtensionCallback(
......@@ -359,6 +362,9 @@ void UkmRecorderImpl::StoreRecordingsInReport(Report* report) {
recordings_.entries.clear();
recordings_.event_aggregations.clear();
report->set_is_continuous(recording_is_continuous_);
recording_is_continuous_ = true;
// Keep at most |max_kept_sources|, prioritizing most-recent entries (by
// creation time).
const size_t max_kept_sources = GetMaxKeptSources();
......
......@@ -136,6 +136,9 @@ class UkmRecorderImpl : public UkmRecorder {
// Indicates whether recording is enabled for extensions.
bool extensions_enabled_ = false;
// Indicates whether recording continuity has been broken since last report.
bool recording_is_continuous_ = true;
// Indicates if sampling has been enabled.
bool sampling_enabled_ = true;
......
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