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

Unified Diff: src/platform/metrics/metrics_library.cc

Issue 1747008: Add support for linear/enumeration histograms. (Closed)
Patch Set: Created 10 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 | « src/platform/metrics/metrics_library.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/metrics/metrics_library.cc
diff --git a/src/platform/metrics/metrics_library.cc b/src/platform/metrics/metrics_library.cc
index 681cf96ab597e1cca77906e42887caccc115f6cb..95e78b2275b39515b8f54ef493296098d4af8c6d 100644
--- a/src/platform/metrics/metrics_library.cc
+++ b/src/platform/metrics/metrics_library.cc
@@ -150,3 +150,20 @@ bool MetricsLibrary::SendToChrome(const string& name, int sample,
// Send the message.
return SendMessageToChrome(message_length, message);
}
+
+//static
+bool MetricsLibrary::SendEnumToChrome(const std::string& name, int sample,
+ int max) {
+ // Format the message.
+ char message[kBufferSize];
+ int32_t message_length =
+ FormatChromeMessage(kBufferSize, message,
+ "linearhistogram%c%s %d %d", '\0',
+ name.c_str(), sample, max);
+
+ if (message_length < 0)
+ return false;
+
+ // Send the message.
+ return SendMessageToChrome(message_length, message);
+}
« no previous file with comments | « src/platform/metrics/metrics_library.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698