Commit Graph

5745 Commits

Author SHA1 Message Date
Tej Singh
b83da8984f Merge "Update the default max pull delay to 30 seconds" into rvc-dev 2020-05-26 17:07:25 +00:00
Tej Singh
2eea973829 Update the default max pull delay to 30 seconds
Test: atest statsd_test
Bug: 154056912
Change-Id: If531db200a4d79eefaeefff60c86668f11d9439e
2020-05-21 17:12:41 -07:00
Robert Luo
82c49a95cd Merge "Add data collection and metrics for Media Output Switcher - 1/n" into rvc-dev 2020-05-21 14:56:53 +00:00
Mayank Garg
6a468598f0 Merge "Added more events to user switch journey" into rvc-dev 2020-05-21 08:22:01 +00:00
Robert Luo
2f52f04fdd Add data collection and metrics for Media Output Switcher - 1/n
Fixes: 147792668
Test: ./out/host/linux-x86/bin/statsd_testdrive Atom_ID
Change-Id: Ia2cff1d9150811e60a9d04025d090c28eec6980c
2020-05-20 22:01:17 +08:00
TreeHugger Robot
fe5aa41e27 Merge "Add unknown state in DataSubscriptionState enum" into rvc-dev 2020-05-20 09:01:26 +00:00
junyulai
8b794b7703 Add unknown state in DataSubscriptionState enum
Address ag/11439257 leftover comment

This change adds an unknown state in DataSubscriptionState
enum in order to pass server side compatability warning.

Besides, this change also address ag/11439257 leftover comment.

Test: build
Bug: 148905838
Bug: 129082217
Change-Id: Ib831832f2a24cf4c5ca64b078998fd93fed3793e
2020-05-20 11:30:24 +08:00
Mayank Garg
4f93a04a96 Added more events to user switch journey
Bug: 141388849
Bug: 146505521
Bug: 150788910
Test: statsd_testdrive 264 265
Change-Id: I9a770182706a5a9272c7b5d4fcc11f5f13020e0e
2020-05-19 14:48:27 -07:00
Christine Tsai
d7b08c7690 Merge "Change SimplePredicate InitialValue default to UNKNOWN" into rvc-dev 2020-05-19 20:30:00 +00:00
tsaichristine
70a7ee5f60 Change SimplePredicate InitialValue default to UNKNOWN
Previous default for InitialValue was FALSE. Currently, no predicates
configure this field.

Added unit tests to test the initial condition changes in Value and
Count metrics.
- ValueMetricE2eTest.TestInitialConditionChanges
- CountMetricE2eTest.TestInitialConditionChanges

Bug: b/156541904
Test: m statsd_test && adb sync data && adb shell data/nativetest/statsd_test/statsd_test
Change-Id: I242bcb0b60455355e699636aae7e620fabc310ef
2020-05-19 10:39:46 -07:00
TreeHugger Robot
1d867453ca Merge "add conversation flags to channel atom" into rvc-dev 2020-05-19 06:51:54 +00:00
Henry Fang
d026dffb65 Merge "Added 1st atom for Tuner Metrics" into rvc-dev 2020-05-19 02:44:27 +00:00
Ruchir Rastogi
56579cbcd4 Define BytesTransferByTagAndMetered atom
Test: m statsd
Bug: 144771940
Change-Id: Id78b173456d47e564994ef9b4bc8f74f8a4fa99d
2020-05-18 14:13:20 -07:00
TreeHugger Robot
10992382d1 Merge "[SM13] Create new atom for reporting data usage per rat and per sub" into rvc-dev 2020-05-18 20:54:41 +00:00
tsaichristine
9f951059bf Fix ValueMetric should only pull on real state changes
In ValueMetricProducer, we now map the new and old state values from
onStateChanged to their correct group ids (no mapping happens if the
metric has no state map). We then check if the group ids are the same
and return if they are. Having the same group id means that the state
values are in the same group and no pull is needed.

onStateChanged was updated to take state values stored in FieldValue
objects instead of as ints. This makes it easier to utilize the
mapStateValue function in MetricProducer.

Bug: b/156428844
Test: m statsd_test && adb sync data && adb shell
data/nativetest/statsd_test/statsd_test

Change-Id: Id8f110db593470b8923e7c4259d70cc5f5bc9147
2020-05-18 09:45:12 -07:00
junyulai
8d1a609a92 [SM13] Create new atom for reporting data usage per rat and per sub
Currently, modify MobileBytesTransfer(ByFgBg) to add dimension
for rat type and subscription is not backward compatible since
callers might expect a complete statistics in a metrics with
specific uid.

Hence, create a new atom to report data usage per rat and per
subscription.

Test: build
Bug: 148905838
Bug: 129082217

(cherry-picked from ag/11439257)
Merged-In: Id1c8673d92038552c2393b017f5723fd5c79ab45
Change-Id: Id1c8673d92038552c2393b017f5723fd5c79ab45
2020-05-18 17:35:02 +08:00
TreeHugger Robot
c20fcfeeff Merge "Don't create StateTrackers for whitelisted atoms" into rvc-dev 2020-05-16 03:39:38 +00:00
Muhammad Qureshi
b1eee0beab Don't create StateTrackers for whitelisted atoms
Whitelisted atoms can be logged from any app so integrity of StateTrackers
for those atoms cannot be guaranteed.

Fixes: 155522551
Test: statsd_test
Change-Id: Ifc64e9168ee5f1f8977b99534319bc65946630f0
2020-05-15 19:13:56 -07:00
TreeHugger Robot
e688c64bf7 Merge "Add whitelisted atom ids to StatsdConfig" into rvc-dev 2020-05-15 21:28:27 +00:00
Chris Wren
07cb6a4b23 add conversation flags to channel atom
Bug: 156359915
Test: atest PreferencesHelperTest
Change-Id: I29637fa1a2b991fbe521c9077d3e8d62ebf3bca7
2020-05-15 16:37:51 -04:00
TreeHugger Robot
877b5b2196 Merge "Fix bug in statsd_test" into rvc-dev 2020-05-15 19:59:16 +00:00
Ruchir Rastogi
3ed0f13fe0 Merge "Display wake reason atom" into rvc-dev 2020-05-15 19:55:34 +00:00
Muhammad Qureshi
f681646d82 Add whitelisted atom ids to StatsdConfig
Get whitelisted atom ids from StatsdConfig which can be logged from any
uid.

Fixes: 155521934
Test: statsd_test
Change-Id: Ib2db310d1cd8479d4996e70ac09d40e8dc45af48
2020-05-15 12:54:02 -07:00
Evan Rosky
bddd280556 Merge "Add a window dump for uiautomator" into rvc-dev 2020-05-15 18:15:36 +00:00
Tej Singh
1c2db28d33 Fix bug in statsd_test
Test was calling write instead of release

Test: atest statsd_test
Bug: 155438557
Change-Id: I13fc7ed8fad936e9f21d07dd0cd75c641153fead
2020-05-14 20:08:17 -07:00
Tej Singh
b16d28f239 Merge "Statsd: pull once per event time" into rvc-dev 2020-05-15 02:59:26 +00:00
Wenjie Zhou
ad24e49e2f Merge "mCallback defined in BringYourOwnSection should be an object instead of a reference." into rvc-dev 2020-05-15 02:06:30 +00:00
Henry Fang
e316ab61e6 Added 1st atom for Tuner Metrics
Metrics review request b/155199791

This Cl follows up http://ag/c/11203604/8

bug: 154661158
Test: Manual
Change-Id: I7d41a71c724b7f5395d213dc63000739e55b4a43
2020-05-15 00:16:33 +00:00
Wenjie Zhou
751c7c947a mCallback defined in BringYourOwnSection should be an object instead of a reference.
The referenced object could be destroyed and result in native crash when
mCallback is used.

Bug: 156536687
Test: manual test with registering a section from an app
Change-Id: Ie36c0e6e64be1246539f12999f037c24377686dd
2020-05-14 15:24:39 -07:00
Denny cy Lee
57b31283de Display wake reason atom
Cherry-pick from master to rvc-dev.

Bug: 150519505
Test: m statsd
Change-Id: I44aaa3e2293b8ea956180bce3e1fc854a4d0bca7
Merged-In: I44aaa3e2293b8ea956180bce3e1fc854a4d0bca7
Signed-off-by: Denny cy Lee <dennycylee@google.com>
(cherry picked from commit e6d42a42b4)
2020-05-14 10:18:06 -07:00
Zhen Sun
fcaca1bc15 Update TvSettingsUIInteracted atom
This CL removes the string field from the TvSettingsUIInteracted atom to
eliminate the risk of logging sensitive information by accident. This
change should be safe as no such log has been uploaded to Google server
yet.

Besides the change to the atom, this CL also made some corresponding
change to the enum file so fill in the information that was collected
using a string.
(This CL is a mirror of cl/310419842 to Android repo.)

Metrics council review bug: 151768952
Bug: 150979527
Test: the Android tree still builds normally

Change-Id: I8a9d8c95ec06eaa2cbe097efe652e18d0e7baeac
2020-05-14 00:21:21 +00:00
TreeHugger Robot
b7ba8ed645 Merge "Annotate ChargingStatus as a state atom." into rvc-dev 2020-05-13 22:28:50 +00:00
Kweku Adams
301f754b9d Annotate ChargingStatus as a state atom.
Charging status is different from plugged status and can be used as a
state for certain metrics.

Bug: 140496920
Bug: 143495340
Bug: 145838040
Test: bit statsd_test:*
Change-Id: I1ef41191588b6d26346323203dabe488d488c131
2020-05-13 13:10:34 -07:00
Tej Singh
7b975a85db Statsd: pull once per event time
If a pull happens at the same event time, we should reuse the existing
data, regardless of whether or not the cool down has been met. For
example, if an app upgrade happens at time t, and two metrics need to
pull atom a, if metric one pulls at time t, but metric two initiates the
pull at time t+2, we should still reuse the pull from time t since that
is when the app upgrade happened.

Bug: 156294650
Test: atest statsd_test

Change-Id: I4efc49545093f6683bf6dd89ed68c5dfa5b44d8f
2020-05-13 01:50:24 -07:00
Muhammad Qureshi
a3461a2d4a Merge "Use ASSERT_EQ for size assertions." into rvc-dev 2020-05-13 02:08:11 +00:00
Muhammad Qureshi
dff78d6240 Use ASSERT_EQ for size assertions.
This fixes tests halting when accessing invalid indices.

Fixes: 156373877
Test: statsd_test
Change-Id: Ia2a9d7c71228e84467607e1485dbec33e8e6a094
2020-05-12 09:56:37 -07:00
Ruchir Rastogi
18fb866de9 Merge "Use default LogEvent copy constructor" into rvc-dev 2020-05-12 16:42:28 +00:00
Robert Lee
80dcec801d Merge "Add new atom for AudioPowerUsage" into rvc-dev 2020-05-12 08:09:37 +00:00
TreeHugger Robot
8683e2eeba Merge "Log inotify errors." into rvc-dev 2020-05-12 04:44:43 +00:00
Ruchir Rastogi
31739e5f71 Use default LogEvent copy constructor
This prevents subtle bugs from being introduced when more member
variables, such as annotations, are added to LogEvent.

Test: m statsd
Test: atest statsd_test
Test: atest GtsStatsdHostTestCases
Bug: 156312371
Change-Id: Ibb5366e8658d6c99e5730b4bc301190655bbd245
2020-05-11 19:46:58 -07:00
Robert Lee
cccdc155f5 Add new atom for AudioPowerUsage
Test: builds
Bug: 121318157
Bug: 152714440

Change-Id: Ic35db236a0d5c39e62f1a4d750c8d3fd683c3906
2020-05-12 09:30:09 +08:00
Dan Sandler
562d46d592 Log inotify errors.
Bug: 155954661
Test: boot
Change-Id: Ic054ecf6acebba12485926b66d4fb96fa7712547
2020-05-11 17:09:22 -04:00
Changyeon Jo
51ae358b87 Add new atom for EVS usage statistics
This change adds EvsUsageStatsReported that contains various usage
statistics collected by EVS service.

Bug: 153236752
Test: $ANDROID_HOST_OUT/bin/statsd_testdrive 274 after allowing
      AID_AUTOMOTIVE_EVS to log
Change-Id: I99fe24d7679678e8bb3fa779f299f253a9e703f0
2020-05-11 09:03:36 -07:00
Nate Myren
e8f912bbb5 Add new atoms for auto revoke
Added new atoms for auto revoke logging

Test: manual
Bug: 154650244
Change-Id: Ifdc291c24f249b275b435495fcd3c73db089adbc
2020-05-11 09:47:28 +08:00
Jonathan Nguyen
8d8ff53c41 Add App Usage atom to atoms.proto
Test: m -j
Bug: 156041159
Change-Id: Ie0fd99df5b1d8776b6e3c29f7fb2da4759bb465d
Merged-In: Ie0fd99df5b1d8776b6e3c29f7fb2da4759bb465d
(cherry picked from commit ee7dd8f2b2)
2020-05-08 10:44:20 -07:00
Ruchir Rastogi
ca7fc3be0f Merge "Fix ShellSubscriber concurrency issues" into rvc-dev 2020-05-07 23:22:56 +00:00
Hyunyoung Song
a07377d529 Merge "Setup default annotation to reduce byte size for launcher related atoms" into rvc-dev 2020-05-07 09:02:43 +00:00
Ruchir Rastogi
1e24051604 Fix ShellSubscriber concurrency issues
This CL creates a sendHeartbeat thread that ocassionally sends
heartbeats, consisting of a dataSize of 0, to perfd. perfd will discard
those heartbeats, recheck if the user has canceled the subscription, and
if not, wait for more data from statsd. Sending heartbeats solves two
big problems:

(1) Allows statsd to robustly check if writes to the socket fail because
the read end of the pipe has closed. Previously, if no atoms were pushed
or pulled, statsd never attempted to write to perfd, so statsd could
never detect the end of the subscription. However, now, writes are
regularly made regardless of if statsd receives data. Note that even if
atoms were pushed or pulled, there is no guarantee that they would have
matched the atom matchers sent in perfd's config.

(2) Allows perfd to escape a blocking read call and recheck whether the
user has canceled the subscription. If no data is sent to perfd, perfd
will block in this read call and the AndroidStudio UI will freeze up.

Heartbeats are only sent if statsd has not sent any data to perfd within
the last second, so we do not spam perfd with writes.

+ decomposes the startNewSubscription function
+ prevents startPull from holding the lock while sleeping

Test: atest stastd_test
Test: atest CtsStatsdHostTestCases
Test: manually confirm that AndroidStudio is not freezing
Bug: 153595161

Change-Id: I78f0818e8ed29bdadd02c151444ee7c9555623a4
2020-05-06 19:52:16 -07:00
Tej Singh
6dfbdb3e2f Merge "Fix statsd NPE on setPullAtomCallback" into rvc-dev 2020-05-06 22:11:02 +00:00
Ruchir Rastogi
76994e73a7 Merge "Handle race conditions in SCS when statsd dies" into rvc-dev 2020-05-06 22:10:42 +00:00