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
26f71c27
Commit
26f71c27
authored
3 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
Enhance logging in generic SLO checker
parent
199415d4
No related branches found
No related tags found
No related merge requests found
Pipeline
#6020
passed
3 years ago
Stage: build
Stage: test
Stage: check
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
slo-checker/generic/app/main.py
+2
-3
2 additions, 3 deletions
slo-checker/generic/app/main.py
with
2 additions
and
3 deletions
slo-checker/generic/app/main.py
+
2
−
3
View file @
26f71c27
...
@@ -57,15 +57,14 @@ def check_result(result, operator: str, threshold):
...
@@ -57,15 +57,14 @@ def check_result(result, operator: str, threshold):
@app.post
(
"
/
"
,
response_model
=
bool
)
@app.post
(
"
/
"
,
response_model
=
bool
)
async
def
check_slo
(
request
:
Request
):
async
def
check_slo
(
request
:
Request
):
data
=
json
.
loads
(
await
request
.
body
())
data
=
json
.
loads
(
await
request
.
body
())
logger
.
info
(
'
Received request with metadata: %s
'
,
data
[
'
metadata
'
])
warmup
=
int
(
data
[
'
metadata
'
][
'
warmup
'
])
warmup
=
int
(
data
[
'
metadata
'
][
'
warmup
'
])
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
=
int
(
data
[
'
metadata
'
][
'
threshold
'
])
threshold
=
int
(
data
[
'
metadata
'
][
'
threshold
'
])
for
r
in
data
[
"
results
"
]:
aggr_query
(
r
[
0
][
"
values
"
],
warmup
,
query_aggregation
)
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
]
return
check_result
(
result
,
operator
,
threshold
)
return
check_result
(
result
,
operator
,
threshold
)
...
...
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