Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
03fb239c
Commit
03fb239c
authored
3 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
Add basic support for floating point values
parent
689573aa
No related branches found
No related tags found
1 merge request
!286
Support floating point values in SLO evaluation
Pipeline
#8637
failed
3 years ago
Stage: build
Stage: test
Stage: check
Stage: smoketest
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
slo-checker/generic/app/main.py
+2
-2
2 additions, 2 deletions
slo-checker/generic/app/main.py
slo-checker/record-lag/app/main.py
+1
-1
1 addition, 1 deletion
slo-checker/record-lag/app/main.py
with
3 additions
and
3 deletions
slo-checker/generic/app/main.py
+
2
−
2
View file @
03fb239c
...
@@ -37,7 +37,7 @@ def aggr_query(values: dict, warmup: int, aggr_func):
...
@@ -37,7 +37,7 @@ def aggr_query(values: dict, warmup: int, aggr_func):
df
=
pd
.
DataFrame
.
from_dict
(
values
)
df
=
pd
.
DataFrame
.
from_dict
(
values
)
df
.
columns
=
[
'
timestamp
'
,
'
value
'
]
df
.
columns
=
[
'
timestamp
'
,
'
value
'
]
filtered
=
df
[
df
[
'
timestamp
'
]
>=
(
df
[
'
timestamp
'
][
0
]
+
warmup
)]
filtered
=
df
[
df
[
'
timestamp
'
]
>=
(
df
[
'
timestamp
'
][
0
]
+
warmup
)]
filtered
[
'
value
'
]
=
filtered
[
'
value
'
].
astype
(
float
)
.
astype
(
int
)
filtered
[
'
value
'
]
=
filtered
[
'
value
'
].
astype
(
float
)
return
filtered
[
'
value
'
].
aggregate
(
aggr_func
)
return
filtered
[
'
value
'
].
aggregate
(
aggr_func
)
def
check_result
(
result
,
operator
:
str
,
threshold
):
def
check_result
(
result
,
operator
:
str
,
threshold
):
...
@@ -63,7 +63,7 @@ async def check_slo(request: Request):
...
@@ -63,7 +63,7 @@ async def check_slo(request: Request):
query_aggregation
=
get_aggr_func
(
data
[
'
metadata
'
][
'
queryAggregation
'
])
query_aggregation
=
get_aggr_func
(
data
[
'
metadata
'
][
'
queryAggregation
'
])
rep_aggregation
=
get_aggr_func
(
data
[
'
metadata
'
][
'
repetitionAggregation
'
])
rep_aggregation
=
get_aggr_func
(
data
[
'
metadata
'
][
'
repetitionAggregation
'
])
operator
=
data
[
'
metadata
'
][
'
operator
'
]
operator
=
data
[
'
metadata
'
][
'
operator
'
]
threshold
=
in
t
(
data
[
'
metadata
'
][
'
threshold
'
])
threshold
=
floa
t
(
data
[
'
metadata
'
][
'
threshold
'
])
query_results
=
[
aggr_query
(
r
[
0
][
"
values
"
],
warmup
,
query_aggregation
)
for
r
in
data
[
"
results
"
]]
query_results
=
[
aggr_query
(
r
[
0
][
"
values
"
],
warmup
,
query_aggregation
)
for
r
in
data
[
"
results
"
]]
result
=
pd
.
DataFrame
(
query_results
).
aggregate
(
rep_aggregation
).
at
[
0
]
result
=
pd
.
DataFrame
(
query_results
).
aggregate
(
rep_aggregation
).
at
[
0
]
...
...
This diff is collapsed.
Click to expand it.
slo-checker/record-lag/app/main.py
+
1
−
1
View file @
03fb239c
...
@@ -27,7 +27,7 @@ def calculate_slope_trend(results, warmup):
...
@@ -27,7 +27,7 @@ def calculate_slope_trend(results, warmup):
group
=
result
[
'
metric
'
].
get
(
'
consumergroup
'
,
"
default
"
)
group
=
result
[
'
metric
'
].
get
(
'
consumergroup
'
,
"
default
"
)
for
value
in
result
[
'
values
'
]:
for
value
in
result
[
'
values
'
]:
d
.
append
({
'
group
'
:
group
,
'
timestamp
'
:
int
(
d
.
append
({
'
group
'
:
group
,
'
timestamp
'
:
int
(
value
[
0
]),
'
value
'
:
in
t
(
value
[
1
])
if
value
[
1
]
!=
'
NaN
'
else
0
})
value
[
0
]),
'
value
'
:
floa
t
(
value
[
1
])
if
value
[
1
]
!=
'
NaN
'
else
0
})
df
=
pd
.
DataFrame
(
d
)
df
=
pd
.
DataFrame
(
d
)
...
...
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