Jeffrey Huang | 8a617e0 | 2020-03-19 15:38:43 -0700 | [diff] [blame] | 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 | |
| 17 | syntax = "proto2"; |
| 18 | |
| 19 | package android.os.statsd.metadata; |
| 20 | |
| 21 | message ConfigKey { |
| 22 | optional int64 config_id = 1; |
| 23 | optional int32 uid = 2; |
| 24 | } |
| 25 | |
| 26 | message Field { |
| 27 | optional int32 tag = 1; |
| 28 | optional int32 field = 2; |
| 29 | } |
| 30 | |
| 31 | message 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 | |
| 43 | message MetricDimensionKey { |
| 44 | repeated FieldValue dimension_key_in_what = 1; |
| 45 | repeated FieldValue state_values_key = 2; |
| 46 | } |
| 47 | |
Jeffrey Huang | b8f5403 | 2020-03-23 13:42:42 -0700 | [diff] [blame] | 48 | message 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 | |
Jeffrey Huang | 8a617e0 | 2020-03-19 15:38:43 -0700 | [diff] [blame] | 54 | message AlertMetadata { |
| 55 | optional int64 alert_id = 1; |
Jeffrey Huang | b8f5403 | 2020-03-23 13:42:42 -0700 | [diff] [blame] | 56 | repeated AlertDimensionKeyedData alert_dim_keyed_data = 2; |
Jeffrey Huang | 8a617e0 | 2020-03-19 15:38:43 -0700 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | // All metadata for a config in statsd |
| 60 | message StatsMetadata { |
| 61 | optional ConfigKey config_key = 1; |
| 62 | repeated AlertMetadata alert_metadata = 2; |
| 63 | } |
| 64 | |
| 65 | message StatsMetadataList { |
| 66 | repeated StatsMetadata stats_metadata = 1; |
| 67 | } |