Add sampling support in the metrics reporter

The sample rate percentage can be configured via 2 runtime
flags (MetricsReportingMods and MetricsReportingNumMods).

A runtime session will report metrics if and only if its
session id % MetricsReportingNumMods < MetricsReportingMods.

A value of 0 on the mods will effectively disable reporting,
while configuring MetricsReportingMods to be equal to the
MetricsReportingNumMods will enable reporting in all cases.

Test: gtest
Bug: 170149255
Change-Id: Ie1353e4fc0ff695fc627696145d95e9ccd3c6a94
8 files changed