Updated copyright notice and cleaned up includes.

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

Bug: 204946540
Test: Metric unit tests
Change-Id: I78f839fafd27604a2bb78c04d587c40919c5372d
This commit is contained in:
Alex Dale
2021-11-03 17:28:00 -07:00
parent 21a021e800
commit 1b95db51f1
23 changed files with 112 additions and 163 deletions

View File

@@ -1,15 +1,18 @@
// Copyright 2016 Google Inc. All Rights Reserved.
// Copyright 2016 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine License
// Agreement.
//
// This file contains definitions for metrics being collected throughout the
// CDM.
#ifndef WVCDM_METRICS_METRICS_GROUP_H_
#define WVCDM_METRICS_METRICS_GROUP_H_
#ifndef WVCDM_METRICS_METRICS_COLLECTIONS_H_
#define WVCDM_METRICS_METRICS_COLLECTIONS_H_
#include <stddef.h>
#include <stdint.h>
#include <mutex>
#include <ostream>
#include <string>
#include <vector>
#include "OEMCryptoCENC.h"
#include "counter_metric.h"
@@ -58,9 +61,7 @@
namespace wvcdm {
namespace metrics {
namespace {
// Short name definitions to ease AttributeHandler definitions.
// Internal namespace to help simplify declarations.
const int kErrorCodeFieldNumber =
@@ -88,8 +89,7 @@ const int kKeyRequestTypeFieldNumber =
::drm_metrics::Attributes::kKeyRequestTypeFieldNumber;
const int kLicenseTypeFieldNumber =
::drm_metrics::Attributes::kLicenseTypeFieldNumber;
} // anonymous namespace
} // namespace
// The maximum number of completed sessions that can be stored. More than this
// will cause some metrics to be discarded.
@@ -292,7 +292,7 @@ class CryptoMetrics {
oemcrypto_load_provisioning_;
ValueMetric<uint32_t> oemcrypto_minor_api_version_;
ValueMetric<uint32_t> oemcrypto_maximum_usage_table_header_size_;
};
}; // class CryptoMetrics
// This class contains session-scoped metrics. All properties and
// statistics related to operations within a single session are
@@ -350,7 +350,7 @@ class SessionMetrics {
CdmSessionId session_id_;
bool completed_;
CryptoMetrics crypto_metrics_;
};
}; // class SessionMetrics
// This class contains metrics for the OEMCrypto Dynamic Adapter. They are
// separated from other metrics because they need to be encapsulated in a
@@ -389,7 +389,7 @@ class OemCryptoDynamicAdapterMetrics {
previous_oemcrypto_initialization_failure_;
ValueMetric<uint32_t> oemcrypto_l1_api_version_;
ValueMetric<uint32_t> oemcrypto_l1_min_api_version_;
};
}; // class OemCryptoDynamicAdapterMetrics
// This will fetch the singleton instance for dynamic adapter metrics.
// This method is safe only if we use C++ 11. In C++ 11, static function-local
@@ -494,9 +494,7 @@ class EngineMetrics {
void SerializeEngineMetrics(
drm_metrics::WvCdmMetrics::EngineMetrics* engine_metrics) const;
};
}; // class EngineMetrics
} // namespace metrics
} // namespace wvcdm
#endif // WVCDM_METRICS_METRICS_GROUP_H_
#endif // WVCDM_METRICS_METRICS_COLLECTIONS_H_