Add extra OEMCrypto metrics

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

These were not previously being collected or were collected
insufficiently.

BUG: http://b/121090396 http://b/112919252
Test: Unit tests, Gplay, Nflix, GTS
Change-Id: I32b7206cbe6071519b4a483fbcd0920dc1a26961
This commit is contained in:
Adam Stone
2019-03-20 11:22:04 -07:00
parent a5bc8be7a0
commit 09c7473dea
5 changed files with 100 additions and 5 deletions

View File

@@ -413,6 +413,26 @@ TEST_F(CryptoMetricsTest, AllCryptoMetrics) {
.Record(1.0, OEMCrypto_ERROR_INIT_FAILED);
crypto_metrics.oemcrypto_update_usage_table_
.Increment(OEMCrypto_ERROR_INIT_FAILED);
crypto_metrics.oemcrypto_create_usage_table_header_
.Increment(OEMCrypto_ERROR_INIT_FAILED);
crypto_metrics.oemcrypto_load_usage_table_header_
.Increment(OEMCrypto_ERROR_INIT_FAILED);
crypto_metrics.oemcrypto_shrink_usage_table_header_
.Increment(OEMCrypto_ERROR_INIT_FAILED);
crypto_metrics.oemcrypto_create_new_usage_entry_
.Increment(OEMCrypto_ERROR_INIT_FAILED);
crypto_metrics.oemcrypto_load_usage_entry_
.Increment(OEMCrypto_ERROR_INIT_FAILED);
crypto_metrics.oemcrypto_move_entry_
.Increment(OEMCrypto_ERROR_INIT_FAILED);
crypto_metrics.oemcrypto_create_old_usage_entry_
.Increment(OEMCrypto_ERROR_INIT_FAILED);
crypto_metrics.oemcrypto_copy_old_usage_entry_
.Increment(OEMCrypto_ERROR_INIT_FAILED);
crypto_metrics.oemcrypto_set_sandbox_.Record("sandbox");
crypto_metrics.oemcrypto_set_decrypt_hash_
.Increment(OEMCrypto_ERROR_INIT_FAILED);
crypto_metrics.oemcrypto_resource_rating_tier_.Record(123);
WvCdmMetrics::CryptoMetrics actual;
crypto_metrics.Serialize(&actual);
@@ -481,6 +501,17 @@ TEST_F(CryptoMetricsTest, AllCryptoMetrics) {
EXPECT_EQ(123, actual.oemcrypto_security_patch_level().int_value());
EXPECT_GT(actual.oemcrypto_select_key_time_us_size(), 0);
EXPECT_GT(actual.oemcrypto_update_usage_table_size(), 0);
EXPECT_GT(actual.oemcrypto_create_usage_table_header_size(), 0);
EXPECT_GT(actual.oemcrypto_load_usage_table_header_size(), 0);
EXPECT_GT(actual.oemcrypto_shrink_usage_table_header_size(), 0);
EXPECT_GT(actual.oemcrypto_create_new_usage_entry_size(), 0);
EXPECT_GT(actual.oemcrypto_load_usage_entry_size(), 0);
EXPECT_GT(actual.oemcrypto_move_entry_size(), 0);
EXPECT_GT(actual.oemcrypto_create_old_usage_entry_size(), 0);
EXPECT_GT(actual.oemcrypto_copy_old_usage_entry_size(), 0);
EXPECT_EQ("sandbox", actual.oemcrypto_set_sandbox().string_value());
EXPECT_GT(actual.oemcrypto_set_decrypt_hash_size(), 0);
EXPECT_EQ(123, actual.oemcrypto_resource_rating_tier().int_value());
}
} // namespace metrics