Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(972)

Unified Diff: components/metrics/persisted_logs.cc

Issue 1871733002: Add histograms for observing UMA throttling effect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/metrics/net/net_metrics_log_uploader.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/persisted_logs.cc
diff --git a/components/metrics/persisted_logs.cc b/components/metrics/persisted_logs.cc
index c78ecec2596b995dd04364fb9a272ecd5613123c..52292da55ccd5d18f99e30898f2424502e8163ef 100644
--- a/components/metrics/persisted_logs.cc
+++ b/components/metrics/persisted_logs.cc
@@ -130,17 +130,21 @@ void PersistedLogs::WriteLogsToPrefList(base::ListValue* list_value) const {
bytes_used += log_size;
++saved_log_count;
}
+ int dropped_logs_num = start - 1;
for (size_t i = start; i < list_.size(); ++i) {
size_t log_size = list_[i].compressed_log_data.length();
if (log_size > max_log_size_) {
UMA_HISTOGRAM_COUNTS("UMA.Large Accumulated Log Not Persisted",
static_cast<int>(log_size));
+ dropped_logs_num++;
continue;
}
AppendBase64String(list_[i].compressed_log_data, list_value);
AppendBase64String(list_[i].hash, list_value);
}
+ if (dropped_logs_num > 0)
+ UMA_HISTOGRAM_COUNTS("UMA.UnsentLogs.Dropped", dropped_logs_num);
}
PersistedLogs::LogReadStatus PersistedLogs::ReadLogsFromPrefList(
« no previous file with comments | « components/metrics/net/net_metrics_log_uploader.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698