As a large number of provisioning errors can come from failures initializing OEMCrypto we need to collect these messages. Errors and warnings were only printed to the log. This change takes those messages and puts them into the oemcrypto intialization mode metric. "Mode" was chosen as most messages were about how oemcrypto was initialized (e.g. into L3 because no L1 library was found). Test: Ran all GTS Media Tests Bug: 34782934 Change-Id: I1fcdd74c99011d53bdffe9609d2f4c46c222e2f6
59 lines
1.1 KiB
C++
59 lines
1.1 KiB
C++
// Copyright 2016 Google Inc. All Rights Reserved.
|
|
|
|
#ifndef WVCDM_METRICS_METRICS_FRONT_END_H_
|
|
#define WVCDM_METRICS_METRICS_FRONT_END_H_
|
|
|
|
#include <map>
|
|
|
|
#include "report.h"
|
|
#include "timer_metric.h" /* needed for the macro */
|
|
|
|
namespace wvcdm {
|
|
namespace metrics {
|
|
|
|
class MetricsFrontEnd {
|
|
|
|
public:
|
|
|
|
MetricsFrontEnd(Report* root);
|
|
|
|
MetricNotification* CreateSubscriber();
|
|
|
|
static MetricsFrontEnd& Instance();
|
|
static void OverrideInstance(MetricsFrontEnd* instance);
|
|
|
|
private:
|
|
|
|
static MetricsFrontEnd* instance_;
|
|
|
|
Report* root_;
|
|
|
|
/* Disallow copy and assign. */
|
|
MetricsFrontEnd(const MetricsFrontEnd&);
|
|
void operator=(const MetricsFrontEnd&);
|
|
};
|
|
|
|
} // namespace metrics
|
|
} // namespace wvcdm
|
|
|
|
#define MFE wvcdm::metrics::MetricsFrontEnd::Instance()
|
|
|
|
#define NO_TIME 0
|
|
|
|
#define M_RECORD(GROUP, METRIC, TIME, ...) \
|
|
if ( GROUP ) { \
|
|
( GROUP ) -> METRIC . Record( TIME, ##__VA_ARGS__ ); \
|
|
}
|
|
|
|
#define M_TIME(CALL, GROUP, METRIC, ...) \
|
|
if ( GROUP ) { \
|
|
wvcdm::metrics::TimerMetric timer; \
|
|
timer.Start(); \
|
|
CALL; \
|
|
( GROUP ) -> METRIC . Record(timer.AsUs(), ##__VA_ARGS__ ); \
|
|
} else { \
|
|
CALL; \
|
|
}
|
|
|
|
#endif
|