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

Unified Diff: chrome/common/metrics/metrics_log_manager.cc

Issue 81603002: Send UMA stability stats in a separate UMA log on startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years 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
Index: chrome/common/metrics/metrics_log_manager.cc
===================================================================
--- chrome/common/metrics/metrics_log_manager.cc (revision 239504)
+++ chrome/common/metrics/metrics_log_manager.cc (working copy)
@@ -9,6 +9,7 @@
#include "base/metrics/histogram.h"
#include "base/sha1.h"
#include "base/strings/string_util.h"
+#include "base/timer/elapsed_timer.h"
#include "chrome/common/metrics/metrics_log_base.h"
MetricsLogManager::SerializedLog::SerializedLog() {}
@@ -167,6 +168,7 @@
DCHECK(log_serializer_.get());
if (!log_serializer_.get())
return;
+ base::ElapsedTimer timer;
// Remove any ongoing logs that are over the serialization size limit.
if (max_ongoing_log_store_size_) {
for (std::vector<SerializedLog>::iterator it = unsent_ongoing_logs_.begin();
@@ -185,16 +187,19 @@
MetricsLogBase::INITIAL_LOG);
log_serializer_->SerializeLogs(unsent_ongoing_logs_,
MetricsLogBase::ONGOING_LOG);
+ UMA_HISTOGRAM_TIMES("UMA.StoreLogsTime", timer.Elapsed());
}
void MetricsLogManager::LoadPersistedUnsentLogs() {
DCHECK(log_serializer_.get());
if (!log_serializer_.get())
return;
+ base::ElapsedTimer timer;
log_serializer_->DeserializeLogs(MetricsLogBase::INITIAL_LOG,
&unsent_initial_logs_);
log_serializer_->DeserializeLogs(MetricsLogBase::ONGOING_LOG,
&unsent_ongoing_logs_);
+ UMA_HISTOGRAM_TIMES("UMA.LoadLogsTime", timer.Elapsed());
}
void MetricsLogManager::CompressCurrentLog(SerializedLog* compressed_log) {

Powered by Google App Engine
This is Rietveld 408576698