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 | |
| 48 | message AlertMetadata { |
| 49 | optional int64 alert_id = 1; |
| 50 | // The earliest time the alert can be fired again in wall clock time. |
| 51 | optional int32 last_refractory_ends_sec = 2; |
| 52 | optional MetricDimensionKey dimension_key = 3; |
| 53 | } |
| 54 | |
| 55 | // All metadata for a config in statsd |
| 56 | message StatsMetadata { |
| 57 | optional ConfigKey config_key = 1; |
| 58 | repeated AlertMetadata alert_metadata = 2; |
| 59 | } |
| 60 | |
| 61 | message StatsMetadataList { |
| 62 | repeated StatsMetadata stats_metadata = 1; |
| 63 | } |