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
c9720bdf
Commit
c9720bdf
authored
6 years ago
by
Simon Crowle
Browse files
Options
Downloads
Patches
Plain Diff
Fixes merge duplication of status reporting
parent
76be7c3d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clmctest/monitoring/StreamingSim.py
+24
-66
24 additions, 66 deletions
clmctest/monitoring/StreamingSim.py
with
24 additions
and
66 deletions
clmctest/monitoring/StreamingSim.py
+
24
−
66
View file @
c9720bdf
...
@@ -149,43 +149,6 @@ class Sim(object):
...
@@ -149,43 +149,6 @@ class Sim(object):
endpoint_states_config
[
agent
][
"
current_state_time
"
]
=
0.6
endpoint_states_config
[
agent
][
"
current_state_time
"
]
=
0.6
sim_time
+=
10
*
TICK_TIME
sim_time
+=
10
*
TICK_TIME
# move mpegdash media component state from 'stopped' to 'starting'
# Total reports = 1, (completed: 0.2 seconds in 'stopped', current: 0.8 seconds in 'starting')
for
ip_endpoint
in
ip_endpoints
:
agent
=
ip_endpoint
[
"
agent_url
"
]
agent_url
=
urllib
.
parse
.
urlparse
(
agent
)
influxClient
=
InfluxDBClient
(
host
=
agent_url
.
hostname
,
port
=
agent_url
.
port
,
database
=
self
.
influx_db_name
,
timeout
=
10
)
completed_states
=
(
(
'
stopped
'
,
0.2
,
1
),
)
mc_curr_states
[
agent
][
"
current_state
"
]
=
'
starting
'
mc_curr_states
[
agent
][
"
current_state_time
"
]
=
0.8
self
.
_changeMCState
(
influxClient
,
sim_time
,
'
mpegdash_mc_config
'
,
completed_states
,
'
starting
'
,
0.8
)
sim_time
+=
TICK_TIME
# move mpegdash media component state from 'starting' to 'running'
# Total reports = 5, (4 incomplete 'starting', completed: 0.8 + 4 + 0.7 seconds in 'starting', current: 0.3 seconds in 'running')
for
ip_endpoint
in
ip_endpoints
:
agent
=
ip_endpoint
[
"
agent_url
"
]
agent_url
=
urllib
.
parse
.
urlparse
(
agent
)
influxClient
=
InfluxDBClient
(
host
=
agent_url
.
hostname
,
port
=
agent_url
.
port
,
database
=
self
.
influx_db_name
,
timeout
=
10
)
# 4 seconds of starting
for
i
in
range
(
0
,
4
):
mc_curr_states
[
agent
][
"
current_state
"
]
=
'
running
'
mc_curr_states
[
agent
][
"
current_state_time
"
]
+=
TICK_TIME
self
.
_writeMCSingleState
(
influxClient
,
sim_time
+
(
i
*
TICK_TIME
),
'
mpegdash_mc_config
'
,
'
running
'
,
mc_curr_states
[
agent
][
"
current_state_time
"
]
)
# Switch over to running
completed_states
=
(
(
'
starting
'
,
0.8
+
4
+
0.7
,
1
),
)
mc_curr_states
[
agent
][
"
current_state
"
]
=
'
running
'
mc_curr_states
[
agent
][
"
current_state_time
"
]
=
0.3
self
.
_changeMCState
(
influxClient
,
sim_time
,
'
mpegdash_mc_config
'
,
completed_states
,
'
running
'
,
0.3
)
sim_time
+=
5
*
TICK_TIME
# Move endpoints from state booted to state connecting
# Move endpoints from state booted to state connecting
# reports: 2, booted: 1.5s, connecting: 0.5s
# reports: 2, booted: 1.5s, connecting: 0.5s
# addition to uncompleted states from previous report: booted += 0.6s
# addition to uncompleted states from previous report: booted += 0.6s
...
@@ -227,25 +190,40 @@ class Sim(object):
...
@@ -227,25 +190,40 @@ class Sim(object):
endpoint_states_config
[
agent
][
"
current_state_time
"
]
=
0.3
endpoint_states_config
[
agent
][
"
current_state_time
"
]
=
0.3
sim_time
+=
10
*
TICK_TIME
sim_time
+=
10
*
TICK_TIME
# move mpegdash
_service
media component state from 'stopped' to 'starting'
# move mpegdash media component state from 'stopped' to 'starting'
# Total reports = 1, (0.2 seconds in 'stopped', 0.8 seconds in 'starting')
# Total reports = 1, (
completed:
0.2 seconds in 'stopped',
current:
0.8 seconds in 'starting')
for
ip_endpoint
in
ip_endpoints
:
for
ip_endpoint
in
ip_endpoints
:
agent_url
=
urllib
.
parse
.
urlparse
(
ip_endpoint
[
"
agent_url
"
])
agent
=
ip_endpoint
[
"
agent_url
"
]
agent_url
=
urllib
.
parse
.
urlparse
(
agent
)
influxClient
=
InfluxDBClient
(
host
=
agent_url
.
hostname
,
port
=
agent_url
.
port
,
database
=
self
.
influx_db_name
,
timeout
=
10
)
influxClient
=
InfluxDBClient
(
host
=
agent_url
.
hostname
,
port
=
agent_url
.
port
,
database
=
self
.
influx_db_name
,
timeout
=
10
)
self
.
_changeMCState
(
influxClient
,
sim_time
,
'
mpegdash_service_config
'
,
10
,
2
,
'
stopped
'
,
'
starting
'
)
completed_states
=
(
(
'
stopped
'
,
0.2
,
1
),
)
mc_curr_states
[
agent
][
"
current_state
"
]
=
'
starting
'
mc_curr_states
[
agent
][
"
current_state_time
"
]
=
0.8
self
.
_changeMCState
(
influxClient
,
sim_time
,
'
mpegdash_mc_config
'
,
completed_states
,
'
starting
'
,
0.8
)
sim_time
+=
TICK_TIME
sim_time
+=
TICK_TIME
# move mpegdash
_service
media component state from 'starting' to 'running'
# move mpegdash media component state from 'starting' to 'running'
# Total reports = 5, (4.7 seconds in 'starting', 0.3 seconds in 'running')
# Total reports = 5, (4
incomplete 'starting', completed: 0.8 + 4 + 0
.7 seconds in 'starting',
current:
0.3 seconds in 'running')
for
ip_endpoint
in
ip_endpoints
:
for
ip_endpoint
in
ip_endpoints
:
agent_url
=
urllib
.
parse
.
urlparse
(
ip_endpoint
[
"
agent_url
"
])
agent
=
ip_endpoint
[
"
agent_url
"
]
agent_url
=
urllib
.
parse
.
urlparse
(
agent
)
influxClient
=
InfluxDBClient
(
host
=
agent_url
.
hostname
,
port
=
agent_url
.
port
,
database
=
self
.
influx_db_name
,
timeout
=
10
)
influxClient
=
InfluxDBClient
(
host
=
agent_url
.
hostname
,
port
=
agent_url
.
port
,
database
=
self
.
influx_db_name
,
timeout
=
10
)
# 4 seconds of starting
for
i
in
range
(
0
,
4
):
for
i
in
range
(
0
,
4
):
self
.
_writeMCSingleState
(
influxClient
,
'
mpegdash_service_config
'
,
'
starting
'
,
sim_time
+
(
i
*
TICK_TIME
))
mc_curr_states
[
agent
][
"
current_state
"
]
=
'
running
'
mc_curr_states
[
agent
][
"
current_state_time
"
]
+=
TICK_TIME
self
.
_writeMCSingleState
(
influxClient
,
sim_time
+
(
i
*
TICK_TIME
),
'
mpegdash_mc_config
'
,
'
running
'
,
mc_curr_states
[
agent
][
"
current_state_time
"
]
)
self
.
_changeMCState
(
influxClient
,
sim_time
+
(
4
*
TICK_TIME
),
'
mpegdash_service_config
'
,
10
,
7
,
'
starting
'
,
'
running
'
)
# Switch over to running
completed_states
=
(
(
'
starting
'
,
0.8
+
4
+
0.7
,
1
),
)
mc_curr_states
[
agent
][
"
current_state
"
]
=
'
running
'
mc_curr_states
[
agent
][
"
current_state_time
"
]
=
0.3
self
.
_changeMCState
(
influxClient
,
sim_time
,
'
mpegdash_mc_config
'
,
completed_states
,
'
running
'
,
0.3
)
sim_time
+=
5
*
TICK_TIME
sim_time
+=
5
*
TICK_TIME
...
@@ -330,26 +308,6 @@ class Sim(object):
...
@@ -330,26 +308,6 @@ class Sim(object):
# Simulate tear-down of media components and endpoints
# Simulate tear-down of media components and endpoints
# remove endpoints
# reports: 5, connected: 4.7s, unplaced: 0.3s
# addition to uncompleted states from previous report: connected += 3600s + 0.3s
for
ip_endpoint
in
ip_endpoints
:
agent
=
ip_endpoint
[
"
agent_url
"
]
agent_url
=
urllib
.
parse
.
urlparse
(
agent
)
agent_db_client
=
InfluxDBClient
(
host
=
agent_url
.
hostname
,
port
=
agent_url
.
port
,
database
=
self
.
influx_db_name
,
timeout
=
10
)
# since the current state in the dictionary is still connected, only the current state time is incremented
for
i
in
range
(
4
):
self
.
_writeVMSingleState
(
agent_db_client
,
sim_time
+
(
i
*
TICK_TIME
),
ip_endpoint
,
"
connected
"
)
endpoint_states_config
[
agent
][
"
current_state_time
"
]
+=
TICK_TIME
# here, the VM exits state connected, hence need to append the current state time
self
.
_changeVMState
(
agent_db_client
,
sim_time
+
(
4
*
TICK_TIME
),
ip_endpoint
,
((
'
connected
'
,
0.7
+
endpoint_states_config
[
agent
][
"
current_state_time
"
],
1
),),
'
unplaced
'
,
0.3
)
# since VM changed its current state, readjust the config dictionary
endpoint_states_config
[
agent
][
"
current_state
"
]
=
"
unplaced
"
endpoint_states_config
[
agent
][
"
current_state_time
"
]
=
0.3
sim_time
+=
5
*
TICK_TIME
# move mpegdash media component state from 'running' to 'stopping'
# move mpegdash media component state from 'running' to 'stopping'
# Total reports = 2, ( completed: n+1.8 seconds in 'running', current: 0.2 seconds in 'stopping')
# Total reports = 2, ( completed: n+1.8 seconds in 'running', current: 0.2 seconds in 'stopping')
for
ip_endpoint
in
ip_endpoints
:
for
ip_endpoint
in
ip_endpoints
:
...
...
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