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
Merge requests
!124
Deploy correct number of load generator instances
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Deploy correct number of load generator instances
wetzel/spesb:210-allows-to-scale-load-generators
into
theodolite-kotlin
Overview
0
Commits
3
Pipelines
0
Changes
3
Merged
Lorenz Boguhn
requested to merge
wetzel/spesb:210-allows-to-scale-load-generators
into
theodolite-kotlin
4 years ago
Overview
0
Commits
3
Pipelines
0
Changes
3
Expand
Closes
#210 (closed)
Edited
4 years ago
by
Lorenz Boguhn
0
0
Merge request reports
Compare
theodolite-kotlin
theodolite-kotlin (base)
and
latest version
latest version
7147554f
3 commits,
4 years ago
3 files
+
39
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
theodolite-quarkus/src/main/kotlin/theodolite/patcher/NumNestedGroupsLoadGeneratorReplicaPatcher.kt
0 → 100644
+
20
−
0
Options
package
theodolite.patcher
import
io.fabric8.kubernetes.api.model.KubernetesResource
import
io.fabric8.kubernetes.api.model.apps.Deployment
import
kotlin.math.pow
private
const
val
NUM_SENSORS
=
4.0
private
const
val
LOAD_GEN_MAX_RECORDS
=
150000
class
NumNestedGroupsLoadGeneratorReplicaPatcher
(
private
val
k8sResource
:
KubernetesResource
)
:
AbstractPatcher
(
k8sResource
)
{
override
fun
<
String
>
patch
(
value
:
String
)
{
if
(
k8sResource
is
Deployment
)
{
if
(
value
is
kotlin
.
String
)
{
val
approxNumSensors
=
NUM_SENSORS
.
pow
(
Integer
.
parseInt
(
value
).
toDouble
())
val
loadGenInstances
=
(
approxNumSensors
+
LOAD_GEN_MAX_RECORDS
-
1
)
/
LOAD_GEN_MAX_RECORDS
this
.
k8sResource
.
spec
.
replicas
=
loadGenInstances
.
toInt
()
}
}
}
}
Loading