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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/platform/metrics/metrics_library.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /* 5 /*
6 * metrics_library.cc 6 * metrics_library.cc
7 * 7 *
8 * Created on: Dec 1, 2009 8 * Created on: Dec 1, 2009
9 * Author: sosa 9 * Author: sosa
10 */ 10 */
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 FormatChromeMessage(kBufferSize, message, 143 FormatChromeMessage(kBufferSize, message,
144 "histogram%c%s %d %d %d %d", '\0', 144 "histogram%c%s %d %d %d %d", '\0',
145 name.c_str(), sample, min, max, nbuckets); 145 name.c_str(), sample, min, max, nbuckets);
146 146
147 if (message_length < 0) 147 if (message_length < 0)
148 return false; 148 return false;
149 149
150 // Send the message. 150 // Send the message.
151 return SendMessageToChrome(message_length, message); 151 return SendMessageToChrome(message_length, message);
152 } 152 }
153
154 //static
155 bool MetricsLibrary::SendEnumToChrome(const std::string& name, int sample,
156 int max) {
157 // Format the message.
158 char message[kBufferSize];
159 int32_t message_length =
160 FormatChromeMessage(kBufferSize, message,
161 "linearhistogram%c%s %d %d", '\0',
162 name.c_str(), sample, max);
163
164 if (message_length < 0)
165 return false;
166
167 // Send the message.
168 return SendMessageToChrome(message_length, message);
169 }
OLDNEW
« 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