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