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
05ab9f42
Commit
05ab9f42
authored
4 years ago
by
Simon Ehrenstein
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup code
parent
86597127
No related branches found
No related tags found
2 merge requests
!39
Add Support for Benchmarking Strategies
,
!36
Implement Benchmarking Strategy: Heuristic 2 (Binary Search Strategy)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
execution/lag_analysis.py
+9
-9
9 additions, 9 deletions
execution/lag_analysis.py
execution/strategies/strategies/binary_search_strategy.py
+0
-1
0 additions, 1 deletion
execution/strategies/strategies/binary_search_strategy.py
with
9 additions
and
10 deletions
execution/lag_analysis.py
+
9
−
9
View file @
05ab9f42
...
...
@@ -13,7 +13,7 @@ instances = sys.argv[4]
execution_minutes
=
int
(
sys
.
argv
[
5
])
time_diff_ms
=
int
(
os
.
getenv
(
'
CLOCK_DIFF_MS
'
,
0
))
prometheus_query_path
=
'
http://kube1.
se.
internal:32529/api/v1/query_range
'
prometheus_query_path
=
'
http://kube1.internal:32529/api/v1/query_range
'
#http://localhost:9090/api/v1/query_range?query=sum%20by(job,topic)(kafka_consumer_consumer_fetch_manager_metrics_records_lag)&start=2015-07-01T20:10:30.781Z&end=2020-07-01T20:11:00.781Z&step=15s
...
...
@@ -51,6 +51,14 @@ for result in results:
df
=
pd
.
DataFrame
(
d
)
# save whether the subexperiment was successful or not, meaning whether the consumer lag was above some threshhold or not
# Assumption: Due to fluctuations within the record lag measurements, it is sufficient to analyze the second half of measurements.
second_half
=
list
(
map
(
lambda
x
:
x
[
'
value
'
],
filter
(
lambda
x
:
x
[
'
topic
'
]
==
'
input
'
,
d
[
len
(
d
)
//
2
:])))
avg_lag
=
sum
(
second_half
)
/
len
(
second_half
)
with
open
(
r
"
last_exp_result.txt
"
,
"
w+
"
)
as
file
:
success
=
0
if
avg_lag
>
1000
else
1
file
.
write
(
str
(
success
))
# Do some analysis
input
=
df
.
loc
[
df
[
'
topic
'
]
==
"
input
"
]
...
...
@@ -109,14 +117,6 @@ df = pd.DataFrame(d)
df
.
to_csv
(
f
"
{
filename
}
_totallag.csv
"
)
# save whether the subexperiment was successful or not, meaning whether the consumer lag was above some threshhold or not
# Assumption: Due to fluctuations within the record lag measurements, it is sufficient to analyze the second half of measurements.
second_half
=
list
(
map
(
lambda
x
:
x
[
'
value
'
],
d
[
len
(
d
)
//
2
:]))
avg_lag
=
sum
(
second_half
)
/
len
(
second_half
)
with
open
(
r
"
last_exp_result.txt
"
,
"
w+
"
)
as
file
:
success
=
0
if
avg_lag
>
1000
else
1
file
.
write
(
str
(
success
))
# Load partition count
response
=
requests
.
get
(
prometheus_query_path
,
params
=
{
...
...
This diff is collapsed.
Click to expand it.
execution/strategies/strategies/binary_search_strategy.py
+
0
−
1
View file @
05ab9f42
...
...
@@ -30,7 +30,6 @@ def searchTransition(config, replica_index, lower, upper, subexperiment_counter)
else
:
# test mid
mid
=
(
upper
+
lower
)
//
2
print
(
mid
)
print
(
f
"
Run subexperiment
{
subexperiment_counter
}
with config
{
config
.
dim_values
[
mid
]
}
{
config
.
replicas
[
replica_index
]
}
"
)
subexperiment_config
=
SubexperimentConfig
(
config
.
use_case
,
subexperiment_counter
,
config
.
dim_values
[
mid
],
config
.
replicas
[
replica_index
],
config
.
partitions
,
config
.
cpu_limit
,
config
.
memory_limit
,
config
.
kafka_streams_commit_interval_ms
,
config
.
execution_minutes
)
config
.
subexperiment_executor
.
execute
(
subexperiment_config
)
...
...
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