[go: nahoru, domu]

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
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
29    /**
30     * Key for a measurement of number of millseconds the CPU spent running in user space
31     * for this process.
32     */
33    @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
34    public static final int MEASUREMENT_USER_TIME_MS = HealthKeys.BASE_PROCESS + 1;
35
36    /**
37     * Key for a measurement of number of millseconds the CPU spent running in kernel space
38     * for this process.
39     */
40    @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
41    public static final int MEASUREMENT_SYSTEM_TIME_MS = HealthKeys.BASE_PROCESS + 2;
42
43    /**
44     * Key for a measurement of the number of times this process was started for any reason.
45     */
46    @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
47    public static final int MEASUREMENT_STARTS_COUNT = HealthKeys.BASE_PROCESS + 3;
48
49    /**
50     * Key for a measurement of the number of crashes that happened in this process.
51     */
52    @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
53    public static final int MEASUREMENT_CRASHES_COUNT = HealthKeys.BASE_PROCESS + 4;
54
55    /**
56     * Key for a measurement of the number of ANRs that happened in this process.
57     */
58    @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
59    public static final int MEASUREMENT_ANR_COUNT = HealthKeys.BASE_PROCESS + 5;
60
61    /**
62     * Key for a measurement of the number of milliseconds this process spent with
63     * an activity in the foreground.
64     */
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}
73