Updated metric Distribution and Timer utils.

[ Merge of http://go/wvgerrit/137811 ]

Renamed TimerMetric to Timer.  Timer is used to generate durations
included in metrics, but is not a metric itself.  The method of
getting the current time did not require creating an instance of
std::steady_clock.

Updated Distribution and Timer to use default initializers instead of
constructor initialization list.

Bug: 204946540
Test: Metric unit tests
Change-Id: I7ed291b586347dd0b7ab305960883bec04637315
This commit is contained in:
Alex Dale
2021-11-04 18:33:51 -07:00
parent 1b95db51f1
commit f5759c5149
7 changed files with 33 additions and 40 deletions

View File

@@ -51,7 +51,7 @@
// sts);
#define M_TIME(CALL, GROUP, METRIC, ...) \
if (GROUP) { \
wvcdm::metrics::TimerMetric timer; \
wvcdm::metrics::Timer timer; \
timer.Start(); \
CALL; \
(GROUP)->METRIC.Record(timer.AsUs(), ##__VA_ARGS__); \
@@ -488,7 +488,7 @@ class EngineMetrics {
std::vector<std::shared_ptr<metrics::SessionMetrics>>
completed_session_metrics_list_;
// This is used to populate the engine lifespan metric
metrics::TimerMetric life_span_internal_;
metrics::Timer life_span_internal_;
CryptoMetrics crypto_metrics_;
std::string app_package_name_;