pub struct MetricEventLoggerQuerierSynchronousProxy { /* private fields */ }
Implementations§
source§impl MetricEventLoggerQuerierSynchronousProxy
impl MetricEventLoggerQuerierSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
sourcepub fn wait_for_event(
&self,
deadline: Time
) -> Result<MetricEventLoggerQuerierEvent, Error>
pub fn wait_for_event( &self, deadline: Time ) -> Result<MetricEventLoggerQuerierEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
sourcepub fn watch_logs(
&self,
project_id: u32,
method: LogMethod,
___deadline: Time
) -> Result<(Vec<MetricEvent>, bool), Error>
pub fn watch_logs( &self, project_id: u32, method: LogMethod, ___deadline: Time ) -> Result<(Vec<MetricEvent>, bool), Error>
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.
sourcepub fn reset_logger(
&self,
project_id: u32,
method: LogMethod
) -> Result<(), Error>
pub fn reset_logger( &self, project_id: u32, method: LogMethod ) -> Result<(), Error>
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.