1713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato/*
2713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * Copyright (C) 2016 The Android Open Source Project
3713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato *
4713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * Licensed under the Apache License, Version 2.0 (the "License");
5713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * you may not use this file except in compliance with the License.
6713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * You may obtain a copy of the License at
7713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato *
8713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato *      http://www.apache.org/licenses/LICENSE-2.0
9713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato *
10713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * Unless required by applicable law or agreed to in writing, software
11713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * distributed under the License is distributed on an "AS IS" BASIS,
12713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * See the License for the specific language governing permissions and
14713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * limitations under the License.
15713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato */
16713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato
17713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onoratopackage android.os.health;
18713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato
19713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato/**
20713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * Keys for {@link HealthStats} returned from
21713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * {@link HealthStats#getStats(int) HealthStats.getStats(int)} with the
22713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato * {@link UidHealthStats#STATS_PROCESSES UidHealthStats.STATS_PROCESSES} key.
23713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato */
24713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onoratopublic final class ProcessHealthStats {
25713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato
26713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    private ProcessHealthStats() {
27713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    }
28713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato
29181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato    /**
30181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     * Key for a measurement of number of millseconds the CPU spent running in user space
31181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     * for this process.
32181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     */
33713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
34713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    public static final int MEASUREMENT_USER_TIME_MS = HealthKeys.BASE_PROCESS + 1;
35713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato
36181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato    /**
37181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     * Key for a measurement of number of millseconds the CPU spent running in kernel space
38181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     * for this process.
39181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     */
40713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
41713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    public static final int MEASUREMENT_SYSTEM_TIME_MS = HealthKeys.BASE_PROCESS + 2;
42713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato
43181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato    /**
44181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     * Key for a measurement of the number of times this process was started for any reason.
45181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     */
46713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
47713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    public static final int MEASUREMENT_STARTS_COUNT = HealthKeys.BASE_PROCESS + 3;
48713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato
49181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato    /**
50181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     * Key for a measurement of the number of crashes that happened in this process.
51181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     */
52713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
53713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    public static final int MEASUREMENT_CRASHES_COUNT = HealthKeys.BASE_PROCESS + 4;
54713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato
55181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato    /**
56181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     * Key for a measurement of the number of ANRs that happened in this process.
57181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     */
58713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
59713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    public static final int MEASUREMENT_ANR_COUNT = HealthKeys.BASE_PROCESS + 5;
60713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato
61181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato    /**
62181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     * Key for a measurement of the number of milliseconds this process spent with
63181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     * an activity in the foreground.
64181cada18a9feab90627ab27070bc00c29ec337aJoe Onorato     */
65713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
66713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    public static final int MEASUREMENT_FOREGROUND_MS = HealthKeys.BASE_PROCESS + 6;
67713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato
68713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    /**
69713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato     * @hide
70713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato     */
71713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato    public static final HealthKeys.Constants CONSTANTS = new HealthKeys.Constants(ProcessHealthStats.class);
72713fec85b8612256211f09c62b8958a99fe5b9dbJoe Onorato}
73