class OdrMetrics final { public: // Enumeration used to track the latest stage reached running odrefresh. // // These values mirror those in OdrefreshReported::Stage in // frameworks/proto_logging/atoms/art/odrefresh_extension_atoms.proto. // NB There are gaps between the values in case an additional stages are introduced. enumclass Stage : uint8_t {
kUnknown = 0,
kCheck = 10,
kPreparation = 20,
kPrimaryBootClasspath = 30,
kSecondaryBootClasspath = 40,
kSystemServerClasspath = 50,
kComplete = 60,
};
// Enumeration describing the overall status, processing stops on the first error discovered. // // These values mirror those in OdrefreshReported::Status in // frameworks/proto_logging/atoms/art/odrefresh_extension_atoms.proto. enumclass Status : uint8_t {
kUnknown = 0,
kOK = 1,
kNoSpace = 2,
kIoError = 3,
kDex2OatError = 4, // Value 5 was kTimeLimitExceeded, but has been removed in favour of // reporting the exit code for Dex2Oat (set to ExecResult::kTimedOut)
kStagingFailed = 6,
kInstallFailed = 7, // Failed to access the dalvik-cache directory due to lack of permission.
kDalvikCachePermissionDenied = 8,
};
// Enumeration describing the cause of compilation (if any) in odrefresh. // // These values mirror those in OdrefreshReported::Trigger in // frameworks/proto_logging/atoms/art/odrefresh_extension_atoms.proto. enumclass Trigger : uint8_t {
kUnknown = 0,
kApexVersionMismatch = 1,
kDexFilesChanged = 2,
kMissingArtifacts = 3,
};
// Enumeration describing the type of boot classpath compilation in odrefresh. // // These values mirror those in OdrefreshReported::BcpCompilationType in // frameworks/proto_logging/atoms/art/odrefresh_extension_atoms.proto. enumclass BcpCompilationType : uint8_t {
kUnknown = 0, // Compiles for both the primary boot image and the mainline extension.
kPrimaryAndMainline = 1, // Only compiles for the mainline extension.
kMainline = 2,
};
// Gets the ART APEX that metrics are being collected on behalf of.
int64_t GetArtApexVersion() const { return art_apex_version_; }
// Sets the ART APEX that metrics are being collected on behalf of. void SetArtApexVersion(int64_t version) { art_apex_version_ = version; }
// Gets the ART APEX last update time in milliseconds.
int64_t GetArtApexLastUpdateMillis() const { return art_apex_last_update_millis_; }
// Sets the ART APEX last update time in milliseconds. void SetArtApexLastUpdateMillis(int64_t last_update_millis) {
art_apex_last_update_millis_ = last_update_millis;
}
// Gets the trigger for metrics collection. The trigger is the reason why odrefresh considers // compilation necessary.
Trigger GetTrigger() const { return trigger_; }
// Sets the trigger for metrics collection. The trigger is the reason why odrefresh considers // compilation necessary. Only call this method if compilation is necessary as the presence // of a trigger means we will try to record and upload metrics. void SetTrigger(const Trigger trigger) { trigger_ = trigger; }
// Sets the execution status of the current odrefresh processing stage. void SetStatus(const Status status) { status_ = status; }
// Sets the current odrefresh processing stage. void SetStage(Stage stage) { stage_ = stage; }
// Sets the result of the current dex2oat invocation. void SetDex2OatResult(Stage stage,
int64_t compilation_time, const std::optional<ExecResult>& dex2oat_result);
// The total time spent on compiling primary BCP.
int32_t primary_bcp_compilation_millis_ = 0;
// The result of the dex2oat invocation for compiling primary BCP, or `std::nullopt` if dex2oat is // not invoked.
std::optional<ExecResult> primary_bcp_dex2oat_result_;
// The total time spent on compiling secondary BCP.
int32_t secondary_bcp_compilation_millis_ = 0;
// The result of the dex2oat invocation for compiling secondary BCP, or `std::nullopt` if dex2oat // is not invoked.
std::optional<ExecResult> secondary_bcp_dex2oat_result_;
// The total time spent on compiling system server.
int32_t system_server_compilation_millis_ = 0;
// The result of the last dex2oat invocation for compiling system server, or `std::nullopt` if // dex2oat is not invoked.
std::optional<ExecResult> system_server_dex2oat_result_;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.