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

Unified Diff: chrome/browser/metrics/metrics_service.cc

Issue 26646003: MetricsService: Send a hash of the UMA log in a header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 2 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
Index: chrome/browser/metrics/metrics_service.cc
===================================================================
--- chrome/browser/metrics/metrics_service.cc (revision 228712)
+++ chrome/browser/metrics/metrics_service.cc (working copy)
@@ -1463,6 +1463,10 @@
current_fetch_->SetUploadData(kMimeType, compressed_log_text);
// Tell the server that we're uploading gzipped protobufs.
current_fetch_->SetExtraRequestHeaders("content-encoding: gzip");
+ const std::string hash =
+ base::HexEncode(log_manager_.staged_log_hash().data(),
+ log_manager_.staged_log_hash().size());
Ilya Sherman 2013/10/16 18:26:14 nit: Why does the hash need to be hex-encoded? If
Ilya Sherman 2013/10/16 18:26:14 Please consider adding a DCHECK to verify that the
Alexei Svitkine (slow) 2013/10/16 19:31:46 Done.
Alexei Svitkine (slow) 2013/10/16 19:31:46 The SHA1 hash returned by the API we're using the
+ current_fetch_->AddExtraRequestHeader("X-Chrome-UMA-Log-SHA1: " + hash);
UMA_HISTOGRAM_PERCENTAGE(
"UMA.ProtoCompressionRatio",
100 * compressed_log_text.size() / log_text.size());

Powered by Google App Engine
This is Rietveld 408576698