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
4151af82
Commit
4151af82
authored
4 years ago
by
Lorenz Boguhn
Committed by
Lorenz Boguhn
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Enhance empty query case
parent
158aad8a
No related branches found
No related tags found
4 merge requests
!159
Re-implementation of Theodolite with Kotlin/Quarkus
,
!157
Update Graal Image in CI pipeline
,
!92
Introduce experiment evaluation
,
!83
WIP: Re-implementation of Theodolite with Kotlin/Quarkus
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theodolite-quarkus/src/main/kotlin/theodolite/evaluation/MetricFetcher.kt
+10
-0
10 additions, 0 deletions
...us/src/main/kotlin/theodolite/evaluation/MetricFetcher.kt
with
10 additions
and
0 deletions
theodolite-quarkus/src/main/kotlin/theodolite/evaluation/MetricFetcher.kt
+
10
−
0
View file @
4151af82
...
@@ -3,10 +3,13 @@ package theodolite.evaluation
...
@@ -3,10 +3,13 @@ package theodolite.evaluation
import
com.google.gson.Gson
import
com.google.gson.Gson
import
khttp.get
import
khttp.get
import
khttp.responses.Response
import
khttp.responses.Response
import
mu.KotlinLogging
import
theodolite.util.PrometheusResponse
import
theodolite.util.PrometheusResponse
import
java.net.ConnectException
import
java.net.ConnectException
import
java.util.*
import
java.util.*
private
val
logger
=
KotlinLogging
.
logger
{}
class
MetricFetcher
(
private
val
prometheusURL
:
String
)
{
class
MetricFetcher
(
private
val
prometheusURL
:
String
)
{
...
@@ -22,8 +25,15 @@ class MetricFetcher(private val prometheusURL: String) {
...
@@ -22,8 +25,15 @@ class MetricFetcher(private val prometheusURL: String) {
while
(
trys
<
2
)
{
while
(
trys
<
2
)
{
val
response
=
get
(
"$prometheusURL/api/v1/query_range"
,
params
=
parameter
)
val
response
=
get
(
"$prometheusURL/api/v1/query_range"
,
params
=
parameter
)
if
(
response
.
statusCode
!=
200
)
{
if
(
response
.
statusCode
!=
200
)
{
val
message
=
response
.
jsonObject
.
toString
()
logger
.
warn
{
"Could not connect to Prometheus: $message, retrying now"
}
trys
++
trys
++
}
else
{
}
else
{
var
values
=
parseValues
(
response
)
if
(
values
.
data
?.
result
.
isNullOrEmpty
())
{
logger
.
warn
{
"Empty query result: $values"
}
throw
NoSuchFieldException
()
}
return
parseValues
(
response
)
return
parseValues
(
response
)
}
}
}
}
...
...
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