Fixes serialization of vendor metrics
Uses an updated proto model that's more efficient for serialization.
Test: Unit tests, google play and CTS tests.
Bug: 73724218
Change-Id: I936bc18216c0c67de580424b4c62344d94be6b38
diff --git a/drm/libmediadrm/protos/metrics.proto b/drm/libmediadrm/protos/metrics.proto
index aa26f5f..6160e6f 100644
--- a/drm/libmediadrm/protos/metrics.proto
+++ b/drm/libmediadrm/protos/metrics.proto
@@ -18,33 +18,6 @@
package android.drm_metrics;
-// The MetricsGroup is a collection of metric name/value pair instances
-// that can be serialized and provided to a caller.
-message MetricsGroup {
- message Metric {
- message MetricValue {
- // Exactly one of the following values must be set.
- optional int64 int_value = 1;
- optional double double_value = 2;
- optional string string_value = 3;
- }
-
- // The name of the metric. Must be valid UTF-8. Required.
- optional string name = 1;
-
- // The value of the metric. Required.
- optional MetricValue value = 2;
- }
-
- // The list of name/value pairs of metrics.
- repeated Metric metric = 1;
-
- // Allow multiple sub groups of metrics.
- repeated MetricsGroup metric_sub_group = 2;
-
- // Name of the application package associated with the metrics.
- optional string app_package_name = 3;
-}
// This message contains the specific metrics captured by DrmMetrics. It is
// used for serializing and logging metrics.
@@ -72,7 +45,7 @@
// The Counter message is used to store a count value with an associated
// Attribute.
message Counter {
- optional int64 count = 1;
+ optional uint64 count = 1;
// Represents the attributes associated with this counter instance.
optional Attributes attributes = 2;
}
@@ -80,11 +53,11 @@
// The DistributionMetric is meant to capture the moments of a normally
// distributed (or approximately normal) value.
message DistributionMetric {
- optional double min = 1;
- optional double max = 2;
- optional double mean = 3;
+ optional float min = 1;
+ optional float max = 2;
+ optional float mean = 3;
optional double variance = 4;
- optional double operation_count = 5;
+ optional uint64 operation_count = 5;
// Represents the attributes assocated with this distribution metric
// instance.
@@ -93,9 +66,9 @@
message SessionLifetime {
// Start time of the session in milliseconds since epoch.
- optional int64 start_time_ms = 1;
+ optional uint64 start_time_ms = 1;
// End time of the session in milliseconds since epoch.
- optional int64 end_time_ms = 2;
+ optional uint64 end_time_ms = 2;
}
// The count of open session operations. Each instance has a specific error