pub struct QueryService { /* private fields */ }
Expand description
Implements a client for the Cloud Monitoring API.
§Example
let client = QueryService::builder().build().await?;
// use `client` to make requests to the Cloud Monitoring API.
§Service Description
The QueryService API is used to manage time series data in Cloud Monitoring. Time series data is a collection of data points that describes the time-varying values of a metric.
§Configuration
To configure QueryService
use the with_*
methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://monitoring.googleapis.com
). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
QueryService
holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap QueryService
in
an Rc or Arc to reuse it, because it
already uses an Arc
internally.
Implementations§
Source§impl QueryService
impl QueryService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for QueryService.
let client = QueryService::builder().build().await?;
Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: QueryService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: QueryService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn query_time_series(&self) -> QueryTimeSeries
👎Deprecated
pub fn query_time_series(&self) -> QueryTimeSeries
Queries time series by using Monitoring Query Language (MQL). We recommend using PromQL instead of MQL. For more information about the status of MQL, see the MQL deprecation notice.
Trait Implementations§
Source§impl Clone for QueryService
impl Clone for QueryService
Source§fn clone(&self) -> QueryService
fn clone(&self) -> QueryService
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more