pub struct MetricQueryParams {
pub query: String,
pub is_range: bool,
pub start: i64,
pub end: i64,
pub step: Option<u64>,
pub limit: Option<usize>,
pub timeout: Option<Duration>,
}Expand description
Query parameters for metric query (instant or range).
Fields§
§query: StringQuery expression (PromQL, MetricsQL, DQL).
is_range: boolWhether the user explicitly requested a range query.
Set by the shell layer based on the presence of --from, --to,
or --step flags.
start: i64Start time as Unix seconds.
end: i64End time as Unix seconds.
step: Option<u64>Query step interval in seconds (range queries only).
limit: Option<usize>Maximum number of series to return.
timeout: Option<Duration>Query timeout.
Implementations§
Source§impl MetricQueryParams
impl MetricQueryParams
Sourcepub const DEFAULT_TARGET_POINTS: i64 = 100
pub const DEFAULT_TARGET_POINTS: i64 = 100
Default target number of data points when --step is omitted.
Sourcepub fn step_or_auto(&self) -> u64
pub fn step_or_auto(&self) -> u64
Return the step in seconds, falling back to an auto-calculated value
that targets approximately Self::DEFAULT_TARGET_POINTS data points.
Trait Implementations§
Source§impl Clone for MetricQueryParams
impl Clone for MetricQueryParams
Source§fn clone(&self) -> MetricQueryParams
fn clone(&self) -> MetricQueryParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MetricQueryParams
impl RefUnwindSafe for MetricQueryParams
impl Send for MetricQueryParams
impl Sync for MetricQueryParams
impl Unpin for MetricQueryParams
impl UnsafeUnpin for MetricQueryParams
impl UnwindSafe for MetricQueryParams
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