+ Create a thread-safe LogEventQueue to buffer log events.
+ The socket listner thread will read from socket and write to the buffer as quickly as possible
to minimize the data loss in socket.
+ All pushed data is fetched from the the buffer and processed in a dedicated thread. After an
event is fetched from the queue, we no longer block the socket listener thread.
+ Report event queue stats via statsdstats, including the min and max queue event history span in
the queue (to understand how slow statsd can be and how fast the events can be)
Bug: 119031518
Test: unit tests added in statsd_test
Change-Id: I6b65ed9a678935b2e24302ba4b36e69c157adde4
Previously, most StatsService calls only allow the caller to specify the
uid if it is Userdebug/EngBuild. This applied even if the caller was
just specifying its own UID; this cl allows such a case. It also allows
ROOT to impersonate SHELL.
Test: Manual testing on userdebug and userbuild devices.
Test: make statsd_test && adb sync data && adb shell data/nativetest64/statsd_test/statsd_test
Change-Id: I2685d13a8dc24d40b5dab8be9842f53be6888ba3
Statsd clients may want to set an empty config temporarily, so it's
more convenient to allow them to set an empty config instead of
having to use the removeConfig and then having to remember to call
StatsManager#setDataFetchOperation.
Test: Added unit-tests and check they pass on marlin-eng.
Bug: 74997752
Change-Id: I2e762e5ec01e5a2c9a3469fb330b53fefbd734d6