diff --git a/clmctest/monitoring/StreamingSim.py b/clmctest/monitoring/StreamingSim.py index 91159bd1485caf74d41067908a0bf811bb91d7dd..ff901f7756afad6b3949636e292b5f080d08f3e0 100644 --- a/clmctest/monitoring/StreamingSim.py +++ b/clmctest/monitoring/StreamingSim.py @@ -240,11 +240,12 @@ class Sim(object): # remove requests processed off the queue ip_endpoint['request_queue'] -= int(requests_processed) - # update mpegdash_service media component state (continuously 'running') - state_stats = {} - state_stats['running'] = float(TICK_TIME) - state_stats['avg_running'] = float(TICK_TIME) - agent_db_client.write_points(lp.generate_mc_service_config("mpegdash_service_config", state_stats, sim_time)) + # update mpegdash_service media component and endpoint state (continuously 'running' and 'connected' respectively) + agent_db_client.write_points(lp.generate_endpoint_config(ip_endpoint['cpu'], ip_endpoint['mem'], ip_endpoint['storage'], sim_time, + **{'connected': float(TICK_TIME), 'avg_connected': float(TICK_TIME)})) + + agent_db_client.write_points(lp.generate_mc_service_config("mpegdash_service_config", + {'running': float(TICK_TIME), 'avg_running': float(TICK_TIME)}, sim_time)) sim_time += TICK_TIME diff --git a/clmctest/monitoring/test_simresults.py b/clmctest/monitoring/test_simresults.py index 5ca648984beb747a43b7aa850a21cf213279f950..fca8c0fa69031b0df3309b5850ddc54100725b7c 100644 --- a/clmctest/monitoring/test_simresults.py +++ b/clmctest/monitoring/test_simresults.py @@ -26,17 +26,17 @@ class TestSimulation(object): {"time": "1970-01-01T00:00:00Z", "count_RX_BYTES_PORT_M": 7200, "count_TX_BYTES_PORT_M": 7200}), ('SELECT count(*) FROM "CLMCMetrics"."autogen"."endpoint_config" WHERE ipendpoint=\'adaptive_streaming_I1_apache1\'', - {"time": "1970-01-01T00:00:00Z", "count_unplaced": 7, "count_avg_unplaced": 7, "count_placing": 7, "count_avg_placing": 7, "count_placed": 7, "count_avg_placed": 7, "count_booting": 7, "count_avg_booting": 7, "count_booted": 7, - "count_avg_booted": 7, "count_connecting": 7, "count_avg_connecting": 7, "count_connected": 7, "count_avg_connected": 7, "count_cpus": 7, "count_memory": 7, "count_storage": 7}), + {"time": "1970-01-01T00:00:00Z", "count_unplaced": 3607, "count_avg_unplaced": 3607, "count_placing": 3607, "count_avg_placing": 3607, "count_placed": 3607, "count_avg_placed": 3607, "count_booting": 3607, "count_avg_booting": 3607, "count_booted": 3607, + "count_avg_booted": 3607, "count_connecting": 3607, "count_avg_connecting": 3607, "count_connected": 3607, "count_avg_connected": 3607, "count_cpus": 3607, "count_memory": 3607, "count_storage": 3607}), ('SELECT count(*) FROM "CLMCMetrics"."autogen"."endpoint_config" WHERE ipendpoint=\'adaptive_streaming_I1_apache2\'', - {"time": "1970-01-01T00:00:00Z", "count_unplaced": 7, "count_avg_unplaced": 7, "count_placing": 7, "count_avg_placing": 7, "count_placed": 7, "count_avg_placed": 7, "count_booting": 7, "count_avg_booting": 7, "count_booted": 7, - "count_avg_booted": 7, "count_connecting": 7, "count_avg_connecting": 7, "count_connected": 7, "count_avg_connected": 7, "count_cpus": 7, "count_memory": 7, "count_storage": 7}), + {"time": "1970-01-01T00:00:00Z", "count_unplaced": 3607, "count_avg_unplaced": 3607, "count_placing": 3607, "count_avg_placing": 3607, "count_placed": 3607, "count_avg_placed": 3607, "count_booting": 3607, "count_avg_booting": 3607, "count_booted": 3607, + "count_avg_booted": 3607, "count_connecting": 3607, "count_avg_connecting": 3607, "count_connected": 3607, "count_avg_connected": 3607, "count_cpus": 3607, "count_memory": 3607, "count_storage": 3607}), ('SELECT count(*) FROM "CLMCMetrics"."autogen"."mpegdash_service_config" WHERE ipendpoint=\'adaptive_streaming_I1_apache1\'', - {"time" : "1970-01-01T00:00:00Z", "count_avg_running" : 3604, "count_avg_starting" : 3604, "count_avg_stopped" : 3604, "count_avg_stopping" : 3604, "count_running" : 3604, "count_starting" : 3604, "count_stopped" : 3604, "count_stopping" : 3604}), + {"time": "1970-01-01T00:00:00Z", "count_avg_running": 3604, "count_avg_starting": 3604, "count_avg_stopped": 3604, "count_avg_stopping": 3604, "count_running": 3604, "count_starting": 3604, "count_stopped": 3604, "count_stopping": 3604}), ('SELECT count(*) FROM "CLMCMetrics"."autogen"."mpegdash_service_config" WHERE ipendpoint=\'adaptive_streaming_I1_apache2\'', - {"time" : "1970-01-01T00:00:00Z", "count_avg_running" : 3604, "count_avg_starting" : 3604, "count_avg_stopped" : 3604, "count_avg_stopping" : 3604, "count_running" : 3604, "count_starting" : 3604, "count_stopped" : 3604, "count_stopping" : 3604}), + {"time": "1970-01-01T00:00:00Z", "count_avg_running": 3604, "count_avg_starting": 3604, "count_avg_stopped": 3604, "count_avg_stopping": 3604, "count_running": 3604, "count_starting": 3604, "count_stopped": 3604, "count_stopping": 3604}), ]) def test_simulation( self, influx_db, query, expected_result ): """