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: MonotonicInstant,
) -> Result<MetricEventLoggerQuerierEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> 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: MonotonicInstant,
) -> Result<(Vec<MetricEvent>, bool), Error>
pub fn watch_logs( &self, project_id: u32, method: LogMethod, ___deadline: MonotonicInstant, ) -> 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.
Trait Implementations§
Source§impl SynchronousProxy for MetricEventLoggerQuerierSynchronousProxy
impl SynchronousProxy for MetricEventLoggerQuerierSynchronousProxy
Source§type Proxy = MetricEventLoggerQuerierProxy
type Proxy = MetricEventLoggerQuerierProxy
Source§type Protocol = MetricEventLoggerQuerierMarker
type Protocol = MetricEventLoggerQuerierMarker
Proxy
controls.