xref: /aosp_15_r20/external/perfetto/protos/perfetto/metrics/android/android_anomaly_metric.proto (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1/*
2 * Copyright (C) 2024 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 perfetto.protos;
20
21// Detects outlier scenarios in different Android Systems in a trace. For now, this just
22// detects high binder transaction rates. In the future, there could be others
23// like garbage_collection, CPU, broadcasts, etc.
24message AndroidAnomalyMetric {
25
26  enum Unit {
27      UNIT_UNSPECIFIED = 0;
28      COUNT_PER_SECOND = 1;
29  }
30
31  // For anomalies related to a particular process.
32  message ProcessAnomaly {
33    optional string process_name = 1;
34    optional uint32 pid = 2;
35    optional Unit unit = 3;
36    optional uint32 value = 4;
37  }
38
39  // Binder subsystem outliers with the following aggegations:
40  // 1. Max incoming binder transaction count from each process over a one second sliding window.
41  // 2. Max outgoing binder transaction count from each process over a one second sliding window.
42  message Binder {
43      repeated ProcessAnomaly max_incoming_process_count_per_second = 1;
44      repeated ProcessAnomaly max_outgoing_process_count_per_second = 2;
45  }
46
47  optional Binder binder = 1;
48}
49