This CL adds a dump command to metrics_client that will dump the
histograms, aggregated by metricsd since it started, in a human readable
format.
This is useful for developers to ensure that their code uses libmetrics
correctly and the reported values are correct.
Sample output (redacted to fit the commit message):
$ metrics_client -d
Histogram: hello recorded 5 samples, average = 54.8 (flags = 0x1)
0 ...
9 --------O (1 = 20.0%) {0.0%}
16 O (0 = 0.0%) {20.0%}
29 --------O (1 = 20.0%) {20.0%}
54 ------------------------O (3 = 60.0%) {40.0%}
100 O (0 = 0.0%) {100.0%}
$
Bug: 25817310
Test: * Send a histogram with metrics_client.
* `metrics_client -d` shows it.
Change-Id: Id186dc5463403ca9181ee9eef8f46b5e809b8714
This CL converts metricsd, libmetrics and metrics_collector to use
Binder to pass metrics samples.
Bug: 25670685
Change-Id: I657faecdf4ed1226ab30ce69e062028463437e7b
Instead of using a single directory for both the internal data of
metricsd and metrics_collector and the shared files (metrics samples log
file and the metrics enabled file), we should use separate directory to
allow for a finer access control.
The new structure will be:
* /data/misc/metrics for the files accessible to all daemons reporting
metrics, metricsd and metrics_collector.
* /data/misc/metricsd for the private files of metricsd.
* /data/misc/metrics_collector for the private files of
metrics_collector.
Bug: 25886951
Test: Unit tests.
Test: Manual: metricsd and metrics_collector run without errors.
Change-Id: I006d19f45f5f419d2b08744126c2e2a0b899c9fa
Instead of passing different filenames around, only rely on the metrics
directory and infer the filepath from it. This makes testing easier.
BUG: 23939404
TEST: unit tests.
Change-Id: I79086acc3a546464114fa8ec4656ec04e1c43e35
The format of the metrics dump is rudimentary just yet. Here is an example:
Metrics from /data/misc/metrics/uma-events
name: hello type: USER_ACTION
name: world type: USER_ACTION
This required the following changes:
* Added -d option to metrics_client
* Refactored file handling in SerializationUtils
- Factored out file opening and log parsing into helper methods
- Added ReadMetricsFromFile which is read-only so does not truncate the file
Change-Id: I6032d74242c79c678ec42a14e78fccc54e7af455
MODULE_LICENSE_BSD and NOTICE were removed as the license is no longer
different from the rest of system/core.
BUG: 23086670
Change-Id: I1e83ef2ecb9c721150f8aab283c9ff960337da8c
This makes the import path less confusing:
* metrics/metrics_library.h is imported from the exported headers.
* metricsd/* for includes by the metrics daemon itself.
BUG: 22879597
Change-Id: I9f44ea3a548cae39d4546fcd724e8007f6dd4bd0