1/*
2 * Copyright (C) 2020 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.os.statsd.metadata;
20
21message ConfigKey {
22  optional int64 config_id = 1;
23  optional int32 uid = 2;
24}
25
26message Field {
27  optional int32 tag = 1;
28  optional int32 field = 2;
29}
30
31message FieldValue {
32  optional Field field = 1;
33  oneof value {
34    int32 value_int = 2;
35    int64 value_long = 3;
36    float value_float = 4;
37    double value_double = 5;
38    string value_str = 6;
39    bytes value_storage = 7;
40  }
41}
42
43message MetricDimensionKey {
44  repeated FieldValue dimension_key_in_what = 1;
45  repeated FieldValue state_values_key = 2;
46}
47
48message AlertDimensionKeyedData {
49  // The earliest time the alert can be fired again in wall clock time.
50  optional int32 last_refractory_ends_sec = 1;
51  optional MetricDimensionKey dimension_key = 2;
52}
53
54message AlertMetadata {
55  optional int64 alert_id = 1;
56  repeated AlertDimensionKeyedData alert_dim_keyed_data = 2;
57}
58
59// All metadata for a config in statsd
60message StatsMetadata {
61  optional ConfigKey config_key = 1;
62  repeated AlertMetadata alert_metadata = 2;
63}
64
65message StatsMetadataList {
66  repeated StatsMetadata stats_metadata = 1;
67}