Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flame-clmc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flame
flame-clmc
Commits
01d1df5f
Commit
01d1df5f
authored
6 years ago
by
Nikolay Stanchev
Browse files
Options
Downloads
Plain Diff
Merge branch 'aggregation' into clmcservice
parents
b4e33a8d
e85fba96
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
clmctest/monitoring/E2EAggregator.py
+12
-0
12 additions, 0 deletions
clmctest/monitoring/E2EAggregator.py
clmctest/monitoring/test_e2eresults.py
+5
-2
5 additions, 2 deletions
clmctest/monitoring/test_e2eresults.py
with
17 additions
and
2 deletions
clmctest/monitoring/E2EAggregator.py
+
12
−
0
View file @
01d1df5f
...
...
@@ -70,11 +70,23 @@ class Aggregator(Thread):
self
.
_stop_flag
.
set
()
def
set_event_lock
(
self
,
event
):
"""
Auxiliary method to set a thread-safe event lock object to the aggregator (used for testing).
:param event: the event lock object
"""
setattr
(
self
,
'
event
'
,
event
)
def
run
(
self
):
"""
Performs the functionality of the aggregator - query data from both measurements merge that data and post it back in influx every 5 seconds.
"""
if
hasattr
(
self
,
'
event
'
):
self
.
event
.
set
()
current_time
=
int
(
time
())
while
True
:
if
self
.
_stop_flag
.
is_set
():
...
...
This diff is collapsed.
Click to expand it.
clmctest/monitoring/test_e2eresults.py
+
5
−
2
View file @
01d1df5f
...
...
@@ -25,6 +25,7 @@
import
pytest
import
random
import
time
import
threading
class
TestE2ESimulation
(
object
):
...
...
@@ -44,9 +45,11 @@ class TestE2ESimulation(object):
random
.
seed
(
0
)
# Seed random function so we can reliably test for average queries
print
(
"
Starting aggregator...
"
)
event
=
threading
.
Event
()
e2e_aggregator
.
set_event_lock
(
event
)
e2e_aggregator
.
start
()
time
.
sleep
(
1
)
event
.
wait
()
# wait until the aggregator thread has set the event lock (it has reached its run method and is ready to start
)
print
(
"
Running simulation, please wait...
"
)
e2e_simulator
.
run
()
...
...
@@ -68,7 +71,7 @@ class TestE2ESimulation(object):
"
count_avg_request_size
"
:
38
,
"
count_avg_response_size
"
:
38
,
"
count_avg_bandwidth
"
:
38
}),
(
'
SELECT mean(*) FROM
"
E2EMetrics
"
.
"
autogen
"
.
"
e2e_delays
"'
,
{
"
time
"
:
"
1970-01-01T00:00:00Z
"
,
"
mean_delay_forward
"
:
8.0
48245614035087
,
"
mean_delay_reverse
"
:
1
3.043859649122808
,
"
mean_delay_service
"
:
23.42105263157895
,
{
"
time
"
:
"
1970-01-01T00:00:00Z
"
,
"
mean_delay_forward
"
:
8.0
10964912280702
,
"
mean_delay_reverse
"
:
1
2.881578947368423
,
"
mean_delay_service
"
:
23.42105263157895
,
'
mean_avg_request_size
'
:
10485760
,
'
mean_avg_response_size
'
:
1024
,
'
mean_avg_bandwidth
'
:
104857600
}),
])
def
test_simulation
(
self
,
influx_db
,
query
,
expected_result
):
...
...
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