pub struct RangeQuery {
pub query: String,
pub start: u64,
pub end: u64,
pub step: f64,
pub timeout: Option<u64>,
}
Expand description
A range query to send to Prometheus
Fields§
§query: String
expression query string.
start: u64
Start timestamp, inclusive.
end: u64
End timestamp, inclusive.
step: f64
Query resolution step width in duration format or float number of seconds.
timeout: Option<u64>
Evaluation timeout. Optional. Defaults to and is capped by the value of the -query.timeout flag.1
Implementations§
Source§impl RangeQuery
impl RangeQuery
Sourcepub fn new(query: &str, start: u64, end: u64, step: f64) -> Self
pub fn new(query: &str, start: u64, end: u64, step: f64) -> Self
Initializes a Range query with optional fields set to None
Sourcepub fn with_timeout(self, timeout: u64) -> Self
pub fn with_timeout(self, timeout: u64) -> Self
Builder method to set the query timeout
Sourcepub fn as_query_params(&self, base: String) -> String
pub fn as_query_params(&self, base: String) -> String
Transforms the typed query into HTTP GET query params, it contains a pre-built base
that
may use an HTTP path prefix if configured.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RangeQuery
impl RefUnwindSafe for RangeQuery
impl Send for RangeQuery
impl Sync for RangeQuery
impl Unpin for RangeQuery
impl UnwindSafe for RangeQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more