class SystemData

Defined at line 56 of file ../../third_party/cobalt/src/system_data/system_data.h

The embedding client creates a singleton instance of SystemData at start-up

time and uses it to query data about the client's running system. There

are two categories of data: static data about the system encapsulated in

the SystemProfile, and dynamic stateful data about the running system.

Public Methods

void SystemData (const std::string & product_name, const std::string & board_name_suggestion, ReleaseStage release_stage, const std::string & version, SystemProfile::BuildType build_type, const std::vector<int64_t> & experiment_ids)

Constructor: Uses the real SystemProfile of the actual running system.

|product_name|: The value to use for the |product_name| field of the

embedded SystemProfile.

|board_name_suggestion|: A suggestion for the value to use for the

|board_name| field of the embedded SystemProfile. This may be ignored if

SystemData is able to determine the board name directly. A value of ""

indicates that the caller has no information about board name, so one

should be guessed.

|release_stage|: The ReleaseStage of the running system.

|build_type|: The BuildType of the running system.

|version|: The version of the running system. The use of this field is

system-specific. For example on Fuchsia a possible value for |version| is

"20190220_01_RC00".

|experiment_ids|: A list of experiments that are active on the device.

void SetAppVersion (const std::string & app_version)

Resets the current app version. Do not set this field if Cobalt runs as a service.

void SetChannel (std::optional<std::string> channel)

Resets the current channel value.

void ResetInternalMetrics (logger::InternalMetrics * internal_metrics)
void OnChange (std::function<void ()> callback)
void OverrideSystemProfile (const SystemProfile & profile)

Overrides the stored SystemProfile. Useful for testing.

void FilteredSystemProfile (const ReportDefinition & report, const SystemProfile & profile_in, SystemProfile * profile_out)

Filters a SystemProfile to only the SystemProfileFields in the given ReportDefinition.

void ~SystemData ()

Defined at line 84 of file ../../third_party/cobalt/src/system_data/system_data.h

void SystemData (const SystemData & )

Make SystemData move-only

Defined at line 87 of file ../../third_party/cobalt/src/system_data/system_data.h

SystemData & operator= (const SystemData & )

Defined at line 88 of file ../../third_party/cobalt/src/system_data/system_data.h

const SystemProfile & system_profile ()

Returns the SystemProfile for the current system.

Defined at line 91 of file ../../third_party/cobalt/src/system_data/system_data.h

const std::string & app_version ()

Defined at line 96 of file ../../third_party/cobalt/src/system_data/system_data.h

const std::string & channel ()

Defined at line 101 of file ../../third_party/cobalt/src/system_data/system_data.h

const ReleaseStage & release_stage ()

Defined at line 103 of file ../../third_party/cobalt/src/system_data/system_data.h