class LoggerInterface
Defined at line 21 of file ../../third_party/cobalt/src/logger/logger_interface.h
Logger is the client-facing interface to Cobalt.
LoggerInterface is an abstract interface to Logger that allows Logger to
be mocked out in tests.
Public Methods
Status LogOccurrence (uint32_t metric_id, uint64_t count, const std::vector<uint32_t> & event_codes)
Logs that an event has occurred a given number of times.
|metric_id| ID of the Metric the logged Event will belong to. It must
be one of the Metrics from the ProjectContext passed to the constructor,
and it must be of type OCCURRENCE.
|count| The number of times the event occurred. One may choose to
always set this value to 1 if events are logged every time they occur.
|event_codes| The event codes for the event that occurred. There must be
one for each metric dimension specified in the MetricDefinition. Use the
empty vector if no metric dimensions have been defined.
Status LogInteger (uint32_t metric_id, int64_t value, const std::vector<uint32_t> & event_codes)
Logs a measured integer value.
|metric_id| ID of the Metric the logged Event will belong to. It must
be one of the Metrics from the ProjectContext passed to the constructor,
and it must be of type INTEGER.
|value| The integer measured.
|event_codes| The event codes for the event that occurred. There must be
one for each metric dimension specified in the MetricDefinition. Use the
empty vector if no metric dimensions have been defined.
Status LogIntegerHistogram (uint32_t metric_id, HistogramPtr histogram, const std::vector<uint32_t> & event_codes)
Logs a histogram over a set of integer buckets. The meaning of the
Metric and the buckets is specified in the Metric definition.
|metric_id| ID of the Metric the logged Event will belong to. It must
be one of the Metrics from the ProjectContext passed to the constructor,
and it must be of type INTEGER_HISTOGRAM.
|histogram| The histogram to log. Each HistogramBucket gives the count
for one bucket of the histogram. The definitions of the buckets is
given in the Metric definition.
|event_codes| The event codes for the event that occurred. There must be
one for each metric dimension specified in the MetricDefinition. Use the
empty vector if no metric dimensions have been defined.
Status LogString (uint32_t metric_id, const std::string & string_value, const std::vector<uint32_t> & event_codes)
Logs a string value that was observed.
|metric_id| ID of the Metric the logged Event will belong to. It must
be one of the Metrics from the ProjectContext passed to the constructor,
and it must be of type STRING.
|string_value| The string that was observed.
|event_codes| The event codes for the event that occurred. There must be
one for each metric dimension specified in the MetricDefinition. Use the
empty vector if no metric dimensions have been defined.
void LoggerInterface (const LoggerInterface & )
LoggerInterface should be move-only
Defined at line 24 of file ../../third_party/cobalt/src/logger/logger_interface.h
LoggerInterface & operator= (const LoggerInterface & )
Defined at line 25 of file ../../third_party/cobalt/src/logger/logger_interface.h
void LoggerInterface ()
Defined at line 26 of file ../../third_party/cobalt/src/logger/logger_interface.h
void RecordLoggerCall (LoggerCallsMadeMigratedMetricDimensionLoggerMethod method)
LoggerCalled (cobalt_internal::metrics::logger_calls_made_migrated) is logged
for every call to Logger along with which method was called.
void PauseInternalLogging ()
Pauses Cobalt's internal metrics collection.
void ResumeInternalLogging ()
Resumes Cobalt's internal metrics collection.
void ~LoggerInterface ()
Defined at line 28 of file ../../third_party/cobalt/src/logger/logger_interface.h