class CodecMetrics

Defined at line 23 of file ../../src/media/lib/codec_impl/include/lib/media/codec_impl/codec_metrics.h

Methods of this class can be called on any thread.

TODO(https://fxbug.dev/42167507): This wrapper is temporary to minimize files with diffs in a CL for https://fxbug.dev/42167507.

We can switch to using MetricsBuffer/MetricBuffer directly in a later CL.

Public Methods

void CodecMetrics ()

A nop instance so unit tests don't need to wire up cobalt.

Defined at line 20 of file ../../src/media/lib/codec_impl/codec_metrics.cc

void CodecMetrics (std::shared_ptr<sys::ServiceDirectory> service_directory)

!service_directory is ok. If !service_directory, the instance will be a noop instance until

SetServiceDirectory() is called.

Defined at line 25 of file ../../src/media/lib/codec_impl/codec_metrics.cc

void ~CodecMetrics ()

Defined at line 31 of file ../../src/media/lib/codec_impl/codec_metrics.cc

void SetServiceDirectory (std::shared_ptr<sys::ServiceDirectory> service_directory)

Set the ServiceDirectory from which to get fuchsia.metrics.MetricEventLoggerFactory. This can

be nullptr. This can be called again, regardless of whether there was already a previous

ServiceDirectory. Previously-queued events may be lost (especially recently-queued events) when

switching to a new ServiceDirectory.

Defined at line 33 of file ../../src/media/lib/codec_impl/codec_metrics.cc

void LogEvent (media_metrics::StreamProcessorEvents2MigratedMetricDimensionImplementation implementation, media_metrics::StreamProcessorEvents2MigratedMetricDimensionEvent event)

Log the event as EVENT_COUNT, with period_duration_micros 0, possibly aggregating with any

other calls to this method with the same component and event wihtin a short duration to limit

the rate of FIDL calls to cobalt, per the rate requirement/recommendation in the cobalt docs.

No attempt is made to flush pending events before driver exit or suspend, since this driver

isn't expected to unbind very often, if ever, and if we're suspending already then it's

unlikely that the pending cobalt events would be persisted anyway.

Defined at line 37 of file ../../src/media/lib/codec_impl/codec_metrics.cc