Commit Graph

846 Commits

Author SHA1 Message Date
Chenjie Yu
12e5e6755f use custom Parcel format to pull data
When statsd pulls data from StatsCompanionService, the data is put into
log_msg format on java side and expanded into LogEvent on cpp side.
There is a lot of dependency on log_msg and liblog to add new types.
There is pending bug to rewrite thta part of the code in statsd to
completely rid the legacy of logd and liblog. But that may not happen
soon.

Now we can support new storage type.
Also no need to specify number of fields in StatsLogEventWrapper cstr,
which is a source of bug in P.

Bug: 115775035
Test: manual test and cts test
Change-Id: Id1f0b033885da6f3bcebe043968061821db48f35
2018-09-18 16:29:52 -07:00
Tej Singh
2f7ff07d29 Merge "FingerprintStats Westworld Migration" 2018-09-18 18:41:18 +00:00
Tej Singh
d6d6d77437 FingerprintStats Westworld Migration
Adds 4 fingerprint atoms: NumFingerprints,
FingerprintAcquired, FingerprintAuthenticated, and
FingerprintErrorOccurred. Right now, these should have a 1-1 mapping
with dumpsys fingerprint. More acquire and error codes can be added
pending Metrics Council approval.

Note: I do not know how to test crypto fingerprints,
Note: Most of the logging likely fits better in BiometricService, but
given that it shares code with FaceService and we do not have approval
to log FaceService, I had to put the logic in FingerprintService.

Bug: b/113129470
Bug: b/113129210
Bug: b/113128442
Bug: b/72342203

Test: manually tested adding fingerprints and acquire/accept/reject/lockout with multiple users
Test: will make cts test

Change-Id: Ia8ca703bd4090f0f3612c6415785288517073117
2018-09-17 15:18:21 -07:00
Bookatz
c77b02028e Merge "Unifying source of statsd BleScan calls and cleaning it up." am: 056a095dd3 am: 7ed0147613
am: 18852e3636

Change-Id: Ifcc5f22a921f6f4d50eb47a329aa2e3db61410ef
2018-09-17 14:59:41 -07:00
Marcin Oczeretko
3f2486de70 Merge "Prepare LooperStats to be collected as a Westworld gauge matric" 2018-09-17 20:40:17 +00:00
TreeHugger Robot
7db3ae4f31 Merge "Statsd atoms: BatteryVoltage" 2018-09-17 19:35:34 +00:00
Bookatz
17f0d8a88f Statsd atoms: BatteryVoltage
Add battery voltage to statsd as a pulled atom.

Bug: 114451845
Test: run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.HostAtomTests#testBatteryVoltage

Change-Id: If40ed41663b57ad6144c69c52c4c63562f93c774
2018-09-17 09:57:24 -07:00
Marcin Oczeretko
3e6494eb3e Prepare LooperStats to be collected as a Westworld gauge matric
- call LooperStats.reset() from StatsCompanionService
- add screen_interactive to the LooperStats atom
- temporarily set uid = 1000 to avoid statsd warnings that the uid is invalid

Bug: 113651685
Test: Manual and UTs
Change-Id: Iacf45fcb746c6bb9837456a2a0c74f5a073ff822
2018-09-17 17:25:55 +01:00
Olivier Gaillard
97098f0c5e Merge "Reset the data when pulled by statsd in order to swtich from value metric to gauge metric." 2018-09-14 23:02:56 +00:00
TreeHugger Robot
c8d33b39c0 Merge "Log the thermal throttling event to enable conditional temperature pulling." 2018-09-14 04:37:36 +00:00
TreeHugger Robot
0e93f74d91 Merge "statd: change thermal Polling interval to 1s" 2018-09-14 02:18:06 +00:00
Yangster-mac
e16189afca Log the thermal throttling event to enable conditional temperature pulling.
Test: statsd test

BUG: b/112432890

Change-Id: If132bab9690043a9e3e89187dfb1a9ed8fd0c996
2018-09-14 00:54:15 +00:00
Wei Wang
f0f0117fcc statd: change thermal Polling interval to 1s
mCoolDown is ns, changing to match others.
Note: actual polling is controlled from server side, this is only to
change device side cooling down threshold.

Test: Build
Bug: b/112432890
Change-Id: If709e0457ea3f170a40229bac0fd3252c93ad1f3
2018-09-13 16:37:56 -07:00
Bookatz
ae6738ed2a Unifying source of statsd BleScan calls and cleaning it up.
Bug: 80308558
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases
Change-Id: I0b4a0b56631b4354b73f0fafea2c0dc7dff248d1
2018-09-13 18:48:10 +00:00
Olivier Gaillard
d25f7a887f Reset the data when pulled by statsd in order to swtich from value
metric to gauge metric.

Test: unit test
Change-Id: Idecc0ccfb3ccde1680b2394fb479ae6f7f2cfac2
2018-09-13 15:57:38 +01:00
TreeHugger Robot
07d7baf36c Merge "statsd events/gauge: remove WallClockTime" 2018-09-12 21:43:03 +00:00
TreeHugger Robot
ebe5626d8b Merge "statsd atom: add WallClockTimeShifted" 2018-09-12 21:37:42 +00:00
Chenjie Yu
159e4f8f46 allow use of atom definition outside of atoms.proto in pulled atoms
There will be followup cls to add support of new types that can be
nested and repeated.
+ skip StatsLog.write signature generation for pulled atoms.

Bug: 113872139
Test: manual test
Change-Id: I69d0ee0b2fe8e286e48eac20ec2c8b280c477bf0
2018-09-10 18:26:33 -07:00
TreeHugger Robot
b299070edf Merge "Remove dimension fields in GaugeMetric output" 2018-09-10 17:47:30 +00:00
Adam Bookatz
76f4a95675 Merge "Statsd: fix comment of logsource in atoms.proto" 2018-09-09 15:54:26 +00:00
Gopinath Elanchezhian
73e0854f72 Merge "Add statsdprotolite in Android.bp" 2018-09-08 04:12:16 +00:00
TreeHugger Robot
8a903bdb33 Merge "Interface of writing key value pair atom to socket and parsing from statsd." 2018-09-08 03:24:26 +00:00
Bookatz
56585cade4 Statsd: fix comment of logsource in atoms.proto
KernelWakeupReported is logged from a different location than the one
currently stated. This fixes this.

Test: none; just a comment.
Change-Id: I06b36969e695d7d1e16d9bd3e8ce535c15eb1c17
2018-09-07 11:38:45 -07:00
Yangster-mac
e124e42582 Interface of writing key value pair atom to socket and parsing from statsd.
Test: statsd unit test
BUG: b/114231161

Change-Id: I3543900934b5e8e0677bf1e7cc454d61064a2475
2018-09-07 11:09:37 -07:00
TreeHugger Robot
59c1d01b85 Merge "Revert "Revert "DiskStats Westworld Migration""" 2018-09-07 17:24:28 +00:00
TreeHugger Robot
77f45d4d5c Merge "Log deferred job stats." 2018-09-07 03:31:52 +00:00
Tej Singh
86dc9dba06 Revert "Revert "DiskStats Westworld Migration""
This reverts commit 6188aa3294.

Reason for revert: ag/4819964 has now been submitted. undoing the roll back.
Test: revert
Test: manually verified output is the same as diskstats.

Change-Id: I9a3292f66e1e28661e1d29f3befd002073b681c1
2018-09-06 10:32:01 -07:00
Bookatz
7948c8737f statsd atom: add WallClockTimeShifted
In ag/4888395 we get rid of wall-clock time from EventMetrics because it
is very RAM-costly. If someone needs the wall-clock time, they can get
it from this atom instead. This way, the wall-clock time is only stored
when interesting, instead of every single event!

Bug: 113072343
Test: manual confirmation that it works
Change-Id: I10c26a4fc9c73b29233108ef1fc0e9797382a8df
2018-09-06 10:26:37 -07:00
Yangster-mac
96353008d9 Log deferred job stats.
Test: statsd tests

BUG: b/113353829
Change-Id: If0c07f5c1baccf831fea39982b25b64b6fc88001
2018-09-05 17:33:07 -07:00
Josh Gao
3077025818 Merge "statsd: fix double close." am: 0b8f17b3ba am: 6547dad5ac
am: 86b0140271

Change-Id: I0377db4c1e5343355882e1cfea94d7e4d04159d1
2018-09-05 13:12:54 -07:00
Marcin Oczeretko
f1d4563acd Merge "Collect telemetry data for System Server Loopers." 2018-09-05 19:12:45 +00:00
Bookatz
fe2dde8184 statsd events/gauge: remove WallClockTime
EventMetricData stores wall_clock_timestamp_nanos.
It is expensive, costing 10 bytes per event and evidently not needed.
Similar for GaugeMetricData.

Bug: 113072343
Test: make -j8 statsd_test && adb sync data && adb shell data/nativetest64/statsd_test/statsd_test
Test: run cts-dev -m CtsStatsdHostTestCases
Test: Manually confirm that events/gauges don't have wallclock
Change-Id: Iae978a434354c049e1fa61d42536be981c862b4f
2018-09-05 10:53:33 -07:00
Josh Gao
3330d1208f statsd: fix double close.
Previously, fdopen was being called on a file descriptor that was owned
by a unique_fd without releasing. This leads to a double close, since
both fclose and the unique_fd destructor will try to close the fd.

Bug: http://b/113880863
Test: treehugger
Change-Id: I6f6f48d304861b5e4d7efee0d3ad0e30178a95a4
2018-09-04 11:12:04 -07:00
Marcin Oczeretko
d8cc8593c0 Collect telemetry data for System Server Loopers.
Adds LooperStats and LooperStatsService which set a static
Looper.Observer to record the count of dispatched messages and
cpu/latency information. The aggregated stats are collected by
Westworld as pulled atoms.

The collection is disabled by default and requires a manual call to
enable:

adb shell cmd looper_stats enable

Test: Unit tests and tested manually that the collected data seems
reasonable.

Change-Id: I7162fbca4e324f62887f95df3405205cbe4416ca
2018-09-03 16:06:06 +01:00
TreeHugger Robot
f75320d841 Merge "Add an enum file for stats event" 2018-09-01 04:21:20 +00:00
Adam Bookatz
cb0fba36aa Merge "statsd: add Vibrator atom" 2018-08-31 23:31:05 +00:00
Howard Ro
0546d54fb4 Add an enum file for stats event
The list of events in this file is meant to be used with Generic Atom
defined in atoms.proto in statsd. Instead of unique int, we would like
to log it with an enum that shows semantic meaning of events. Also, this
change re-sorts imports and removes unused imports and remove the
previous logging line to test GenericAtom.

Test: statsd_test
Change-Id: Ia9335e48ada68bee6d716ad4d7ac50238932da95
2018-08-31 16:21:28 -07:00
Howard Ro
e60992b873 Fix a typo in StatsService
Test: I can promise that this change doesn not cause further breakage.

Change-Id: I7964fa2bfa6ad6b7e56fce0867ab6fdda9a24922
2018-08-30 14:38:46 -07:00
Bookatz
a7020bd9d0 statsd: add Vibrator atom
Adds VibratorStateChanged atom.

Test: run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testVibratorState
Bug: 113352975
Change-Id: I7b2b80d6f13306d5b60e17c5c143e0c687718369
2018-08-29 12:47:11 -07:00
Tej Singh
f156ea7353 Merge "Revert "DiskStats Westworld Migration"" 2018-08-29 17:15:17 +00:00
Tej Singh
6188aa3294 Revert "DiskStats Westworld Migration"
This reverts commit f154cf0189.

Reason for revert: Temporary rollback to allow ag/4819964 to go into pi-dev (and into master).

Change-Id: I607ec64aa9da3b0b1adf49bd361f9ed4927dba05
2018-08-29 00:21:07 +00:00
Tej Singh
008ecd3de0 Merge "DiskStats Westworld Migration" 2018-08-27 18:58:06 +00:00
gopinath
a9864fdcd3 Add statsdprotolite in Android.bp
Bug: b/113069884

Test: Successfully able to build.
Change-Id: I857957e816506162496192fe0ad1da4dbdfd4efd
2018-08-23 12:36:19 -07:00
Yao Chen
0f5d661803 Add more accurate logging for stats log loss.
+ Only record eventual failure after the retries to get a accurate log loss count.
+ Record all types of failures which lead to log loss
+ Change the timestamp from elapsedRealtime to wallclock time for easier debugging server side
+ Also log the count too.

Bug: 80538532
Test: manually tested

Change-Id: I4fcccae3fa39c9e280a842e27c6432bb0a090b85
2018-08-22 14:21:42 -07:00
Chenjie Yu
4c31f67965 Remove dimension fields in GaugeMetric output
GaugeMetric output is atom format and can contain all fields including
those already included in dimensions.
This is not necessary and duplicate.
And, if we do set dimensions, we can use this to reduce data size
similar to repeated fields, where same dimension value only appear once.

Bug: 113061955
Test: unit test
Change-Id: I299bd1cb1b9b90ea7426ef182df78d2ffc091910
2018-08-22 14:14:02 -07:00
Tej Singh
f154cf0189 DiskStats Westworld Migration
Migrates the existing information collected by diskstats to westworld.
Creates 4 pulled atoms, 2 of which read from a cached file produced by
DiskStatsLoggingService. Most of the logic is taken from
DiskStatsService.java.

Test: Manually verified information is the same as dumpsys. Will look
into cts as well.

Change-Id: I9818ac787de46514bc09ab3887cbfaec6cff273c
2018-08-21 10:35:39 -07:00
Yangster-mac
48b3d62bfe Create log event from key value maps.
BUG: b/112816333
Test: statsd test.
Change-Id: Ib66f06186abfacd77807436379e1e142a5b87c99
2018-08-19 22:37:59 +00:00
TreeHugger Robot
a5f28237e4 Merge "allow statsd pull based on event trigger" 2018-08-11 20:09:22 +00:00
Chenjie Yu
8858897205 allow statsd pull based on event trigger
Several restrictions:
1) This is only with GaugeMetric. We don't have use case for ValueMetric
to pull on event trigger.
2) trigger_event is set in the config. It can be generic atom matcher. But
we limit the number of atoms referenced in it to be 1. So we don't allow
multiple atoms to form a complex trigger.
3) This has to go with ALL_CONDITION_CHANGES sampling type.

+ also specify atom id of GaugeMetric output.

Bug: 111937835
Test: unit test
Change-Id: Ia15b1f209945f022edffb9ec5d673317d55d9e4f
2018-08-10 20:49:52 -07:00
TreeHugger Robot
632b39288d Merge "Remove the obsolete code for logd and add statsd socket log loss detection." 2018-08-11 00:30:47 +00:00