xref: /aosp_15_r20/external/perfetto/protos/perfetto/metrics/android/auto_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// Metrics for Multiuser events, such as switching users.
22message AndroidAutoMultiuserMetric {
23  message EventData {
24    // Id of the user the system has been switched to
25    optional int32 user_id = 1;
26
27    // The end event name for which the duration_ms is measured
28    optional string start_event = 2;
29
30    // The end event name for which the duration_ms is measured
31    optional string end_event = 3;
32
33    // Duration of the event (in milliseconds).
34    optional int64 duration_ms = 4;
35
36    // Previous user resource usage info during user switch
37    message UserData {
38      // Id of the user the system has been switched from
39      optional int32 user_id = 1;
40
41      optional int64 total_cpu_time_ms = 2;
42
43      optional int64 total_memory_usage_kb = 3;
44    }
45
46    optional UserData previous_user_info = 5;
47  }
48
49  // Metrics for a user switch.
50  repeated EventData user_switch = 1;
51}
52