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
1435b658
Commit
1435b658
authored
3 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
Fix passing metadata
parent
5499c7d5
No related branches found
No related tags found
1 merge request
!242
Draft: Feature/346 use strimzi kafka
Pipeline
#6022
passed
3 years ago
Stage: build
Stage: test
Stage: check
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
slo-checker/generic/app/main.py
+2
-3
2 additions, 3 deletions
slo-checker/generic/app/main.py
theodolite/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt
+3
-4
3 additions, 4 deletions
...rc/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt
with
5 additions
and
7 deletions
slo-checker/generic/app/main.py
+
2
−
3
View file @
1435b658
...
@@ -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.
theodolite/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt
+
3
−
4
View file @
1435b658
...
@@ -50,12 +50,11 @@ class SloCheckerFactory {
...
@@ -50,12 +50,11 @@ class SloCheckerFactory {
// TODO validate property contents
// TODO validate property contents
metadata
=
mapOf
(
metadata
=
mapOf
(
"warmup"
to
(
properties
[
"warmup"
]
?.
toInt
()
?:
throw
IllegalArgumentException
(
"warmup expected"
)),
"warmup"
to
(
properties
[
"warmup"
]
?.
toInt
()
?:
throw
IllegalArgumentException
(
"warmup expected"
)),
"queryAggregation"
to
(
properties
[
"
warmup"
]
?.
toInt
()
"queryAggregation"
to
(
properties
[
"
queryAggregation"
]
?:
throw
IllegalArgumentException
(
"queryAggregation expected"
)),
?:
throw
IllegalArgumentException
(
"queryAggregation expected"
)),
"repetitionAggregation"
to
(
properties
[
"
warmup"
]
?.
toInt
()
"repetitionAggregation"
to
(
properties
[
"
repetitionAggregation"
]
?:
throw
IllegalArgumentException
(
"repetitionAggregation expected"
)),
?:
throw
IllegalArgumentException
(
"repetitionAggregation expected"
)),
"operator"
to
(
properties
[
"warmup"
]
?.
toInt
()
"operator"
to
(
properties
[
"operator"
]
?:
throw
IllegalArgumentException
(
"operator expected"
)),
?:
throw
IllegalArgumentException
(
"operator expected"
)),
"threshold"
to
(
properties
[
"threshold"
]
?.
toInt
()
"threshold"
to
(
properties
[
"threshold"
]
?.
toInt
()
?:
throw
IllegalArgumentException
(
"threshold expected"
))
?:
throw
IllegalArgumentException
(
"threshold expected"
))
)
)
...
...
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