Widevine Metrics System

This change is the complete Widevine metrics system. It will
measure and record runtime information about what is happening
in the CDM - such as errors and throughput.

Bug: 33745339
Bug: 26027857
Change-Id: Ic9a82074f1e2b72c72d751b235f8ae361232787d
This commit is contained in:
Aaron Vaage
2017-01-17 18:31:25 -08:00
parent ee5aff7706
commit edb9f00df7
39 changed files with 2969 additions and 258 deletions

View File

@@ -0,0 +1,71 @@
// Copyright 2017 Google Inc. All Rights Reserved.
#include "ami_adapter.h"
#include <log.h>
namespace wvcdm {
AmiAdapter::AmiAdapter() :
analytics_item_("widevine") {
analytics_item_.generateSessionID();
}
AmiAdapter::AmiAdapter(int64_t parent) :
analytics_item_("widevine") {
analytics_item_.generateSessionID();
analytics_item_.setInt64("/drm/widevine/parent/external", parent);
}
AmiAdapter::~AmiAdapter() {
analytics_item_.setFinalized(true);
analytics_item_.selfrecord();
}
metrics::Report* AmiAdapter::NewReport() const {
return new AmiAdapter(analytics_item_.getSessionID());
}
void AmiAdapter::UpdateString(const std::string& metric_id,
const std::string& value) {
analytics_item_.setCString(metric_id.c_str(), value.c_str());
LOGI(
"AmiAdapter (%lld) %s : %s",
analytics_item_.getSessionID(),
metric_id.c_str(),
value.c_str());
}
void AmiAdapter::UpdateInt32(const std::string& metric_id,
int32_t value) {
analytics_item_.setInt32(metric_id.c_str(), value);
LOGI(
"AmiAdapter (%lld) %s : %ld",
analytics_item_.getSessionID(),
metric_id.c_str(),
value);
}
void AmiAdapter::UpdateInt64(const std::string& metric_id,
int64_t value) {
analytics_item_.setInt64(metric_id.c_str(), value);
LOGI(
"AmiAdapter (%lld) %s : %lld",
analytics_item_.getSessionID(),
metric_id.c_str(),
value);
}
void AmiAdapter::UpdateDouble(const std::string& metric_id,
double value) {
analytics_item_.setDouble(metric_id.c_str(), value);
LOGI(
"AmiAdapter (%lld) %s : %f",
analytics_item_.getSessionID(),
metric_id.c_str(),
value);
}
} // namespace wvcdm