class MetricsReporter

Defined at line 21 of file ../../src/camera/bin/device/metrics_reporter.h

|MetricsReporter| handles instrumentation concerns (e.g. exposing information via inspect,

cobalt, etc) for a camera device instance.

Public Methods

void ~MetricsReporter ()

Defined at line 23 of file ../../src/camera/bin/device/metrics_reporter.h

const inspect::Inspector & inspector ()

Get a reference to the inspector object.

Defined at line 48 of file ../../src/camera/bin/device/metrics_reporter.h

MetricsReporter & Get ()

Gets a reference to the MetricsReporter object.

Returns a reference of a static MetricsReporter object. If this is called before

MetricsReporter::Initialize(), a nop version of MetricsReporter is returned and swallows all

log requests.

Defined at line 142 of file ../../src/camera/bin/device/metrics_reporter.cc

void Initialize (sys::ComponentContext & context, bool enable_cobalt)

Initializes the MetricsReporter object.

|context| References to the services and connections this component was launched with.

|enable_cobalt| When this boolean argument is true, MetricsReporter initializes the

CobaltLogger and report collected metrics.

Defined at line 156 of file ../../src/camera/bin/device/metrics_reporter.cc

std::unique_ptr<ConfigurationRecord> CreateConfigurationRecord (uint32_t index, size_t num_streams)

Creates a ConfigurationRecord object that collects metrics from each device configurations.

|index| The index of the device configuration that will be associated with this

ConfigurationRecord object.

|num_streams| This is the number of streams that the configuration with a given index has.

Defined at line 196 of file ../../src/camera/bin/device/metrics_reporter.cc

std::unique_ptr<FailureTestRecord> CreateFailureTestRecord (FailureTestRecordType type, bool initial_failure, std::optional<uint32_t> config_index, std::optional<uint32_t> stream_index)

Creates a FailureTestRecord representing a potential failure occurrence. When the class is

destroyed, the occurrence is logged as either failure or non-failure depending on its state at

the time of destruction. Callers can use the |initial_failure| parameter and ignore the

returned record to provide immediate-mode recording.

|type| The failure class for the record.

|initial_failure| The initial failure state of the record.

|config_index| If specified, the configuration this failure applies to.

|stream_index| If specified, the stream this failure applies to.

Defined at line 202 of file ../../src/camera/bin/device/metrics_reporter.cc

Records