Commit graph

11 commits

Author SHA1 Message Date
Bertrand SIMONNET
0586504e01 metricsd: Persist the metrics to disk periodically.
Every now and then (5 minutes by default), the uploader will persist the
current metrics to disk to avoid losing them in case we exit
unexpectedly (reboot or crash).
When starting up, metricsd will load the previously saved log and resume
the metrics collection from there.

Bug: 25670584
Test: Unit tests.
Test: manual: restart metricsd. The saved log is detected and parsed
correctly.
Test: manual: Send a sample to metricsd, send SIGTERM to metricsd, the
log is saved to disk, metricsd restarts and picks up the log where it
left.

Change-Id: I4cefc62c7ea1fa51333d84d8a7ba0a2e9c7fd58f
2016-01-12 15:54:11 -08:00
Bertrand SIMONNET
6b8629a649 metricsd: Log over binder.
This CL converts metricsd, libmetrics and metrics_collector to use
Binder to pass metrics samples.

Bug: 25670685

Change-Id: I657faecdf4ed1226ab30ce69e062028463437e7b
2015-12-03 17:01:27 -08:00
Bertrand SIMONNET
9d3a4aeae2 metricsd: Use different directories for each daemon.
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
2015-11-30 13:34:49 -08:00
Bertrand SIMONNET
e6b96d6d19 metricsd: Report the model manifest id.
When the model manifest id is defined in weave, report it.

Bug: 25386505
Test: the model manifest id is uploaded when defined.
Test: If weaved.conf is not defined, metricsd uploads the default value.

Change-Id: Ic895671621fda9ce5cdeacdbdba58aa73a6887fc
2015-10-30 14:42:55 -07:00
Bertrand SIMONNET
eb697abf5e metricsd: Read build time values from etc/os-release.d.
This stops relying on system properties to provide build time
configuration.
Product version and id will be stored in /etc/os-release.d.
Channel will be pulled from update engine.

BUG: 24947119
Change-Id: I0972d03cd83ef622846de3cce3dec1992fcc46cd
2015-10-14 15:58:06 -07:00
Bertrand SIMONNET
7beaf8924f metricsd: Use product id instead of build target id.
We decided to change the name of this identifier to "product id", the
system property where it is stored will also be named
ro.product.product_id.

BUG: 24302729

Change-Id: I0d2f0867b364de98367f0072d216acec76401c33
2015-09-24 16:23:30 -07:00
Bertrand SIMONNET
1df10c43ea metricsd: Persist the report to disk if an upload fails.
If the metrics server is unreachable, we may need to resend a metrics
report later. Instead of keeping the staged report in memory, save it to
disk to avoid loosing data if the system restarts or crashes.

BUG: 23033262
TEST: unit tests.

Change-Id: Idd14964e40f022952469f47d675d8cda9586d7cd
2015-09-14 13:55:33 -07:00
Bertrand SIMONNET
2765d0abcc metricsd: Use the metrics directory everywhere.
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
2015-09-14 13:55:28 -07:00
Bertrand SIMONNET
2699362a57 metricsd: Use system properties to store build time metadata.
Instead of using /etc/lsb-release to store the version, channel and
build_target_id, use the Android system properties.

BUG: 22879642

Change-Id: Ic79e74bd14bf8e2c55549c08963a66700b49b544
2015-08-25 16:23:04 -07:00
Bertrand SIMONNET
10fe60d36c metricsd: Enable https by default.
libchromeos was updated to set the certificates path correctly, we can
enable https by default.

BUG: 23016355
Change-Id: I88393df4a6892055f4865d86de78ba3a2a5b45e8
2015-08-20 10:40:55 -07:00
Bertrand SIMONNET
da21ac0751 metricsd: Rename metrics to metricsd.
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
2015-08-10 15:26:01 -07:00
Renamed from metrics/constants.h (Browse further)