Chromium Code Reviews| 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 /* | |
| 6 * metrics_library.h | |
| 7 * | |
| 8 * Created on: Dec 1, 2009 | |
| 9 * Author: sosa | |
| 10 */ | |
| 11 | |
|
sosa
2010/05/12 22:04:09
Sadness
| |
| 12 #ifndef METRICS_LIBRARY_H_ | 5 #ifndef METRICS_LIBRARY_H_ |
| 13 #define METRICS_LIBRARY_H_ | 6 #define METRICS_LIBRARY_H_ |
| 14 | 7 |
| 15 #include <string> | 8 #include <string> |
| 16 | 9 |
| 17 // TODO(sosa@chromium.org): Add testing for send methods | 10 // TODO(sosa@chromium.org): Add testing for send methods |
| 18 | 11 |
| 19 class MetricsLibraryInterface { | 12 class MetricsLibraryInterface { |
| 20 public: | 13 public: |
| 21 virtual void Init() = 0; | 14 virtual void Init() = 0; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 38 // | 31 // |
| 39 // |sample| is the sample value to be recorded (|min| <= |sample| < |max|). | 32 // |sample| is the sample value to be recorded (|min| <= |sample| < |max|). |
| 40 // |min| is the minimum value of the histogram samples (|min| > 0). | 33 // |min| is the minimum value of the histogram samples (|min| > 0). |
| 41 // |max| is the maximum value of the histogram samples. | 34 // |max| is the maximum value of the histogram samples. |
| 42 // |nbuckets| is the number of histogram buckets. | 35 // |nbuckets| is the number of histogram buckets. |
| 43 // [0,min) is the implicit underflow bucket. | 36 // [0,min) is the implicit underflow bucket. |
| 44 // [|max|,infinity) is the implicit overflow bucket. | 37 // [|max|,infinity) is the implicit overflow bucket. |
| 45 bool SendToUMA(const std::string& name, int sample, | 38 bool SendToUMA(const std::string& name, int sample, |
| 46 int min, int max, int nbuckets); | 39 int min, int max, int nbuckets); |
| 47 | 40 |
| 48 // Deprecated. | |
| 49 static bool SendToChrome(const std::string& name, int sample, | |
| 50 int min, int max, int nbuckets); | |
| 51 | |
| 52 // Sends linear histogram data to Chrome for transport to UMA and | 41 // Sends linear histogram data to Chrome for transport to UMA and |
| 53 // returns true on success. This method results in the equivalent of | 42 // returns true on success. This method results in the equivalent of |
| 54 // an asynchronous non-blocking RPC to UMA_HISTOGRAM_ENUMERATION | 43 // an asynchronous non-blocking RPC to UMA_HISTOGRAM_ENUMERATION |
| 55 // inside Chrome (see base/histogram.h). | 44 // inside Chrome (see base/histogram.h). |
| 56 // | 45 // |
| 57 // |sample| is the sample value to be recorded (1 <= |sample| < |max|). | 46 // |sample| is the sample value to be recorded (1 <= |sample| < |max|). |
| 58 // |max| is the maximum value of the histogram samples. | 47 // |max| is the maximum value of the histogram samples. |
| 59 // 0 is the implicit underflow bucket. | 48 // 0 is the implicit underflow bucket. |
| 60 // [|max|,infinity) is the implicit overflow bucket. | 49 // [|max|,infinity) is the implicit overflow bucket. |
| 61 bool SendEnumToUMA(const std::string& name, int sample, int max); | 50 bool SendEnumToUMA(const std::string& name, int sample, int max); |
| 62 | 51 |
| 63 // Deprecated. | |
| 64 static bool SendEnumToChrome(const std::string& name, int sample, int max); | |
| 65 | |
| 66 // Sends to Autotest and returns true on success. | 52 // Sends to Autotest and returns true on success. |
| 67 static bool SendToAutotest(const std::string& name, int value); | 53 static bool SendToAutotest(const std::string& name, int value); |
| 68 }; | 54 }; |
| 69 | 55 |
| 70 #endif /* METRICS_LIBRARY_H_ */ | 56 #endif /* METRICS_LIBRARY_H_ */ |
| OLD | NEW |