xref: /aosp_15_r20/tools/asuite/atest/tf_proto/metric_measurement.proto (revision c2e18aaa1096c836b086f94603d04f4eb9cf37f5)
1*c2e18aaaSAndroid Build Coastguard Worker/*
2*c2e18aaaSAndroid Build Coastguard Worker * Copyright (C) 2018 The Android Open Source Project
3*c2e18aaaSAndroid Build Coastguard Worker *
4*c2e18aaaSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*c2e18aaaSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*c2e18aaaSAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*c2e18aaaSAndroid Build Coastguard Worker *
8*c2e18aaaSAndroid Build Coastguard Worker *      http://www.apache.org/licenses/LICENSE-2.0
9*c2e18aaaSAndroid Build Coastguard Worker *
10*c2e18aaaSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*c2e18aaaSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*c2e18aaaSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*c2e18aaaSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*c2e18aaaSAndroid Build Coastguard Worker * limitations under the License.
15*c2e18aaaSAndroid Build Coastguard Worker */
16*c2e18aaaSAndroid Build Coastguard Workersyntax = "proto3";
17*c2e18aaaSAndroid Build Coastguard Worker
18*c2e18aaaSAndroid Build Coastguard Workerpackage tradefed.metric;
19*c2e18aaaSAndroid Build Coastguard Worker
20*c2e18aaaSAndroid Build Coastguard Workeroption java_package = "com.android.tradefed.metrics.proto";
21*c2e18aaaSAndroid Build Coastguard Workeroption java_outer_classname = "MetricMeasurement";
22*c2e18aaaSAndroid Build Coastguard Worker
23*c2e18aaaSAndroid Build Coastguard Worker// Represents what is the expected directionality of the measurements
24*c2e18aaaSAndroid Build Coastguard Worker// For example: If we are measuring how fast a device is charging, the
25*c2e18aaaSAndroid Build Coastguard Worker// directionality of UP_BETTER would describe it the best. Overall if the trend
26*c2e18aaaSAndroid Build Coastguard Worker// of the list of measurements has a desired pattern that we can refer too for
27*c2e18aaaSAndroid Build Coastguard Worker// understanding the expectation better.
28*c2e18aaaSAndroid Build Coastguard Workerenum Directionality {
29*c2e18aaaSAndroid Build Coastguard Worker  DIRECTIONALITY_UNSPECIFIED = 0;
30*c2e18aaaSAndroid Build Coastguard Worker  UP_BETTER = 1;
31*c2e18aaaSAndroid Build Coastguard Worker  DOWN_BETTER = 2;
32*c2e18aaaSAndroid Build Coastguard Worker  CLOSER_BETTER = 3; // If the values should be as close as possible
33*c2e18aaaSAndroid Build Coastguard Worker}
34*c2e18aaaSAndroid Build Coastguard Worker
35*c2e18aaaSAndroid Build Coastguard Worker// Represents whether the data was already processed or is raw data.
36*c2e18aaaSAndroid Build Coastguard Workerenum DataType {
37*c2e18aaaSAndroid Build Coastguard Worker  RAW = 0;
38*c2e18aaaSAndroid Build Coastguard Worker  PROCESSED = 1;
39*c2e18aaaSAndroid Build Coastguard Worker}
40*c2e18aaaSAndroid Build Coastguard Worker
41*c2e18aaaSAndroid Build Coastguard Worker// Represents the actual measurement values
42*c2e18aaaSAndroid Build Coastguard Workermessage Measurements {
43*c2e18aaaSAndroid Build Coastguard Worker  // All the types a measurement can take, use the oneOf to find which type was
44*c2e18aaaSAndroid Build Coastguard Worker  // used.
45*c2e18aaaSAndroid Build Coastguard Worker  oneof measurement {
46*c2e18aaaSAndroid Build Coastguard Worker    string single_string = 1;
47*c2e18aaaSAndroid Build Coastguard Worker    int64 single_int = 2;
48*c2e18aaaSAndroid Build Coastguard Worker    double single_double = 3;
49*c2e18aaaSAndroid Build Coastguard Worker    StringValues string_values = 4;
50*c2e18aaaSAndroid Build Coastguard Worker    NumericValues numeric_values = 5;
51*c2e18aaaSAndroid Build Coastguard Worker    DoubleValues double_values = 6;
52*c2e18aaaSAndroid Build Coastguard Worker  }
53*c2e18aaaSAndroid Build Coastguard Worker}
54*c2e18aaaSAndroid Build Coastguard Worker
55*c2e18aaaSAndroid Build Coastguard Worker// Represents a list of string measurements
56*c2e18aaaSAndroid Build Coastguard Workermessage StringValues {
57*c2e18aaaSAndroid Build Coastguard Worker  repeated string string_value = 1;
58*c2e18aaaSAndroid Build Coastguard Worker}
59*c2e18aaaSAndroid Build Coastguard Worker
60*c2e18aaaSAndroid Build Coastguard Worker// Represents a list of numeric measurements
61*c2e18aaaSAndroid Build Coastguard Workermessage NumericValues {
62*c2e18aaaSAndroid Build Coastguard Worker  repeated int64 numeric_value = 1;
63*c2e18aaaSAndroid Build Coastguard Worker}
64*c2e18aaaSAndroid Build Coastguard Worker
65*c2e18aaaSAndroid Build Coastguard Worker// Represents a list of float measurements
66*c2e18aaaSAndroid Build Coastguard Workermessage DoubleValues {
67*c2e18aaaSAndroid Build Coastguard Worker  repeated double double_value = 1;
68*c2e18aaaSAndroid Build Coastguard Worker}
69*c2e18aaaSAndroid Build Coastguard Worker
70*c2e18aaaSAndroid Build Coastguard Worker// Represents the full metric: The measurements and its metadata
71*c2e18aaaSAndroid Build Coastguard Workermessage Metric {
72*c2e18aaaSAndroid Build Coastguard Worker  // The measurements
73*c2e18aaaSAndroid Build Coastguard Worker  Measurements measurements = 1;
74*c2e18aaaSAndroid Build Coastguard Worker
75*c2e18aaaSAndroid Build Coastguard Worker  // The Unit of the measurements.
76*c2e18aaaSAndroid Build Coastguard Worker  string unit = 2;
77*c2e18aaaSAndroid Build Coastguard Worker
78*c2e18aaaSAndroid Build Coastguard Worker  // The Directionality of the measurements
79*c2e18aaaSAndroid Build Coastguard Worker  Directionality direction = 3;
80*c2e18aaaSAndroid Build Coastguard Worker
81*c2e18aaaSAndroid Build Coastguard Worker  // Whether the measurements is raw data or processed.
82*c2e18aaaSAndroid Build Coastguard Worker  DataType type = 4;
83*c2e18aaaSAndroid Build Coastguard Worker}
84