1/*
2 * Copyright (C) 2022 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.express;
20
21option java_package = "com.android.os.express";
22option java_outer_classname = "ExpressConfigProto";
23option java_multiple_files = true;
24
25enum MetricUnit {
26    UNIT_UNKNOWN = 0;
27    UNIT_COUNT = 1;
28    UNIT_TIME_MILLIS = 2;
29    UNIT_KILOBYTE = 3;
30}
31
32enum MetricType {
33    METRIC_TYPE_UNKNOWN = 0;
34    COUNTER = 1;
35    HISTOGRAM = 2;
36    COUNTER_WITH_UID = 3;
37    HISTOGRAM_WITH_UID = 4;
38}
39
40message HistogramOptions {
41
42    message UniformBinningOptions {
43        optional int32 count = 1;
44
45        // Inclusive min value, values < min will go to underflow bin
46        optional float min = 2;
47
48        // Exclusive max value, values >= max will go to overflow bin
49        optional float max = 3;
50    }
51
52    message ScaledBinningOptions  {
53        optional int32 count = 1;
54        optional float first_bin_width = 3;
55        optional float scale = 4;
56        optional int32 min_value = 5;
57
58        reserved 2;
59    }
60
61    oneof options {
62        UniformBinningOptions uniform_bins = 1;
63        ScaledBinningOptions scaled_bins = 2;
64    }
65}
66
67message ExpressMetric {
68    optional string id = 1;
69
70    optional MetricType type = 2;
71
72    optional string display_name = 3;
73
74    optional string description = 4;
75
76    repeated string owner_email = 5;
77
78    optional MetricUnit unit = 6;
79
80    oneof options {
81        HistogramOptions histogram_options = 7;
82    }
83}
84
85message ExpressMetricConfigFile {
86    repeated ExpressMetric express_metric = 1;
87}
88