pub struct MetricsLoggerProxy { /* private fields */ }
Implementations§
source§impl MetricsLoggerProxy
impl MetricsLoggerProxy
sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.metricslogger.test/MetricsLogger.
sourcepub fn take_event_stream(&self) -> MetricsLoggerEventStream
pub fn take_event_stream(&self) -> MetricsLoggerEventStream
Get a Stream of events from the remote end of the protocol.
Panics
Panics if the event stream was already taken.
sourcepub fn start_logging(
&self,
client_id: &str,
metrics: &[Metric],
duration_ms: u32,
output_samples_to_syslog: bool,
output_stats_to_syslog: bool
) -> QueryResponseFut<MetricsLoggerStartLoggingResult>
pub fn start_logging( &self, client_id: &str, metrics: &[Metric], duration_ms: u32, output_samples_to_syslog: bool, output_stats_to_syslog: bool ) -> QueryResponseFut<MetricsLoggerStartLoggingResult>
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
) -> QueryResponseFut<MetricsLoggerStartLoggingForeverResult>
pub fn start_logging_forever( &self, client_id: &str, metrics: &[Metric], output_samples_to_syslog: bool, output_stats_to_syslog: bool ) -> QueryResponseFut<MetricsLoggerStartLoggingForeverResult>
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/MetricsLoggerError] value indicating why the request failed.
sourcepub fn stop_logging(&self, client_id: &str) -> QueryResponseFut<bool>
pub fn stop_logging(&self, client_id: &str) -> QueryResponseFut<bool>
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 Clone for MetricsLoggerProxy
impl Clone for MetricsLoggerProxy
source§fn clone(&self) -> MetricsLoggerProxy
fn clone(&self) -> MetricsLoggerProxy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MetricsLoggerProxy
impl Debug for MetricsLoggerProxy
source§impl MetricsLoggerProxyInterface for MetricsLoggerProxy
impl MetricsLoggerProxyInterface for MetricsLoggerProxy
type StartLoggingResponseFut = QueryResponseFut<Result<(), MetricsLoggerError>>
fn start_logging( &self, client_id: &str, metrics: &[Metric], duration_ms: u32, output_samples_to_syslog: bool, output_stats_to_syslog: bool ) -> Self::StartLoggingResponseFut
type StartLoggingForeverResponseFut = QueryResponseFut<Result<(), MetricsLoggerError>>
fn start_logging_forever( &self, client_id: &str, metrics: &[Metric], output_samples_to_syslog: bool, output_stats_to_syslog: bool ) -> Self::StartLoggingForeverResponseFut
type StopLoggingResponseFut = QueryResponseFut<bool>
fn stop_logging(&self, client_id: &str) -> Self::StopLoggingResponseFut
source§impl Proxy for MetricsLoggerProxy
impl Proxy for MetricsLoggerProxy
§type Protocol = MetricsLoggerMarker
type Protocol = MetricsLoggerMarker
Proxy
controls.