blob: b3f0dfc50066d07680b5c8ce6137822c9e33f064 [file] [log] [blame]
Joe Onorato713fec82016-03-04 10:34:02 -08001/*
2 * Copyright (C) 2016 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
17package android.os.health;
18
19/**
20 * Keys for {@link HealthStats} returned from
21 * {@link HealthStats#getStats(int) HealthStats.getStats(int)} with the
22 * {@link UidHealthStats#STATS_PROCESSES UidHealthStats.STATS_PROCESSES} key.
23 */
24public final class ProcessHealthStats {
25
26 private ProcessHealthStats() {
27 }
28
Joe Onorato181cada2016-05-09 10:31:41 -070029 /**
30 * Key for a measurement of number of millseconds the CPU spent running in user space
31 * for this process.
32 */
Joe Onorato713fec82016-03-04 10:34:02 -080033 @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
34 public static final int MEASUREMENT_USER_TIME_MS = HealthKeys.BASE_PROCESS + 1;
35
Joe Onorato181cada2016-05-09 10:31:41 -070036 /**
37 * Key for a measurement of number of millseconds the CPU spent running in kernel space
38 * for this process.
39 */
Joe Onorato713fec82016-03-04 10:34:02 -080040 @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
41 public static final int MEASUREMENT_SYSTEM_TIME_MS = HealthKeys.BASE_PROCESS + 2;
42
Joe Onorato181cada2016-05-09 10:31:41 -070043 /**
44 * Key for a measurement of the number of times this process was started for any reason.
45 */
Joe Onorato713fec82016-03-04 10:34:02 -080046 @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
47 public static final int MEASUREMENT_STARTS_COUNT = HealthKeys.BASE_PROCESS + 3;
48
Joe Onorato181cada2016-05-09 10:31:41 -070049 /**
50 * Key for a measurement of the number of crashes that happened in this process.
51 */
Joe Onorato713fec82016-03-04 10:34:02 -080052 @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
53 public static final int MEASUREMENT_CRASHES_COUNT = HealthKeys.BASE_PROCESS + 4;
54
Joe Onorato181cada2016-05-09 10:31:41 -070055 /**
56 * Key for a measurement of the number of ANRs that happened in this process.
57 */
Joe Onorato713fec82016-03-04 10:34:02 -080058 @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
59 public static final int MEASUREMENT_ANR_COUNT = HealthKeys.BASE_PROCESS + 5;
60
Joe Onorato181cada2016-05-09 10:31:41 -070061 /**
62 * Key for a measurement of the number of milliseconds this process spent with
63 * an activity in the foreground.
64 */
Joe Onorato713fec82016-03-04 10:34:02 -080065 @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
66 public static final int MEASUREMENT_FOREGROUND_MS = HealthKeys.BASE_PROCESS + 6;
67
68 /**
69 * @hide
70 */
71 public static final HealthKeys.Constants CONSTANTS = new HealthKeys.Constants(ProcessHealthStats.class);
72}