| 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 The Chrome OS "metrics" package contains utilities for client-side user metric | 5 The Chrome OS "metrics" package contains utilities for client-side user metric |
| 6 collection. The collected data is sent to Chrome for transport to the UMA | 6 collection. The collected data is sent to Chrome for transport to the UMA |
| 7 server. | 7 server. |
| 8 | 8 |
| 9 | 9 |
| 10 ================================================================================ | 10 ================================================================================ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 - Link the module with libmetrics (for example, by passing -lmetrics to the | 23 - Link the module with libmetrics (for example, by passing -lmetrics to the |
| 24 module's link command). Both libmetrics.so and libmetrics.a are built and | 24 module's link command). Both libmetrics.so and libmetrics.a are built and |
| 25 installed under $SYSROOT/usr/lib/. Note that by default -lmetrics will link | 25 installed under $SYSROOT/usr/lib/. Note that by default -lmetrics will link |
| 26 against libmetrics.so, which is preferred. | 26 against libmetrics.so, which is preferred. |
| 27 | 27 |
| 28 - To access the metrics library API in the module, include the | 28 - To access the metrics library API in the module, include the |
| 29 <metrics/metrics_library.h> header file. The file is installed in | 29 <metrics/metrics_library.h> header file. The file is installed in |
| 30 $SYSROOT/usr/include/ when the metrics library is built and installed. | 30 $SYSROOT/usr/include/ when the metrics library is built and installed. |
| 31 | 31 |
| 32 - The API includes two methods: | 32 - The API is documented in metrics_library.h under src/platform/metrics/. Before |
| 33 | 33 using the API methods, a MetricsLibrary object needs to be constructed and |
| 34 bool MetricsLibrary::SendToUMA(const std::string& name, int sample, | 34 initialized through its Init method. |
| 35 int min, int max, int nbuckets) | |
| 36 sends a sample for a regular (exponential) histogram. | |
| 37 | |
| 38 bool MetricsLibrary::SendEnumToUMA(const std::string& name, int sample, | |
| 39 int max) | |
| 40 sends a sample for an enumeration (linear) histogram. | |
| 41 | |
| 42 Before using these methods, a MetricsLibrary object needs to be constructed | |
| 43 and initialized through its Init method. See the complete API documentation in | |
| 44 metrics_library.h under src/platform/metrics/. | |
| 45 | 35 |
| 46 For more information on the C API see c_metrics_library.h. | 36 For more information on the C API see c_metrics_library.h. |
| 47 | 37 |
| 48 - Samples are sent to Chrome only if the "/home/chronos/Consent To Send Stats" | 38 - Samples are sent to Chrome only if the "/home/chronos/Consent To Send Stats" |
| 49 file exists (see the AreMetricsEnabled API method). Normally, this file is | 39 file exists (see the AreMetricsEnabled API method). Normally, this file is |
| 50 created when the user opts into metrics collection. | 40 created when the user opts into metrics collection. |
| 51 | 41 |
| 52 - On the target platform, shortly after the sample is sent, it should be visible | 42 - On the target platform, shortly after the sample is sent, it should be visible |
| 53 in Chrome through "about:histograms". | 43 in Chrome through "about:histograms". |
| 54 | 44 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 81 include data for older dates. If past data needs to be displayed, manual | 71 include data for older dates. If past data needs to be displayed, manual |
| 82 server-side intervention is required. In other words, one should assume that | 72 server-side intervention is required. In other words, one should assume that |
| 83 field data collection starts only after the histogram XML has been updated. | 73 field data collection starts only after the histogram XML has been updated. |
| 84 | 74 |
| 85 | 75 |
| 86 ================================================================================ | 76 ================================================================================ |
| 87 The Metrics Client: metrics_client | 77 The Metrics Client: metrics_client |
| 88 ================================================================================ | 78 ================================================================================ |
| 89 | 79 |
| 90 metrics_client is a simple shell command-line utility for sending histogram | 80 metrics_client is a simple shell command-line utility for sending histogram |
| 91 samples. It's installed under /usr/bin on the target platform and uses | 81 samples and user actions. It's installed under /usr/bin on the target platform |
| 92 libmetrics to send the data to Chrome. The utility is useful for generating | 82 and uses libmetrics to send the data to Chrome. The utility is useful for |
| 93 metrics from shell scripts. | 83 generating metrics from shell scripts. |
| 94 | 84 |
| 95 For usage information and command-line options, run "metrics_client" on the | 85 For usage information and command-line options, run "metrics_client" on the |
| 96 target platform or look for "Usage:" in metrics_client.cc. | 86 target platform or look for "Usage:" in metrics_client.cc. |
| 97 | 87 |
| 98 | 88 |
| 99 ================================================================================ | 89 ================================================================================ |
| 100 The Metrics Daemon: metrics_daemon | 90 The Metrics Daemon: metrics_daemon |
| 101 ================================================================================ | 91 ================================================================================ |
| 102 | 92 |
| 103 metrics_daemon is a daemon that runs in the background on the target platform | 93 metrics_daemon is a daemon that runs in the background on the target platform |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 126 |
| 137 Q. When should I use an enumeration (linear) histogram vs. a regular | 127 Q. When should I use an enumeration (linear) histogram vs. a regular |
| 138 (exponential) histogram? | 128 (exponential) histogram? |
| 139 | 129 |
| 140 A. Enumeration histograms should really be used only for sampling enumerated | 130 A. Enumeration histograms should really be used only for sampling enumerated |
| 141 events and, in some cases, percentages. Normally, you should use a regular | 131 events and, in some cases, percentages. Normally, you should use a regular |
| 142 histogram with exponential bucket layout that provides higher resolution at | 132 histogram with exponential bucket layout that provides higher resolution at |
| 143 the low end of the range and lower resolution at the high end. Regular | 133 the low end of the range and lower resolution at the high end. Regular |
| 144 histograms are generally used for collecting performance data (e.g., timing, | 134 histograms are generally used for collecting performance data (e.g., timing, |
| 145 memory usage, power) as well as aggregated event counts. | 135 memory usage, power) as well as aggregated event counts. |
| OLD | NEW |