pub struct RecorderSynchronousProxy { /* private fields */ }
Implementations§
Source§impl RecorderSynchronousProxy
impl RecorderSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<RecorderEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<RecorderEvent, 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 start_logging(
&self,
client_id: &str,
metrics: &[Metric],
duration_ms: u32,
output_samples_to_syslog: bool,
output_stats_to_syslog: bool,
___deadline: MonotonicInstant,
) -> Result<RecorderStartLoggingResult, Error>
pub fn start_logging( &self, client_id: &str, metrics: &[Metric], duration_ms: u32, output_samples_to_syslog: bool, output_stats_to_syslog: bool, ___deadline: MonotonicInstant, ) -> Result<RecorderStartLoggingResult, Error>
Initiates logging of specified metrics for the provided duration.
Supports concurrent logging of different metrics. Logging may be
terminated early with a call to StopLogging
.
This call will fail if logging of the specified metric is already
active. For this reason, a client may wish to precede a StartLogging
call with a StopLogging
call, after which the only reason for The
logger to be active would be a conflict with another client.
- request
client_id
String format Id of the client. Client may choose any Id with a maximum byte size of 8 (e.g., “ffxTest”). - request
metrics
Type of the metrics to be polled and logged. - request
duration_ms
Duration of logging in milliseconds. After this duration, polling and logging will cease. - request
output_samples_to_syslog
Toggle for outputting raw data to syslog. - request
output_stats_to_syslog
Toggle for outputting any available statistics to syslog. - error a [fuchsia.metrics.test/MeticsLoggerError] value indicating why the request failed.
Sourcepub fn start_logging_forever(
&self,
client_id: &str,
metrics: &[Metric],
output_samples_to_syslog: bool,
output_stats_to_syslog: bool,
___deadline: MonotonicInstant,
) -> Result<RecorderStartLoggingForeverResult, Error>
pub fn start_logging_forever( &self, client_id: &str, metrics: &[Metric], output_samples_to_syslog: bool, output_stats_to_syslog: bool, ___deadline: MonotonicInstant, ) -> Result<RecorderStartLoggingForeverResult, Error>
Initiates logging of specified metrics. Supports concurrent logging of
different metrics. Logging will only end upon a StopLogging
call.
StartLogging
should be preferred for usage in automated tests to
ensure that logging terminates even if the test crashes.
- request
client_id
String format Id of the client. Client may choose any Id with a maximum byte size of 8 (e.g., “ffxTest”). - request
metrics
Type of the metrics to be polled and logged. - request
output_samples_to_syslog
Toggle for outputting raw data to syslog. - request
output_stats_to_syslog
Toggle for outputting any available statistics to syslog. - error a [fuchsia.metrics.test/RecorderError] value indicating why the request failed.
Sourcepub fn stop_logging(
&self,
client_id: &str,
___deadline: MonotonicInstant,
) -> Result<bool, Error>
pub fn stop_logging( &self, client_id: &str, ___deadline: MonotonicInstant, ) -> Result<bool, Error>
Terminates all active logging tasks with the given client_id. It is valid to call this method when logging is inactive.
- request
client_id
String format Id of the client.
- response
status
A bool value indicating if existing logging was stopped (true) or there’sno existing logging for the client.
Trait Implementations§
Source§impl Debug for RecorderSynchronousProxy
impl Debug for RecorderSynchronousProxy
Source§impl SynchronousProxy for RecorderSynchronousProxy
impl SynchronousProxy for RecorderSynchronousProxy
Source§type Proxy = RecorderProxy
type Proxy = RecorderProxy
Source§type Protocol = RecorderMarker
type Protocol = RecorderMarker
Proxy
controls.