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:
@@ -13,6 +13,7 @@
|
||||
#include "lock.h"
|
||||
#include "oemcrypto_adapter.h"
|
||||
#include "scoped_ptr.h"
|
||||
#include "timer_metric.h"
|
||||
#include "wv_cdm_constants.h"
|
||||
#include "wv_cdm_types.h"
|
||||
|
||||
@@ -210,6 +211,8 @@ class CdmEngine {
|
||||
// dead lock.
|
||||
virtual void OnTimerEvent();
|
||||
|
||||
virtual metrics::MetricsGroup* GetMetrics() { return &metrics_; }
|
||||
|
||||
private:
|
||||
// private methods
|
||||
CdmResponseType OpenSession(const CdmKeySystem& key_system,
|
||||
@@ -231,6 +234,18 @@ class CdmEngine {
|
||||
void CloseExpiredReleaseSessions();
|
||||
|
||||
// instance variables
|
||||
|
||||
|
||||
/*
|
||||
* The metrics group must be the first variable declared to ensure
|
||||
* that it is the last member destroyed so that no child members
|
||||
* try to use a reference to it after it is destroyed. This will
|
||||
* ensure that all data has been properly recorded in the group before
|
||||
* it is published.
|
||||
*/
|
||||
metrics::MetricsGroup metrics_;
|
||||
metrics::TimerMetric life_span_;
|
||||
|
||||
CdmSessionMap sessions_;
|
||||
CdmReleaseKeySetMap release_key_sets_;
|
||||
scoped_ptr<CertificateProvisioning> cert_provisioning_;
|
||||
|
||||
@@ -11,9 +11,11 @@
|
||||
#include "file_store.h"
|
||||
#include "initialization_data.h"
|
||||
#include "license.h"
|
||||
#include "metrics_group.h"
|
||||
#include "oemcrypto_adapter.h"
|
||||
#include "policy_engine.h"
|
||||
#include "scoped_ptr.h"
|
||||
#include "timer_metric.h"
|
||||
#include "wv_cdm_types.h"
|
||||
|
||||
namespace wvcdm {
|
||||
@@ -151,6 +153,8 @@ class CdmSession {
|
||||
CdmSigningAlgorithm algorithm,
|
||||
const std::string& signature);
|
||||
|
||||
virtual metrics::MetricsGroup* GetMetrics() { return &metrics_; }
|
||||
|
||||
private:
|
||||
friend class CdmSessionTest;
|
||||
|
||||
@@ -166,6 +170,17 @@ class CdmSession {
|
||||
void set_file_handle(DeviceFiles* file_handle);
|
||||
|
||||
// instance variables
|
||||
|
||||
/*
|
||||
* The metrics group must be the first variable declared to ensure
|
||||
* that it is the last member destroyed so that no child members
|
||||
* try to use a reference to it after it is destroyed. This will
|
||||
* ensure that all data has been properly recorded in the group before
|
||||
* it is published.
|
||||
*/
|
||||
metrics::MetricsGroup metrics_;
|
||||
metrics::TimerMetric life_span_;
|
||||
|
||||
bool initialized_;
|
||||
CdmSessionId session_id_;
|
||||
scoped_ptr<CdmLicense> license_parser_;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "crypto_session.h"
|
||||
#include "metrics_group.h"
|
||||
#include "oemcrypto_adapter.h"
|
||||
#include "service_certificate.h"
|
||||
#include "wv_cdm_types.h"
|
||||
@@ -17,7 +18,8 @@ class FileSystem;
|
||||
|
||||
class CertificateProvisioning {
|
||||
public:
|
||||
CertificateProvisioning() :
|
||||
CertificateProvisioning(metrics::MetricsGroup* metrics) :
|
||||
crypto_session_(metrics),
|
||||
cert_type_(kCertificateWidevine),
|
||||
service_certificate_(NULL) {};
|
||||
~CertificateProvisioning() {};
|
||||
|
||||
@@ -7,9 +7,11 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "lock.h"
|
||||
#include "oemcrypto_adapter.h"
|
||||
#include "OEMCryptoCENC.h"
|
||||
#include "lock.h"
|
||||
#include "metrics_group.h"
|
||||
#include "oemcrypto_adapter.h"
|
||||
#include "timer_metric.h"
|
||||
#include "wv_cdm_types.h"
|
||||
|
||||
namespace wvcdm {
|
||||
@@ -32,7 +34,7 @@ class CryptoSession {
|
||||
bool rsa_cast;
|
||||
};
|
||||
|
||||
CryptoSession();
|
||||
CryptoSession(metrics::MetricsGroup* metrics);
|
||||
virtual ~CryptoSession();
|
||||
|
||||
virtual bool GetClientToken(std::string* client_token);
|
||||
@@ -210,6 +212,9 @@ class CryptoSession {
|
||||
uint64_t request_id_base_;
|
||||
static uint64_t request_id_index_;
|
||||
|
||||
metrics::MetricsGroup* metrics_;
|
||||
metrics::TimerMetric life_span_;
|
||||
|
||||
CdmCipherMode cipher_mode_;
|
||||
|
||||
CORE_DISALLOW_COPY_AND_ASSIGN(CryptoSession);
|
||||
|
||||
Reference in New Issue
Block a user