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 */
16syntax = "proto3";
17
18package tradefed.metric;
19
20option java_package = "com.android.tradefed.metrics.proto";
21option 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.
28enum 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.
36enum DataType {
37  RAW = 0;
38  PROCESSED = 1;
39}
40
41// Represents the actual measurement values
42message 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;
48    double single_double = 3;
49    StringValues string_values = 4;
50    NumericValues numeric_values = 5;
51    DoubleValues double_values = 6;
52  }
53}
54
55// Represents a list of string measurements
56message StringValues {
57  repeated string string_value = 1;
58}
59
60// Represents a list of numeric measurements
61message NumericValues {
62  repeated int64 numeric_value = 1;
63}
64
65// Represents a list of float measurements
66message DoubleValues {
67  repeated double double_value = 1;
68}
69
70// Represents the full metric: The measurements and its metadata
71message 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}
84