jdesprez | 3019900 | 2018-03-15 12:44:10 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | syntax = "proto3"; |
| 17 | |
| 18 | package tradefed.metric; |
| 19 | |
| 20 | option java_package = "com.android.tradefed.metrics.proto"; |
| 21 | option java_outer_classname = "MetricMeasurement"; |
| 22 | |
| 23 | // Represents what is the expected directionality of the measurements |
| 24 | // For example: If we are measuring how fast a device is charging, the |
| 25 | // directionality of UP_BETTER would describe it the best. Overall if the trend |
| 26 | // of the list of measurements has a desired pattern that we can refer too for |
| 27 | // understanding the expectation better. |
| 28 | enum Directionality { |
| 29 | DIRECTIONALITY_UNSPECIFIED = 0; |
| 30 | UP_BETTER = 1; |
| 31 | DOWN_BETTER = 2; |
| 32 | CLOSER_BETTER = 3; // If the values should be as close as possible |
| 33 | } |
| 34 | |
| 35 | // Represents whether the data was already processed or is raw data. |
| 36 | enum DataType { |
| 37 | RAW = 0; |
| 38 | PROCESSED = 1; |
| 39 | } |
| 40 | |
| 41 | // Represents the actual measurement values |
| 42 | message Measurements { |
| 43 | // All the types a measurement can take, use the oneOf to find which type was |
| 44 | // used. |
| 45 | oneof measurement { |
| 46 | string single_string = 1; |
| 47 | int64 single_int = 2; |
jdesprez | 3903921 | 2018-04-04 16:44:35 -0700 | [diff] [blame] | 48 | double single_double = 3; |
jdesprez | 3019900 | 2018-03-15 12:44:10 -0700 | [diff] [blame] | 49 | StringValues string_values = 4; |
| 50 | NumericValues numeric_values = 5; |
jdesprez | 3903921 | 2018-04-04 16:44:35 -0700 | [diff] [blame] | 51 | DoubleValues double_values = 6; |
jdesprez | 3019900 | 2018-03-15 12:44:10 -0700 | [diff] [blame] | 52 | } |
| 53 | } |
| 54 | |
| 55 | // Represents a list of string measurements |
| 56 | message StringValues { |
| 57 | repeated string string_value = 1; |
| 58 | } |
| 59 | |
| 60 | // Represents a list of numeric measurements |
| 61 | message NumericValues { |
| 62 | repeated int64 numeric_value = 1; |
| 63 | } |
| 64 | |
| 65 | // Represents a list of float measurements |
jdesprez | 3903921 | 2018-04-04 16:44:35 -0700 | [diff] [blame] | 66 | message DoubleValues { |
| 67 | repeated double double_value = 1; |
jdesprez | 3019900 | 2018-03-15 12:44:10 -0700 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | // Represents the full metric: The measurements and its metadata |
| 71 | message Metric { |
| 72 | // The measurements |
| 73 | Measurements measurements = 1; |
| 74 | |
| 75 | // The Unit of the measurements. |
| 76 | string unit = 2; |
| 77 | |
| 78 | // The Directionality of the measurements |
| 79 | Directionality direction = 3; |
| 80 | |
| 81 | // Whether the measurements is raw data or processed. |
| 82 | DataType type = 4; |
| 83 | } |