Commit graph

74 commits

Author SHA1 Message Date
Eric Shienbrood
1135355246 Update metrics_library.h to find scoped_ptr.h in <base/memory>.
This is in preparation to the move to a newer libchrome, where
scoped_ptr.h no longer appears in base, just in base/memory.

BUG=chromium-os:16623
TEST=Do the emerge, and then examine /usr/include/metrics/metrics_library.h

Change-Id: I95cd9b52eee216316dd8ea21ecb84101d7a95edf
Reviewed-on: https://gerrit.chromium.org/gerrit/17073
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Eric Shienbrood <ers@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
2012-02-29 13:42:14 -08:00
Elly Jones
4abef11971 [metrics] use libchromeos.pc
BUG=chromium-os:24959
TEST=build

Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/14012
Reviewed-by: Mike Frysinger <vapier@chromium.org>
(cherry picked from commit 0ea8151d4628ccf500da82206384b8b492a95a0b)

Change-Id: I0c51d49cc7182a19b16d3cb123c43e29be890cbe
Reviewed-on: https://gerrit.chromium.org/gerrit/14505
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Ready: Elly Jones <ellyjones@chromium.org>
Tested-by: Elly Jones <ellyjones@chromium.org>
2012-01-19 14:29:20 -08:00
Scott James Remnant
f53e106bbb Revert "[metrics] use libchromeos.pc"
This reverts commit 6ed1d63d859c37e5a3290d4786862d46927aa5c2

Change-Id: If32cadcdb918f66c9cfada8809f2001122a35d69
Reviewed-on: https://gerrit.chromium.org/gerrit/14118
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Tested-by: Scott James Remnant <keybuk@chromium.org>
2012-01-12 18:00:47 -08:00
Elly Jones
8df4995721 [metrics] use libchromeos.pc
BUG=chromium-os:24959
TEST=build

Change-Id: I7038f5173c7b0949cbf88e6a9213d75e96ae142d
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/14012
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2012-01-12 12:26:58 -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
Luigi Semenzato
5bd764faf3 Add page fault statistics.
BUG=chromium-os:20624
TEST=observe that Platform.PageFaultXXX appear in about:histograms.

Change-Id: Ifc281d31e05102dc4133d133f732b737e19891f1
Reviewed-on: http://gerrit.chromium.org/gerrit/10143
Commit-Ready: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
2011-10-18 12:12:16 -07:00
Bruno Rocha
e3bdf0f559 Fixed wrong method signatures in TimerReporterMock.
TimerReporterMock had some wrong method signatures, and was lacking signatures
for its accessor methods.

BUG=chromium-os:18800
TEST=None

Change-Id: I08d832857c1ae3df907f5470433117f7a03fe125
Reviewed-on: http://gerrit.chromium.org/gerrit/6230
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Bruno Pontes Soares Rocha <bpontes@chromium.org>
Tested-by: Bruno Pontes Soares Rocha <bpontes@chromium.org>
2011-08-22 13:07:28 -07:00
Bruno Rocha
be388f301b Added a timer-based report to the metrics library.
Timer encapsulates a timer with basic functionality.
TimerReporter subclasses it for also sending UMA reports.

BUG=chromium-os:18800
TEST=Unit test 'timer_test' has been included

Change-Id: I9de9a2a7388721ba1476fe706a8d12788d2176ad
Reviewed-on: http://gerrit.chromium.org/gerrit/5161
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Bruno Pontes Soares Rocha <bpontes@google.com>
Reviewed-by: Bruno Pontes Soares Rocha <bpontes@google.com>
2011-08-17 14:43:56 -07:00
Julian Pastarmov
0e5debf2d5 Fixed a test where a method was expected to be called but it wasn't.
A recent optimization in the code made that second call unneeded as so
our expectation is not met anymore (for good so).

BUG=chromium-os:18430
TEST=Metrics unit tests should pass.

Change-Id: I1162dc657156ee9207b904ab544b0f151eec0453
Reviewed-on: http://gerrit.chromium.org/gerrit/5302
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
2011-08-04 02:17: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
Luigi Semenzato
8accd33d92 Add memuse stats and fix disk I/O computations.
This changes adds memory usage stats after 1  5, 30, 150, and 750
minutes of active use (approximated by wall
clock time minus sleep time).  We log only the anonymous memory
usage (active + inactive) as we expect that other types of
allocations would not convey much additional information.

This also fixes the disk I/O computation to use actual active
time elapsed between callbacks, instead of assuming the expected
interval has elapsed.  The existing code causes errors in
both directions when a suspend/resume cycle occurs between callbacks.

BUG=14209
TEST=verify that about:histograms page contains Platform.MemuseAnon1 after 1 minute and Platform.MemuseAnon2 after 5 minutes.

Change-Id: Ib32d915fac7766a9fca7125105224889ea93050e
Reviewed-on: http://gerrit.chromium.org/gerrit/1132
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
2011-05-23 15:06:49 -07:00
Darin Petkov
b7780ce4a4 Remove obsolete hardware_class script.
BUG=chromium-os:15257
TEST=emerge-x86-mario metrics

Change-Id: I496121c47394dc81b7f414655940dddc8d5cc992
Reviewed-on: http://gerrit.chromium.org/gerrit/1314
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
2011-05-23 12:34:31 -07:00
Chris Masone
817016a81f [metrics] Roll forward to new libchrome
BUG=chromium-os:14304
TEST=build, unit tests

Change-Id: I92fd96b2c14df847efe47735c0f76d99023ec254
Reviewed-on: http://gerrit.chromium.org/gerrit/819
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
2011-05-14 11:09:36 -07:00
Darin Petkov
8032dd0c6f metrics: Fixed compile-time warnings due to unused variables.
BUG=chromium-os:15040
TEST=built with gcc-4.6

Change-Id: Idf95c986e1eda79be735eeb4ff7c79e9a7eede60
Reviewed-on: http://gerrit.chromium.org/gerrit/569
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
2011-05-10 10:19:45 -07:00
Luigi Semenzato
29c7ef9e6a Add meminfo UMA collection.
Change-Id: Ief779a5bdc68b8e5bf2f1ed979bf30b50aca8e0f

BUG=chromium-os:13747
TEST=verify that Platform.Meminfo* entries are in about:histograms.

Review URL: http://codereview.chromium.org/6804014
2011-04-12 14:12:35 -07:00
Luigi Semenzato
0f132bba6f Find device-dependent disk stats file, and skip disk stats if not available.
Change-Id: I03afb85e3357dd4c2cf5effd98b194c71d77c71d

BUG=12171
TEST=unit tested

Review URL: http://codereview.chromium.org/6541007
2011-02-28 11:17:43 -08: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
Luigi Semenzato
c88e42dea9 Collect some disk statistics.
Change-Id: Id30f4b7e5d121f2632592ebacf47a18ea1d89fec

BUG=chromium-os:12171
TEST=ran on target and observed that stats are generated

Review URL: http://codereview.chromium.org/6486021
2011-02-17 10:21:16 -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
Daniel Erat
6c35d7c1b6 metrics: Update comment about adding user actions.
This points people at chrome/tools/extract_actions.py,
where new actions can be registered without needing to
modify C++ code (once http://codereview.chromium.org/6266011/
is committed).

Change-Id: If7ceaa38939ab9c1594aacd999e0ec86c4541d41

BUG=chromium-os:10696
TEST=none

Review URL: http://codereview.chromium.org/6320009
2011-01-21 11:25:45 -08:00
Daniel Erat
ca90d8b40b metrics: Add SendUserActionToUMA() to MetricsLibraryMock.
The metrics daemon doesn't support sending user actions, but
I need this exposed through the mock library so I can use
SendUserActionToUMA() in the power manager.

Change-Id: Ie9e3995df9978768477fe46dcb9ebec4d1fff1d5

BUG=chromium-os:10696
TEST=built for x86-mario with FEATURES=test; checked that the power manager can now use SendUserActionToUMA()

Review URL: http://codereview.chromium.org/6130003
2011-01-06 15:46:00 -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
Daniel Erat
b9b05e6047 metrics: Update tests to send user in session state change.
This updates the signal to match the changes that I'm making
in http://codereview.chromium.org/4718001/show.

Change-Id: Id414187a62f209f2e8145c75bfd982b357d04e98

BUG=chromium-os:8123
TEST=ran it

Review URL: http://codereview.chromium.org/4749001
2010-11-09 12:18:51 -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
Darin Petkov
fd55798dc0 Metrics: Update README to reflect recent changes.
The updates include:

- Mention the need for "Consent To Send Stats" to exists and the new
AreMetricsEnabled API.

- Replace wiki with XML references (need to add an internal only document
somewhere too).

- Reformat to take full advantage of 80-character lines.

BUG=none
TEST=none

Change-Id: Idbe06e70d5d15f1f8dbbb9475f38a1b0becbca32

Review URL: http://codereview.chromium.org/3573007
2010-10-01 15:11:44 -07:00
Chris Sosa
dd6a8db06e Remove blank tracking script.
Change-Id: Iffe8e4233a3f7c100d44502baffdc9515cbdf426

BUG=5905
TEST=Emerged metrics package

Review URL: http://codereview.chromium.org/3597004
2010-09-30 16:39:32 -07:00
Ken Mixter
e4fb0af5c5 Deprecate libcrash.a
Change-Id: Ic8dd69478bcc32908c47ed38f61534fefb8e053d

BUG=5870
TEST=build_packages

Review URL: http://codereview.chromium.org/3413005
2010-09-14 18:09:20 -07:00
Sam Leffler
239b826808 remove TimeToDrop support
Now that flimflam has native support this can be purged.

TEST=run FEATURES=test emerge-x86-generic metrics; verify TimeToDrop is still being recorded w/ about:histograms/Network

Review URL: http://codereview.chromium.org/3233004
2010-08-30 08:56:58 -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
Ken Mixter
ccd84c03d2 Add # daily crashes metrics and separate kernel crashes out.
BUG=5340

Review URL: http://codereview.chromium.org/3181015
2010-08-16 19:57:13 -07:00
Chris Masone
3fd74748a7 [metrics] Fix tests after libbase roll broke them
Change-Id: Ie26189e05b8aaa637614ed098d8b215c6a436216

Review URL: http://codereview.chromium.org/3138013
2010-08-12 12:19:25 -07:00
J. Richard Barnette
9ce4fa3f60 Add LICENSE file 2010-08-05 14:13:48 -07:00
Darin Petkov
6c0260a1bd Link libcrash conditionally.
This enables building metrics for the host thus enabling using metrics
in the current update_engine without breaking the host dev flow.

BUG=4852
TEST=emerged with and without USE=-crash

Review URL: http://codereview.chromium.org/3032004
2010-07-19 10:54:27 -07:00
Chris Sosa
07ae1f87ca Remove generate_logs since it's been moved to workarounds in issue 2861045
TEST=Emerged metrics and workarounds after change.

Review URL: http://codereview.chromium.org/2978006
2010-07-13 16:14:27 -07:00
Darin Petkov
1c2b4c8125 Use the HWID from the firmware as the hardware class, if available.
BUG=3089
TEST=gmerge'd on device, ran with and without an hwid file.

Review URL: http://codereview.chromium.org/2824039
2010-06-30 10:30:27 -07:00
Darin Petkov
d2f284bfe2 Add crash reporting to metrics_daemon.
BUG=none
TEST=unit tests,gmerge'd on device, verified it runs OK, pkill -SEGV generated minidump.

Review URL: http://codereview.chromium.org/2806043
2010-06-30 09:47:16 -07:00
Darin Petkov
38d5cb09ef Log active use time between kernel crashes.
Also, initialize the network state from flimflam, just in case -- now
that the metrics daemon process starts a bit late,

BUG=none
TEST=unit tests, ran on the device, emerged arm-generic

Review URL: http://codereview.chromium.org/2864009
2010-06-24 12:10:26 -07:00
Darin Petkov
cd8c317453 Readability review.
Review URL: http://codereview.chromium.org/2729018
2010-06-24 10:13:54 -07:00
Darin Petkov
c2bf95fd8b Update libmetrics docs to cover some recent questions and issues.
Review URL: http://codereview.chromium.org/2828017
2010-06-21 16:27:52 -07:00
Darin Petkov
32e1df9d6c Update the README to mention that a C API is also available.
Review URL: http://codereview.chromium.org/2819008
2010-06-17 17:05:06 -07:00
Sam Leffler
10b301da57 add C wrapper for libmetrics
TEST=unit tests + build&test crosmetrics plugin for flimflam

Review URL: http://codereview.chromium.org/2832008
2010-06-17 14:22:43 -07:00
Darin Petkov
1bb904ed4d Measure and report time between user-space process crashes.
BUG=none
TEST=unit tests, gmerged on the device and inspected
logs, about:histograms,etc.

Review URL: http://codereview.chromium.org/2736008
2010-06-16 15:58:06 -07:00