OLD | NEW |
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.h | 6 * metrics_library.h |
7 * | 7 * |
8 * Created on: Dec 1, 2009 | 8 * Created on: Dec 1, 2009 |
9 * Author: sosa | 9 * Author: sosa |
10 */ | 10 */ |
(...skipping 15 matching lines...) Expand all Loading... |
26 // | 26 // |
27 // |sample| is the sample value to be recorded (|min| <= |sample| < |max|). | 27 // |sample| is the sample value to be recorded (|min| <= |sample| < |max|). |
28 // |min| is the minimum value of the histogram samples (|min| > 0). | 28 // |min| is the minimum value of the histogram samples (|min| > 0). |
29 // |max| is the maximum value of the histogram samples. | 29 // |max| is the maximum value of the histogram samples. |
30 // |nbuckets| is the number of histogram buckets. | 30 // |nbuckets| is the number of histogram buckets. |
31 // [0,min) is the implicit underflow bucket. | 31 // [0,min) is the implicit underflow bucket. |
32 // [|max|,infinity) is the implicit overflow bucket. | 32 // [|max|,infinity) is the implicit overflow bucket. |
33 static bool SendToChrome(const std::string& name, int sample, | 33 static bool SendToChrome(const std::string& name, int sample, |
34 int min, int max, int nbuckets); | 34 int min, int max, int nbuckets); |
35 | 35 |
| 36 // Sends linear histogram data to Chrome for transport to UMA and |
| 37 // returns true on success. This method results in the equivalent of |
| 38 // an asynchronous non-blocking RPC to UMA_HISTOGRAM_ENUMERATION |
| 39 // inside Chrome (see base/histogram.h). |
| 40 // |
| 41 // |sample| is the sample value to be recorded (1 <= |sample| < |max|). |
| 42 // |max| is the maximum value of the histogram samples. |
| 43 // 0 is the implicit underflow bucket. |
| 44 // [|max|,infinity) is the implicit overflow bucket. |
| 45 static bool SendEnumToChrome(const std::string& name, int sample, int max); |
| 46 |
36 // Sends to Autotest and returns true on success. | 47 // Sends to Autotest and returns true on success. |
37 static bool SendToAutotest(const std::string& name, int value); | 48 static bool SendToAutotest(const std::string& name, int value); |
38 }; | 49 }; |
39 | 50 |
40 #endif /* METRICS_LIBRARY_H_ */ | 51 #endif /* METRICS_LIBRARY_H_ */ |
OLD | NEW |