pub struct RecorderProxy { /* private fields */ }
Implementations§
Source§impl RecorderProxy
impl RecorderProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.power.metrics/Recorder.
Sourcepub fn take_event_stream(&self) -> RecorderEventStream
pub fn take_event_stream(&self) -> RecorderEventStream
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<RecorderStartLoggingResult, DefaultFuchsiaResourceDialect>
pub fn start_logging( &self, client_id: &str, metrics: &[Metric], duration_ms: u32, output_samples_to_syslog: bool, output_stats_to_syslog: bool, ) -> QueryResponseFut<RecorderStartLoggingResult, DefaultFuchsiaResourceDialect>
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<RecorderStartLoggingForeverResult, DefaultFuchsiaResourceDialect>
pub fn start_logging_forever( &self, client_id: &str, metrics: &[Metric], output_samples_to_syslog: bool, output_stats_to_syslog: bool, ) -> QueryResponseFut<RecorderStartLoggingForeverResult, DefaultFuchsiaResourceDialect>
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,
) -> QueryResponseFut<bool, DefaultFuchsiaResourceDialect>
pub fn stop_logging( &self, client_id: &str, ) -> QueryResponseFut<bool, DefaultFuchsiaResourceDialect>
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 RecorderProxy
impl Clone for RecorderProxy
Source§fn clone(&self) -> RecorderProxy
fn clone(&self) -> RecorderProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RecorderProxy
impl Debug for RecorderProxy
Source§impl Proxy for RecorderProxy
impl Proxy for RecorderProxy
Source§type Protocol = RecorderMarker
type Protocol = RecorderMarker
Proxy
controls.