Commit graph

29 commits

Author SHA1 Message Date
Luigi Semenzato
a7ebeb3e8b Add sparse histograms to the metrics library and metrics client.
Samples to these histograms are any 32-bit int value.

BUG=chromium:222189
TEST=manual

Change-Id: Ic8d5773d05d717a275c4a4b5616e0e4c307337b8
Reviewed-on: https://gerrit.chromium.org/gerrit/45897
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
2013-04-30 15:54:38 -07:00
Chih-Chung Chang
6844c06107 metrics: Add Cras.NoCodecsFoundAtBoot event to CrosEvents
Also put event names into an array, so it's easier to add new event names.

BUG=none
TEST=run "strace -e write=3 metrics_client -v Cras.NoCodecsFoundAtBoot" and
verify the event is written.

Change-Id: I925b4ff3b6d362e099df62a11905c1df03fc9435
Reviewed-on: https://gerrit.chromium.org/gerrit/46998
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
2013-04-02 21:56:20 -07:00
Grant Grundler
4b5164bb9e metrics: add HwWatchdogReboot to CrosEvents
Add HwWatchdogReboot to CrosEvents support.

BUG=chromium:221000
TEST=none

Change-Id: I7388c6d1ee93a73f930d591552b18ea7bba7743f
Signed-off-by: Grant Grundler <grundler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46593
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
2013-03-28 18:27:14 -07:00
Luigi Semenzato
3268422240 Add generic "event of interest" enumerated histogram.
This change aims to simplify the addition of events we may
want to track in the field, more specifically hard-to-reproduce
bugs.  Before this change, this requires creating a new histogram
and registering it via histograms.xml, which is not in the Chrome OS
repositories.  With this change, a new event just requires claiming
an event name (such as ModemManagerCommandSendFailure) in
metrics_library.cc, and running "metrics_client -v <event name>"
or calling SendCrosEventToUMA(event_name).

I can make up a bug for this.  Or not.

BUG=none
TEST=compiled

Change-Id: I9c56b58310f0d22e77624edee7fe6149abd60a49
Reviewed-on: https://gerrit.chromium.org/gerrit/45322
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
2013-03-13 16:05:39 -07:00
Chris Masone
e10b548cf5 [metrics] Update metrics to build against libchrome-180609
base/eintr_wrapper.h moved to base/posix/eintr_wrapper.h

CQ-DEPEND=Ib19c1382ab28ae7632728aa672478da2feb3950e

BUG=chromium-os:38941
TEST=emerge the metrics package with tests enabled.
STATUS=Fixed

Change-Id: I5d72d8934930ce394786ee151fd8f390b5caf2e1
Reviewed-on: https://gerrit.chromium.org/gerrit/43297
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>
2013-02-14 14:03:28 -08:00
Julian Pastarmov
d605a005d6 Make policy reloads explicit.
BUG=chromium-os:38541
TEST=unit tests pass

CQ-DEPEND=I20461078ca890c6ec2f81ad5383c06c4d75a64cd

Change-Id: I042e9d1cfbefa479ff18c0b1bc170a15cec705bc
Reviewed-on: https://gerrit.chromium.org/gerrit/42538
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Julian Pastarmov <pastarmovj@chromium.org>
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
2013-02-05 09:45:39 -08:00
Luigi Semenzato
df3e4529ca Sends metrics to Chrome even when user did not consent to send stats.
BUG=chromium-os:21660
TEST=observed that Platform.* stats appear in about:histograms also when consent is turned off.

Change-Id: Id70f0cca468ec39fdfe687d89a6f0748a2a07828
Reviewed-on: http://gerrit.chromium.org/gerrit/10147
Commit-Ready: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
2011-10-21 01:08:26 -07:00
Julian Pastarmov
70b7abd84f Respect the metrics file if no policy value is set (for legacy migration).
BUG=chromium-os:18430
TEST=Update chromeos and check whether the consent for stats is preserved.

Change-Id: I86d4710ef9f381abd9f1eac728040878e6fc5b71
Reviewed-on: http://gerrit.chromium.org/gerrit/5139
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
2011-08-04 01:38:02 -07:00
Ken Mixter
b2f170970e Revert "Revert "Make the metrics library respect the policy settings instead of the consent file.""
This reverts commit aa91d046ac27a9bdc96e6cd9438741d98f1cef66

Change-Id: I1c84fb86d6eb56a5a8e88136c98104394be697b2
Reviewed-on: http://gerrit.chromium.org/gerrit/4614
Reviewed-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ken Mixter <kmixter@chromium.org>
2011-07-22 16:06:45 -07:00
Julian Pastarmov
a3df284fe1 Revert "Make the metrics library respect the policy settings instead of the consent file."
This reverts commit 8c874ca26dd0d07471cfc66ded527ad5c3a1cd20

Change-Id: Iaa91d046ac27a9bdc96e6cd9438741d98f1cef66
Reviewed-on: http://gerrit.chromium.org/gerrit/4583
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
2011-07-22 10:22:10 -07:00
Julian Pastarmov
ff3eb194b0 Make the metrics library respect the policy settings instead of the consent file.
BUG=chromium-os:17012
TEST=metrics_library_test

This is a second try at committing http://gerrit.chromium.org/gerrit/#change,3865

Change-Id: I8c874ca26dd0d07471cfc66ded527ad5c3a1cd20
Reviewed-on: http://gerrit.chromium.org/gerrit/4578
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
2011-07-22 09:16:40 -07:00
Ken Mixter
ec380e84c5 Revert "Make the metrics library respect the policy settings instead of the consent file."
This reverts commit 6a294b4a3e9aa69dc9c429ed398e9dd7615029f2

Change-Id: I7d80b119d4e2b880f75c2293770e073785764e7d
Reviewed-on: http://gerrit.chromium.org/gerrit/4509
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ken Mixter <kmixter@chromium.org>
2011-07-21 14:34:27 -07:00
Julian Pastarmov
a2ce30fdde Make the metrics library respect the policy settings instead of the consent file.
BUG=chromium-os:17012
TEST=metrics_library_test

Change-Id: I133b19a672f52d5ba4f150aa75d1b32af2896c3f
Reviewed-on: http://gerrit.chromium.org/gerrit/3865
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ken Mixter <kmixter@chromium.org>
2011-07-21 14:10:34 -07:00
Arkaitz Ruiz Alvarez
9f1a774c67 Determine guest mode status for metrics collection
Modification to the function IsGuestMode. It returns true only if the guestfs
partition is mounted and the file /var/run/state/logged-in exits. Previously
it did not check for this file existence.

BUG=chromium-os:15763
TEST=Log in in to guest mode right after installing recovery image and check
the absence of /home/chronos/prev_stats. Log out and log in as a user and
confirm the existence of this directory.

Change-Id: I7b0e7e8844332cca3fa67611b90fada3c5ba0eeb
Reviewed-on: http://gerrit.chromium.org/gerrit/1647
Tested-by: Arkaitz Ruiz Alvarez <arkaitzr@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
2011-05-26 13:32:41 -07:00
Arkaitz Ruiz Alvarez
4fdcf19a62 Determine guest mode status for metrics collection
Modification to the function IsGuestMode. It returns true only if the guestfs
partition is mounted and the file /var/run/state/logged-in exits. Previously
it did not check for this file existence.

BUG=chromium-os:15763
TEST=Log in in to guest mode right after installing recovery image and check
the absence of /home/chronos/prev_stats. Log out and log in as a user and
confirm the existence of this directory.

Change-Id: I29c66642ba590e882e6ec7a02732e818c87ac2ad
Reviewed-on: http://gerrit.chromium.org/gerrit/1586
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Arkaitz Ruiz Alvarez <arkaitzr@google.com>
2011-05-25 17:19:04 -07:00
Darin Petkov
8d3305eb92 libmetrics: Support partial writes.
BUG=chromium-os:11125
TEST=unit tests, tested on device

Change-Id: If9066988b86f61cb5bae413b7250d5426854f31b

Review URL: http://codereview.chromium.org/6592019
2011-02-25 14:19:30 -08:00
Darin Petkov
8842c8c42d libmetrics -- release the shared file lock when closing, handle EINTR.
BUG=chromium-os:11125
TEST=unit tests, tested on device

Change-Id: I126af62f77e4fd0f098d441038f8dc94c0020ac2

Review URL: http://codereview.chromium.org/6576048
2011-02-24 12:48:30 -08:00
Ken Mixter
be2e13b32b metrics: Send ability to notify chrome of system crashes
Change-Id: I11df903c020141a8123055620f9ad23fedc06c7d

BUG=9352
TEST=
1) UserCrash
2) Crash random process and verify Chrome indicates "other user" crashes
occurred in its stability UMA data.

Review URL: http://codereview.chromium.org/6211001
2011-01-22 06:15:56 -08:00
Darin Petkov
ed82485c3b Add support for user actions to the metrics library and the metrics clients.
BUG=10696
TEST=unit tests, tested on the device through metrics_client and inspecting
the uma-events file.

Change-Id: Ie39dd8b5ab968c328993076369a4ba14cb7fcd81

Review URL: http://codereview.chromium.org/6094010
2011-01-06 10:51:47 -08:00
Ken Mixter
eafbbdf3df metrics: Add guest mode detection to metrics library and client
Change-Id: I2c27bd999330395ba3568820ea76198b202bd7f4

BUG=7203
TEST=Verify metrics_client -c and -g toggling consent and guest mode.

Review URL: http://codereview.chromium.org/3571009
2010-10-01 15:38:42 -07:00
Ken Mixter
4c5daa4794 Add weekly crash counters, refactor metrics_daemon, respect opt-in in library.
BUG=5340,5814

Change-Id: I2c207055f1ebe48051193395e2dbe38d9140b025

Review URL: http://codereview.chromium.org/3171023
2010-08-26 18:35:06 -07:00
David James
3b3add5ad2 Cleanup style nits in metrics daemon.
- Remove trailing spaces.
- Convert 'char *' to 'char*'
- Fix other minor style nits
- Many of these issues were pointed out by tfarina.

BUG=none
TEST=Checked that it compiles and passes tests.

Review URL: http://codereview.chromium.org/2693001
2010-06-04 15:01:19 -07:00
Darin Petkov
11b8eb3cf1 Add metrics library tests. Some metrics daemon API cleanup.
Refactor the metrics daemon API a little so that we don't need
to link in libmetrics into the daemon test binary.

Review URL: http://codereview.chromium.org/2079007
2010-05-18 11:00:59 -07:00
Darin Petkov
21cd2c5a9f Remove the deprecated static metrics APIs.
Review URL: http://codereview.chromium.org/2037011
2010-05-12 15:26:16 -07:00
Darin Petkov
fc91b42a5e Start transition the metrics library to non-static API. Use gmock in tests.
Review URL: http://codereview.chromium.org/2049007
2010-05-12 13:05:45 -07:00
Darin Petkov
5b7dce1f60 Add support for linear/enumeration histograms.
Review URL: http://codereview.chromium.org/1747008
2010-04-21 15:45:10 -07:00
Darin Petkov
c2526a1265 Update the libmetrics API to match the new Chrome interface.
Review URL: http://codereview.chromium.org/1642018
2010-04-21 14:24:04 -07:00
Darin Petkov
4fcb2ac28f metrics cleanup and fixes.
- value is int now.
- add seconds to milliseconds option to metrics_client and use it
- chmod chronos/root fix
- style fixes

Review URL: http://codereview.chromium.org/1649007
2010-04-15 16:40:23 -07:00
Darin Petkov
65b0146839 Unify metrics_collection and metrics_daemon into metrics.
Tested new binaries on the target.
Tested incremental build.
Tested arm-generic build.

Review URL: http://codereview.chromium.org/1650006
2010-04-14 13:32:20 -07:00