class Logger

Defined at line 27 of file ../../src/developer/forensics/utils/cobalt/logger.h

Log events to cobalt.

Public Methods

void LogIntegerEvent (uint32_t metric_id, uint64_t count)

Log event with no dimensions.

Defined at line 34 of file ../../src/developer/forensics/utils/cobalt/logger.h

void Logger (async_dispatcher_t * dispatcher, std::shared_ptr<sys::ServiceDirectory> services, timekeeper::Clock * clock)

We expect fuchsia.metrics.MetricEventLoggerFactory to be in |services|.

Defined at line 34 of file ../../src/developer/forensics/utils/cobalt/logger.cc

template <typename... DimensionTypes>
void LogOccurrence (DimensionTypes... dimensions)

Log event with fuchsia.metrics.MetricEventLogger with the provided parameters. If the service

is not accessible, keep the parameters to try again later.

Defined at line 41 of file ../../src/developer/forensics/utils/cobalt/logger.h

template <typename DimensionType>
void LogCount (DimensionType dimension, uint64_t count)

Log event with fuchsia.metrics.MetricEventLogger with the provided parameters. If the service

is not accessible, keep the parameters to try again later.

Defined at line 48 of file ../../src/developer/forensics/utils/cobalt/logger.h

template <typename DimensionType>
void LogElapsedTime (DimensionType dimension, uint64_t timer_id)

Log the time elapsed in microseconds since starting the timer with id |timer_id| with

fuchsia.metrics.MetricEventLogger. If the service is not accessible, keep the parameters to

try again later.

This does not stop the timer.

Defined at line 62 of file ../../src/developer/forensics/utils/cobalt/logger.h

template <typename DimensionType>
void LogDuration (DimensionType dimension, zx::duration duration)

Log a duration in microseconds. If the service is not accessible, keep the parameters to try

again later.

Defined at line 69 of file ../../src/developer/forensics/utils/cobalt/logger.h

uint64_t StartTimer ()

Start a timer and return the id to that timer. The id is needed to log the elapsed time since

starting the timer.

Defined at line 114 of file ../../src/developer/forensics/utils/cobalt/logger.cc