Joe Onorato | 713fec8 | 2016-03-04 10:34:02 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package 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 | */ |
| 24 | public final class ProcessHealthStats { |
| 25 | |
| 26 | private ProcessHealthStats() { |
| 27 | } |
| 28 | |
Joe Onorato | 181cada | 2016-05-09 10:31:41 -0700 | [diff] [blame] | 29 | /** |
| 30 | * Key for a measurement of number of millseconds the CPU spent running in user space |
| 31 | * for this process. |
| 32 | */ |
Joe Onorato | 713fec8 | 2016-03-04 10:34:02 -0800 | [diff] [blame] | 33 | @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT) |
| 34 | public static final int MEASUREMENT_USER_TIME_MS = HealthKeys.BASE_PROCESS + 1; |
| 35 | |
Joe Onorato | 181cada | 2016-05-09 10:31:41 -0700 | [diff] [blame] | 36 | /** |
| 37 | * Key for a measurement of number of millseconds the CPU spent running in kernel space |
| 38 | * for this process. |
| 39 | */ |
Joe Onorato | 713fec8 | 2016-03-04 10:34:02 -0800 | [diff] [blame] | 40 | @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT) |
| 41 | public static final int MEASUREMENT_SYSTEM_TIME_MS = HealthKeys.BASE_PROCESS + 2; |
| 42 | |
Joe Onorato | 181cada | 2016-05-09 10:31:41 -0700 | [diff] [blame] | 43 | /** |
| 44 | * Key for a measurement of the number of times this process was started for any reason. |
| 45 | */ |
Joe Onorato | 713fec8 | 2016-03-04 10:34:02 -0800 | [diff] [blame] | 46 | @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT) |
| 47 | public static final int MEASUREMENT_STARTS_COUNT = HealthKeys.BASE_PROCESS + 3; |
| 48 | |
Joe Onorato | 181cada | 2016-05-09 10:31:41 -0700 | [diff] [blame] | 49 | /** |
| 50 | * Key for a measurement of the number of crashes that happened in this process. |
| 51 | */ |
Joe Onorato | 713fec8 | 2016-03-04 10:34:02 -0800 | [diff] [blame] | 52 | @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT) |
| 53 | public static final int MEASUREMENT_CRASHES_COUNT = HealthKeys.BASE_PROCESS + 4; |
| 54 | |
Joe Onorato | 181cada | 2016-05-09 10:31:41 -0700 | [diff] [blame] | 55 | /** |
| 56 | * Key for a measurement of the number of ANRs that happened in this process. |
| 57 | */ |
Joe Onorato | 713fec8 | 2016-03-04 10:34:02 -0800 | [diff] [blame] | 58 | @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT) |
| 59 | public static final int MEASUREMENT_ANR_COUNT = HealthKeys.BASE_PROCESS + 5; |
| 60 | |
Joe Onorato | 181cada | 2016-05-09 10:31:41 -0700 | [diff] [blame] | 61 | /** |
| 62 | * Key for a measurement of the number of milliseconds this process spent with |
| 63 | * an activity in the foreground. |
| 64 | */ |
Joe Onorato | 713fec8 | 2016-03-04 10:34:02 -0800 | [diff] [blame] | 65 | @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 | } |