| /* |
| * Copyright (C) 2017 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| syntax = "proto2"; |
| option optimize_for = LITE_RUNTIME; |
| |
| package android.os.statsd; |
| |
| option java_package = "com.android.os"; |
| option java_outer_classname = "StatsLog"; |
| |
| import "frameworks/base/cmds/statsd/src/atoms.proto"; |
| |
| message KeyValuePair { |
| optional int32 key = 1; |
| |
| oneof value { |
| string value_str = 2; |
| int64 value_int = 3; |
| bool value_bool = 4; |
| float value_float = 5; |
| } |
| } |
| |
| message EventMetricData { |
| optional int64 timestamp_nanos = 1; |
| |
| optional Atom atom = 2; |
| } |
| |
| message CountBucketInfo { |
| optional int64 start_bucket_nanos = 1; |
| |
| optional int64 end_bucket_nanos = 2; |
| |
| optional int64 count = 3; |
| } |
| |
| message CountMetricData { |
| repeated KeyValuePair dimension = 1; |
| |
| repeated CountBucketInfo bucket_info = 2; |
| } |
| |
| message DurationBucketInfo { |
| optional int64 start_bucket_nanos = 1; |
| |
| optional int64 end_bucket_nanos = 2; |
| |
| optional int64 duration_nanos = 3; |
| } |
| |
| message DurationMetricData { |
| repeated KeyValuePair dimension = 1; |
| |
| repeated DurationBucketInfo bucket_info = 2; |
| } |
| |
| message ValueBucketInfo { |
| optional int64 start_bucket_nanos = 1; |
| |
| optional int64 end_bucket_nanos = 2; |
| |
| optional int64 value = 3; |
| } |
| |
| message ValueMetricData { |
| repeated KeyValuePair dimension = 1; |
| |
| repeated ValueBucketInfo bucket_info = 2; |
| } |
| |
| message GaugeBucketInfo { |
| optional int64 start_bucket_nanos = 1; |
| |
| optional int64 end_bucket_nanos = 2; |
| |
| optional int64 gauge = 3; |
| } |
| |
| message GaugeMetricData { |
| repeated KeyValuePair dimension = 1; |
| |
| repeated GaugeBucketInfo bucket_info = 2; |
| } |
| |
| message UidMapping { |
| message PackageInfoSnapshot { |
| message PackageInfo { |
| optional string name = 1; |
| |
| optional int64 version = 2; |
| |
| optional int32 uid = 3; |
| } |
| optional int64 timestamp_nanos = 1; |
| |
| repeated PackageInfo package_info = 2; |
| } |
| repeated PackageInfoSnapshot snapshots = 1; |
| |
| message Change { |
| optional bool deletion = 1; |
| |
| optional int64 timestamp_nanos = 2; |
| optional string app = 3; |
| optional int32 uid = 4; |
| |
| optional int64 version = 5; |
| } |
| repeated Change changes = 2; |
| } |
| |
| message StatsLogReport { |
| optional string metric_name = 1; |
| |
| optional int64 start_report_nanos = 2; |
| |
| optional int64 end_report_nanos = 3; |
| |
| message EventMetricDataWrapper { |
| repeated EventMetricData data = 1; |
| } |
| message CountMetricDataWrapper { |
| repeated CountMetricData data = 1; |
| } |
| message DurationMetricDataWrapper { |
| repeated DurationMetricData data = 1; |
| } |
| message ValueMetricDataWrapper { |
| repeated ValueMetricData data = 1; |
| } |
| |
| message GaugeMetricDataWrapper { |
| repeated GaugeMetricData data = 1; |
| } |
| |
| oneof data { |
| EventMetricDataWrapper event_metrics = 4; |
| CountMetricDataWrapper count_metrics = 5; |
| DurationMetricDataWrapper duration_metrics = 6; |
| ValueMetricDataWrapper value_metrics = 7; |
| GaugeMetricDataWrapper gauge_metrics = 8; |
| } |
| } |
| |
| message ConfigMetricsReport { |
| repeated StatsLogReport metrics = 1; |
| |
| optional UidMapping uid_map = 2; |
| } |
| |
| message ConfigMetricsReportList { |
| message ConfigKey { |
| optional int32 uid = 1; |
| optional string name = 2; |
| } |
| optional ConfigKey config_key = 1; |
| |
| repeated ConfigMetricsReport reports = 2; |
| } |
| |
| message StatsdStatsReport { |
| optional int32 stats_begin_time_sec = 1; |
| |
| optional int32 stats_end_time_sec = 2; |
| |
| message MatcherStats { |
| optional string name = 1; |
| optional int32 matched_times = 2; |
| } |
| |
| message ConditionStats { |
| optional string name = 1; |
| optional int32 max_tuple_counts = 2; |
| } |
| |
| message MetricStats { |
| optional string name = 1; |
| optional int32 max_tuple_counts = 2; |
| } |
| |
| message AlertStats { |
| optional string name = 1; |
| optional int32 alerted_times = 2; |
| } |
| |
| message ConfigStats { |
| optional int32 uid = 1; |
| optional string name = 2; |
| optional int32 creation_time_sec = 3; |
| optional int32 deletion_time_sec = 4; |
| optional int32 metric_count = 5; |
| optional int32 condition_count = 6; |
| optional int32 matcher_count = 7; |
| optional int32 alert_count = 8; |
| optional bool is_valid = 9; |
| |
| repeated int32 broadcast_sent_time_sec = 10; |
| repeated int32 data_drop_time_sec = 11; |
| repeated int32 dump_report_time_sec = 12; |
| repeated MatcherStats matcher_stats = 13; |
| repeated ConditionStats condition_stats = 14; |
| repeated MetricStats metric_stats = 15; |
| repeated AlertStats alert_stats = 16; |
| } |
| |
| repeated ConfigStats config_stats = 3; |
| |
| message AtomStats { |
| optional int32 tag = 1; |
| optional int32 count = 2; |
| } |
| |
| repeated AtomStats atom_stats = 7; |
| |
| message UidMapStats { |
| optional int32 snapshots = 1; |
| optional int32 changes = 2; |
| optional int32 bytes_used = 3; |
| optional int32 dropped_snapshots = 4; |
| optional int32 dropped_changes = 5; |
| } |
| optional UidMapStats uidmap_stats = 8; |
| |
| message AnomalyAlarmStats { |
| optional int32 alarms_registered = 1; |
| } |
| optional AnomalyAlarmStats anomaly_alarm_stats = 9; |
| } |