History log of /system/core/metricsd/uploader/upload_service.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d6862317a6259695b0ae13a889fd12fe7c8e75c4 19-Jan-2016 Bertrand SIMONNET <bsimonnet@google.com> metricsd: Persist metrics on shutdown.

When metricsd receives a SIGTERM signal (on system shutdown for
example), save the metrics to disk before exiting.

Bug: 26184202
Test: Start metricsd. Log a metric sample. Stop metricsd. The metric is
saved to disk.

Change-Id: Ib224efa8837130393fac5d06fa80d320263cfc84
/system/core/metricsd/uploader/upload_service.cc
0586504e01784b054944ca12f816880e27dfc2e7 15-Dec-2015 Bertrand SIMONNET <bsimonnet@google.com> 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
/system/core/metricsd/uploader/upload_service.cc
b6c77af4993b5e5a83fd1ed80309823e44f70650 09-Dec-2015 Bertrand SIMONNET <bsimonnet@google.com> metricsd: Cleanup on TERM signal.

metricsd should shutdown cleanly when receiving a TERM signal:
* stop the binder watcher.
* wait for the thread to quit.
* Exit cleanly.

Note: This is not directly used as we don't send SIGTERM on shutdown or
when stopping services yet.

Bug: 25670584
Change-Id: I878d1e67474c72d24790f3540470e37a23112a95
/system/core/metricsd/uploader/upload_service.cc
6c9fbb9a3aaee50302d54de8f27fc712c836b9ea 21-Dec-2015 Bertrand SIMONNET <bsimonnet@google.com> metricsd: Replace scoped_ptr with unique_ptr.

scoped_ptr are a chromism. We should use unique_ptr instead.

Bug: 25958769
Test: unit tests.

Change-Id: Ie23ae2ef42f66dcc76f45a9dafa66c8ceb0a2d90
/system/core/metricsd/uploader/upload_service.cc
6b8629a6490d01196368ae1ed5bc6967c6f127eb 18-Nov-2015 Bertrand SIMONNET <bsimonnet@google.com> metricsd: Log over binder.

This CL converts metricsd, libmetrics and metrics_collector to use
Binder to pass metrics samples.

Bug: 25670685

Change-Id: I657faecdf4ed1226ab30ce69e062028463437e7b
/system/core/metricsd/uploader/upload_service.cc
9d3a4aeae2bd59ebe72fca44c4fa508c1e9f1333 25-Nov-2015 Bertrand SIMONNET <bsimonnet@google.com> 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
/system/core/metricsd/uploader/upload_service.cc
a7bc1c14df9993fc2ae0ec6258e513b8371dd910 25-Nov-2015 Bertrand SIMONNET <bsimonnet@google.com> metricsd: Specify directory for persistent integers.

Instead of using a global directory for persistent integers, specify the
directory to use in the constructor.
This will make changing the backing directory easier.

Bug: 25886951

Change-Id: I590816b195fa81b179a5ec78b9cdf41bc86353dc
/system/core/metricsd/uploader/upload_service.cc
608e428006fa317badd51b941e05bdba42bd08bd 13-Nov-2015 Bertrand SIMONNET <bsimonnet@google.com> metricsd: Split into two daemons.

This CL splits metrics_daemon into two independent daemons: metricsd and
metrics_collector.

* metricsd will be responsible for reading the metrics from disk and
periodically uploading them to the server.
* metrics_collector will be responsible for gathering generic metrics
from the system and managing the weave state for metrics.

This refactoring is necessary to prepare the migration of metricsd to
log over binder.

Bug: 25670908
Test: Unit tests.
Test: manual: both daemons run. Metrics are logged, uploaded and the
weave interaction works.

Change-Id: Ib00e1772bb7eec87cbcdcd912c30b555d79d7074
/system/core/metricsd/uploader/upload_service.cc
1df10c43eab5b8c483fbf882a0c8a6e5e59c73c0 09-Sep-2015 Bertrand SIMONNET <bsimonnet@google.com> 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
/system/core/metricsd/uploader/upload_service.cc
2765d0abccd0c754422332d114cdecc271888e2d 09-Sep-2015 Bertrand SIMONNET <bsimonnet@google.com> 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
/system/core/metricsd/uploader/upload_service.cc
1f14655b27c3e33ee1e93cd52b2ad9ab79018630 20-Aug-2015 Bertrand SIMONNET <bsimonnet@google.com> metricsd: Don't crash when some metadata is missing.

Instead of crashing when the build target id is missing, simply print a
useful warning and discard the log.

BUG: 23351227

Change-Id: I3abf3063d6440b07103db29938eec5071ea8f60b
/system/core/metricsd/uploader/upload_service.cc
52e5b99983c1f7ff0b9a1f3b4b80d779073b21c8 11-Aug-2015 Bertrand SIMONNET <bsimonnet@google.com> metricsd: Relicense as Apache 2.

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
/system/core/metricsd/uploader/upload_service.cc
da21ac0751a3abf3502ff74c5de7ad95db52ba30 10-Aug-2015 Bertrand SIMONNET <bsimonnet@google.com> 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
/system/core/metricsd/uploader/upload_service.cc