Add UsageTableHeader metrics

[ Merge from http://go/wvgerrit/72183 ]

Adds basic metrics for the usage table header.

Bug: http://b/112919252
Test: Unit tests. Manual GPlay
Change-Id: I14d406766d8b2aba3b6e4f1a02c75eedc674b011
This commit is contained in:
Adam Stone
2019-02-05 16:33:31 -08:00
parent d925048c35
commit 741645a4be
11 changed files with 225 additions and 87 deletions

View File

@@ -94,7 +94,7 @@ message WvCdmMetrics {
// This contains metrics that were captured at the CryptoSession level. These
// include CryptoSession metrics and most OEMCrypto metrics.
// next id: 58
// next id: 62
message CryptoMetrics {
// Crypto Session Metrics.
optional ValueMetric crypto_session_security_level = 1;
@@ -111,8 +111,15 @@ message WvCdmMetrics {
repeated DistributionMetric crypto_session_open_time_us = 12;
optional ValueMetric crypto_session_system_id = 13;
repeated DistributionMetric crypto_session_update_usage_information_time_us = 14;
repeated DistributionMetric crypto_session_update_usage_entry_time_us = 56;
optional ValueMetric crypto_session_usage_information_support = 15;
// Usage Table Metrics
optional ValueMetric usage_table_header_initial_size = 58;
repeated CounterMetric usage_table_header_add_entry = 59;
repeated CounterMetric usage_table_header_delete_entry = 60;
repeated DistributionMetric usage_table_header_update_entry_time_us = 56;
repeated CounterMetric usage_table_header_load_entry = 61;
// OemCrypto metrics.
optional ValueMetric oemcrypto_api_version = 16;
repeated CounterMetric oemcrypto_close_session = 17;

View File

@@ -65,11 +65,21 @@ void CryptoMetrics::Serialize(WvCdmMetrics::CryptoMetrics *crypto_metrics)
crypto_session_update_usage_information_.ToProto(
crypto_metrics
->mutable_crypto_session_update_usage_information_time_us());
crypto_session_update_usage_entry_.ToProto(
crypto_metrics->mutable_crypto_session_update_usage_entry_time_us());
crypto_metrics->set_allocated_crypto_session_usage_information_support(
crypto_session_usage_information_support_.ToProto());
/* USAGE TABLE HEADER */
usage_table_header_add_entry_.ToProto(
crypto_metrics->mutable_usage_table_header_add_entry());
usage_table_header_delete_entry_.ToProto(
crypto_metrics->mutable_usage_table_header_delete_entry());
usage_table_header_update_entry_.ToProto(
crypto_metrics->mutable_usage_table_header_update_entry_time_us());
usage_table_header_load_entry_.ToProto(
crypto_metrics->mutable_usage_table_header_load_entry());
crypto_metrics->set_allocated_usage_table_header_initial_size(
usage_table_header_initial_size_.ToProto());
/* OEMCRYPTO */
crypto_metrics->set_allocated_oemcrypto_api_version(
oemcrypto_api_version_.ToProto());