pub enum MetricEventLoggerQuerierRequest {
WatchLogs {
project_id: u32,
method: LogMethod,
responder: MetricEventLoggerQuerierWatchLogsResponder,
},
ResetLogger {
project_id: u32,
method: LogMethod,
control_handle: MetricEventLoggerQuerierControlHandle,
},
}
Expand description
LoggerQuerier provides a way to query mock metrics services to check that clients of metrics are logging events as expected.
Variants§
WatchLogs
Returns the first N events that were logged for the logger with the
given project_id
and a more
flag indicating whether there were
more than N events logged. There is no way to retrieve events logged
after the first N events.
Will hang until at least one metrics metric is recorded for the given
project_id
and method
.
Repeated calls to WatchLogs for a given LogMethod will block until new events are logged with that method, enabling tests to synchronize without sleeps or timeouts.
ResetLogger
Clear all logged events by logging method
for the logger with the
given project_id
.
This is a no-op if a logger for the given project_id
does not exist.
Notably, it does not create a new logger with project_id
if one
does not already exist.
Implementations§
Source§impl MetricEventLoggerQuerierRequest
impl MetricEventLoggerQuerierRequest
pub fn into_watch_logs( self, ) -> Option<(u32, LogMethod, MetricEventLoggerQuerierWatchLogsResponder)>
pub fn into_reset_logger( self, ) -> Option<(u32, LogMethod, MetricEventLoggerQuerierControlHandle)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL