xref: /aosp_15_r20/art/libartservice/service/proto/pre_reboot_stats.proto (revision 795d594fd825385562da6b089ea9b2033f3abf5a)
1*795d594fSAndroid Build Coastguard Worker/*
2*795d594fSAndroid Build Coastguard Worker * Copyright (C) 2024 The Android Open Source Project
3*795d594fSAndroid Build Coastguard Worker *
4*795d594fSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*795d594fSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*795d594fSAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*795d594fSAndroid Build Coastguard Worker *
8*795d594fSAndroid Build Coastguard Worker *      http://www.apache.org/licenses/LICENSE-2.0
9*795d594fSAndroid Build Coastguard Worker *
10*795d594fSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*795d594fSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*795d594fSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*795d594fSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*795d594fSAndroid Build Coastguard Worker * limitations under the License.
15*795d594fSAndroid Build Coastguard Worker */
16*795d594fSAndroid Build Coastguard Worker
17*795d594fSAndroid Build Coastguard Workersyntax = "proto3";
18*795d594fSAndroid Build Coastguard Worker
19*795d594fSAndroid Build Coastguard Workerpackage com.android.server.art.proto;
20*795d594fSAndroid Build Coastguard Workeroption java_multiple_files = true;
21*795d594fSAndroid Build Coastguard Worker
22*795d594fSAndroid Build Coastguard Worker// Pre-reboot Dexopt metrics to persist on disk for being reported after reboot.
23*795d594fSAndroid Build Coastguard Worker// This proto is persisted on disk and forward and backward compatibility are considerations.
24*795d594fSAndroid Build Coastguard Workermessage PreRebootStats {
25*795d594fSAndroid Build Coastguard Worker    // Overall status of the job right before the reboot.
26*795d594fSAndroid Build Coastguard Worker    // See `android.os.statsd.art.PreRebootDexoptJobEnded`.
27*795d594fSAndroid Build Coastguard Worker    enum Status {
28*795d594fSAndroid Build Coastguard Worker        STATUS_UNKNOWN = 0;
29*795d594fSAndroid Build Coastguard Worker        STATUS_SCHEDULED = 1;
30*795d594fSAndroid Build Coastguard Worker        STATUS_STARTED = 2;
31*795d594fSAndroid Build Coastguard Worker        STATUS_FAILED = 3;
32*795d594fSAndroid Build Coastguard Worker        STATUS_FINISHED = 4;
33*795d594fSAndroid Build Coastguard Worker        STATUS_CANCELLED = 5;
34*795d594fSAndroid Build Coastguard Worker        STATUS_ABORTED_SYSTEM_REQUIREMENTS = 6;
35*795d594fSAndroid Build Coastguard Worker        STATUS_NOT_SCHEDULED_DISABLED = 7;
36*795d594fSAndroid Build Coastguard Worker        STATUS_NOT_SCHEDULED_JOB_SCHEDULER = 8;
37*795d594fSAndroid Build Coastguard Worker    }
38*795d594fSAndroid Build Coastguard Worker    optional Status status = 1;
39*795d594fSAndroid Build Coastguard Worker
40*795d594fSAndroid Build Coastguard Worker    // Number of packages successfully optimized.
41*795d594fSAndroid Build Coastguard Worker    optional int32 optimized_package_count = 2;
42*795d594fSAndroid Build Coastguard Worker    // Number of packages failed to optimize.
43*795d594fSAndroid Build Coastguard Worker    optional int32 failed_package_count = 3;
44*795d594fSAndroid Build Coastguard Worker    // Number of packages skipped.
45*795d594fSAndroid Build Coastguard Worker    optional int32 skipped_package_count = 4;
46*795d594fSAndroid Build Coastguard Worker    // Total number of packages scanned.
47*795d594fSAndroid Build Coastguard Worker    optional int32 total_package_count = 5;
48*795d594fSAndroid Build Coastguard Worker
49*795d594fSAndroid Build Coastguard Worker    // When the job is scheduled, in milliseconds.
50*795d594fSAndroid Build Coastguard Worker    optional int64 job_scheduled_timestamp_millis = 6;
51*795d594fSAndroid Build Coastguard Worker
52*795d594fSAndroid Build Coastguard Worker    // Represents a job run.
53*795d594fSAndroid Build Coastguard Worker    message JobRun {
54*795d594fSAndroid Build Coastguard Worker        // When the job is started, in milliseconds.
55*795d594fSAndroid Build Coastguard Worker        optional int64 job_started_timestamp_millis = 1;
56*795d594fSAndroid Build Coastguard Worker        // When the job is ended (failed, finished, or cancelled), in milliseconds.
57*795d594fSAndroid Build Coastguard Worker        optional int64 job_ended_timestamp_millis = 2;
58*795d594fSAndroid Build Coastguard Worker    }
59*795d594fSAndroid Build Coastguard Worker
60*795d594fSAndroid Build Coastguard Worker    // All job runs. The job may be cancelled and rerun multiple times.
61*795d594fSAndroid Build Coastguard Worker    repeated JobRun job_runs = 7;
62*795d594fSAndroid Build Coastguard Worker
63*795d594fSAndroid Build Coastguard Worker    // Number of packages that have Pre-reboot Dexopt artifacts before the reboot. Note that this
64*795d594fSAndroid Build Coastguard Worker    // isn't necessarily equal to `optimized_package_count` because packages failed to be optimized
65*795d594fSAndroid Build Coastguard Worker    // may still have some splits successfully optimized.
66*795d594fSAndroid Build Coastguard Worker    optional int32 packages_with_artifacts_before_reboot_count = 8;
67*795d594fSAndroid Build Coastguard Worker
68*795d594fSAndroid Build Coastguard Worker    // The type of the job.
69*795d594fSAndroid Build Coastguard Worker    enum JobType {
70*795d594fSAndroid Build Coastguard Worker        JOB_TYPE_UNKNOWN = 0;
71*795d594fSAndroid Build Coastguard Worker        JOB_TYPE_OTA = 1;
72*795d594fSAndroid Build Coastguard Worker        JOB_TYPE_MAINLINE = 2;
73*795d594fSAndroid Build Coastguard Worker    }
74*795d594fSAndroid Build Coastguard Worker    optional JobType job_type = 9;
75*795d594fSAndroid Build Coastguard Worker}
76