Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mquery
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Subconscious Compute (Open)
mquery
Commits
8b633ead
Commit
8b633ead
authored
1 year ago
by
Maaz Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
fix: quantile_over_time should take additional phi argument
parent
db5d8b24
No related branches found
No related tags found
1 merge request
!7
Resolve "Feat: initial support for functions in the query builder API"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/query/fns/rollup.rs
+5
-4
5 additions, 4 deletions
src/query/fns/rollup.rs
with
5 additions
and
4 deletions
src/query/fns/rollup.rs
+
5
−
4
View file @
8b633ead
...
...
@@ -44,12 +44,13 @@ pub fn count_over_time(
basic_fn
(
"count_over_time"
,
range_vec
)
}
/// The quantile_over_time rollup query function
/// The quantile_over_time rollup query function
(phi value must be >= 0 and <= 1)
#[inline]
pub
fn
quantile_over_time
(
phi
:
f32
,
range_vec
:
impl
Operable
+
'static
,
)
->
QryFunc
<
impl
Fn
(
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
>
{
basic_fn
(
"quantile_over_time
"
,
range_vec
)
QryFunc
::
new
(
move
|
f
|
write!
(
f
,
"quantile_over_time
({phi},{
range_vec
})"
)
)
}
/// The stddev_over_time rollup query function
...
...
@@ -124,8 +125,8 @@ mod tests {
#[test]
fn
rollup_quantile
()
{
let
string
=
quantile_over_time
(
test_metric
())
.to_string
();
assert_eq!
(
string
,
"quantile_over_time(test_metric[15d])"
);
let
string
=
quantile_over_time
(
0.1
,
test_metric
())
.to_string
();
assert_eq!
(
string
,
"quantile_over_time(
0.1,
test_metric[15d])"
);
}
#[test]
fn
rollup_stddev
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment