xref: /aosp_15_r20/frameworks/av/drm/libmediadrm/protos/metrics.proto (revision ec779b8e0859a360c3d303172224686826e6e0e1)
1*ec779b8eSAndroid Build Coastguard Worker/*
2*ec779b8eSAndroid Build Coastguard Worker * Copyright (C) 2017 The Android Open Source Project
3*ec779b8eSAndroid Build Coastguard Worker *
4*ec779b8eSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*ec779b8eSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*ec779b8eSAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*ec779b8eSAndroid Build Coastguard Worker *
8*ec779b8eSAndroid Build Coastguard Worker *      http://www.apache.org/licenses/LICENSE-2.0
9*ec779b8eSAndroid Build Coastguard Worker *
10*ec779b8eSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*ec779b8eSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*ec779b8eSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*ec779b8eSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*ec779b8eSAndroid Build Coastguard Worker * limitations under the License.
15*ec779b8eSAndroid Build Coastguard Worker */
16*ec779b8eSAndroid Build Coastguard Worker
17*ec779b8eSAndroid Build Coastguard Workersyntax = "proto2";
18*ec779b8eSAndroid Build Coastguard Worker
19*ec779b8eSAndroid Build Coastguard Workerpackage android.drm_metrics;
20*ec779b8eSAndroid Build Coastguard Worker
21*ec779b8eSAndroid Build Coastguard Worker
22*ec779b8eSAndroid Build Coastguard Worker// This message contains the specific metrics captured by DrmMetrics. It is
23*ec779b8eSAndroid Build Coastguard Worker// used for serializing and logging metrics.
24*ec779b8eSAndroid Build Coastguard Worker// next id: 11.
25*ec779b8eSAndroid Build Coastguard Workermessage DrmFrameworkMetrics {
26*ec779b8eSAndroid Build Coastguard Worker  // TODO: Consider using extensions.
27*ec779b8eSAndroid Build Coastguard Worker
28*ec779b8eSAndroid Build Coastguard Worker  // Attributes are associated with a recorded value. E.g. A counter may
29*ec779b8eSAndroid Build Coastguard Worker  // represent a count of an operation returning a specific error code. The
30*ec779b8eSAndroid Build Coastguard Worker  // error code will be an attribute.
31*ec779b8eSAndroid Build Coastguard Worker  message Attributes {
32*ec779b8eSAndroid Build Coastguard Worker    // Reserved for compatibility with logging proto.
33*ec779b8eSAndroid Build Coastguard Worker    reserved 2 to 13;
34*ec779b8eSAndroid Build Coastguard Worker
35*ec779b8eSAndroid Build Coastguard Worker    // A general purpose error code where 0 means OK.
36*ec779b8eSAndroid Build Coastguard Worker    optional int32 error_code = 1;
37*ec779b8eSAndroid Build Coastguard Worker
38*ec779b8eSAndroid Build Coastguard Worker    // Defined at ::android::hardware::drm::V1_0::KeyStatusType;
39*ec779b8eSAndroid Build Coastguard Worker    optional uint32 key_status_type = 14;
40*ec779b8eSAndroid Build Coastguard Worker
41*ec779b8eSAndroid Build Coastguard Worker    // Defined at ::android::hardware::drm::V1_0::EventType;
42*ec779b8eSAndroid Build Coastguard Worker    optional uint32 event_type = 15;
43*ec779b8eSAndroid Build Coastguard Worker  }
44*ec779b8eSAndroid Build Coastguard Worker
45*ec779b8eSAndroid Build Coastguard Worker  // The Counter message is used to store a count value with an associated
46*ec779b8eSAndroid Build Coastguard Worker  // Attribute.
47*ec779b8eSAndroid Build Coastguard Worker  message Counter {
48*ec779b8eSAndroid Build Coastguard Worker    optional uint64 count = 1;
49*ec779b8eSAndroid Build Coastguard Worker    // Represents the attributes associated with this counter instance.
50*ec779b8eSAndroid Build Coastguard Worker    optional Attributes attributes = 2;
51*ec779b8eSAndroid Build Coastguard Worker  }
52*ec779b8eSAndroid Build Coastguard Worker
53*ec779b8eSAndroid Build Coastguard Worker  // The DistributionMetric is meant to capture the moments of a normally
54*ec779b8eSAndroid Build Coastguard Worker  // distributed (or approximately normal) value.
55*ec779b8eSAndroid Build Coastguard Worker  message DistributionMetric {
56*ec779b8eSAndroid Build Coastguard Worker    optional float min = 1;
57*ec779b8eSAndroid Build Coastguard Worker    optional float max = 2;
58*ec779b8eSAndroid Build Coastguard Worker    optional float mean = 3;
59*ec779b8eSAndroid Build Coastguard Worker    optional double variance = 4;
60*ec779b8eSAndroid Build Coastguard Worker    optional uint64 operation_count = 5;
61*ec779b8eSAndroid Build Coastguard Worker
62*ec779b8eSAndroid Build Coastguard Worker    // Represents the attributes assocated with this distribution metric
63*ec779b8eSAndroid Build Coastguard Worker    // instance.
64*ec779b8eSAndroid Build Coastguard Worker    optional Attributes attributes = 6;
65*ec779b8eSAndroid Build Coastguard Worker  }
66*ec779b8eSAndroid Build Coastguard Worker
67*ec779b8eSAndroid Build Coastguard Worker  message SessionLifetime {
68*ec779b8eSAndroid Build Coastguard Worker    // Start time of the session in milliseconds since epoch.
69*ec779b8eSAndroid Build Coastguard Worker    optional uint64 start_time_ms = 1;
70*ec779b8eSAndroid Build Coastguard Worker    // End time of the session in milliseconds since epoch.
71*ec779b8eSAndroid Build Coastguard Worker    optional uint64 end_time_ms = 2;
72*ec779b8eSAndroid Build Coastguard Worker  }
73*ec779b8eSAndroid Build Coastguard Worker
74*ec779b8eSAndroid Build Coastguard Worker  // The count of open session operations. Each instance has a specific error
75*ec779b8eSAndroid Build Coastguard Worker  // code associated with it.
76*ec779b8eSAndroid Build Coastguard Worker  repeated Counter open_session_counter = 1;
77*ec779b8eSAndroid Build Coastguard Worker
78*ec779b8eSAndroid Build Coastguard Worker  // The count of close session operations. Each instance has a specific error
79*ec779b8eSAndroid Build Coastguard Worker  // code associated with it.
80*ec779b8eSAndroid Build Coastguard Worker  repeated Counter close_session_counter = 2;
81*ec779b8eSAndroid Build Coastguard Worker
82*ec779b8eSAndroid Build Coastguard Worker  // Count and execution time of getKeyRequest calls.
83*ec779b8eSAndroid Build Coastguard Worker  repeated DistributionMetric get_key_request_time_us = 3;
84*ec779b8eSAndroid Build Coastguard Worker
85*ec779b8eSAndroid Build Coastguard Worker  // Count and execution time of provideKeyResponse calls.
86*ec779b8eSAndroid Build Coastguard Worker  repeated DistributionMetric provide_key_response_time_us = 4;
87*ec779b8eSAndroid Build Coastguard Worker
88*ec779b8eSAndroid Build Coastguard Worker  // Count of getProvisionRequest calls.
89*ec779b8eSAndroid Build Coastguard Worker  repeated Counter get_provisioning_request_counter = 5;
90*ec779b8eSAndroid Build Coastguard Worker
91*ec779b8eSAndroid Build Coastguard Worker  // Count of provideProvisionResponse calls.
92*ec779b8eSAndroid Build Coastguard Worker  repeated Counter provide_provisioning_response_counter = 6;
93*ec779b8eSAndroid Build Coastguard Worker
94*ec779b8eSAndroid Build Coastguard Worker  // Count of key status events broken out by status type.
95*ec779b8eSAndroid Build Coastguard Worker  repeated Counter key_status_change_counter = 7;
96*ec779b8eSAndroid Build Coastguard Worker
97*ec779b8eSAndroid Build Coastguard Worker  // Count of events broken out by event type
98*ec779b8eSAndroid Build Coastguard Worker  repeated Counter event_callback_counter = 8;
99*ec779b8eSAndroid Build Coastguard Worker
100*ec779b8eSAndroid Build Coastguard Worker  // Count getPropertyByteArray calls to retrieve the device unique id.
101*ec779b8eSAndroid Build Coastguard Worker  repeated Counter get_device_unique_id_counter = 9;
102*ec779b8eSAndroid Build Coastguard Worker
103*ec779b8eSAndroid Build Coastguard Worker  // Session ids to lifetime (start and end time) map.
104*ec779b8eSAndroid Build Coastguard Worker  // Session ids are strings of hex-encoded byte arrays.
105*ec779b8eSAndroid Build Coastguard Worker  map<string, SessionLifetime> session_lifetimes = 10;
106*ec779b8eSAndroid Build Coastguard Worker}
107*ec779b8eSAndroid Build Coastguard Worker
108