GitLab maintenance scheduled for Today, 2019-12-05, from 17:00 to 18:00 CT - Services will be unavailable during this time.

Commit 939496ce authored by Valentin Reis's avatar Valentin Reis

[feature] added upstream publishing of performance counters.

This includes renaming "progress" to performance in argo_perf_wrapper.
There are two distincts keywords in the messaging layer: "performance"
for all things related to hardware, and "progress", for all things
relating to the application.
parent 388295f2
Pipeline #4823 passed with stages
in 2 minutes and 32 seconds
......@@ -30,12 +30,14 @@ class PerfWrapper(object):
msg = PUB_MSG['application_exit'](**update)
self.downstream_event.sendmsg(msg)
def progress_report(self, progress):
def performance_report(self, performance):
update = {'api': 'down_event',
'type': 'progress',
'payload': progress,
'type': 'performance',
'payload': performance,
'container_uuid' : self.container_uuid,
'application_uuid' : self.app_uuid,
}
msg = PUB_MSG['progress'](**update)
msg = PUB_MSG['performance'](**update)
self.downstream_event.sendmsg(msg)
def setup(self):
......@@ -123,7 +125,7 @@ class PerfWrapper(object):
ips = int(instructions / (time - last_time))
logger.info("instructions per second: %r", ips)
self.progress_report(ips)
self.performance_report(ips)
last_time = time
......
......@@ -59,6 +59,9 @@ class Application(object):
"""Update the progress tracking."""
assert self.progress
def update_performance(self, msg):
"""Update the progress tracking."""
def update_phase_context(self, msg):
"""Update the phase contextual information."""
id = msg.cpu
......
......@@ -34,10 +34,27 @@ class Daemon(object):
container = self.container_manager.containers[cid]
self.application_manager.register(msg, container)
elif msg.type == 'progress':
uuid = msg.container_uuid
if uuid in self.application_manager.applications:
app = self.application_manager.applications[uuid]
app.update_progress(msg)
if msg.application_uuid in self.application_manager.applications:
app = self.application_manager.applications[
msg.application_uuid]
app.update_performance(msg)
pub = {'api': 'up_pub',
'type': 'progress',
'payload': msg.payload,
'application_uuid': msg.application_uuid}
self.upstream_pub_server.sendmsg(
PUB_MSG['progress'](**pub))
elif msg.type == 'performance':
if msg.application_uuid in self.application_manager.applications:
app = self.application_manager.applications[
msg.application_uuid]
app.update_performance(msg)
pub = {'api': 'up_pub',
'type': 'performance',
'payload': msg.payload,
'container_uuid': msg.container_uuid}
self.upstream_pub_server.sendmsg(
PUB_MSG['performance'](**pub))
elif msg.type == 'phase_context':
uuid = msg.application_uuid
if uuid in self.application_manager.applications:
......
......@@ -46,13 +46,22 @@ MSGFORMATS['up_pub'] = {'power': {'total': int, 'limit': float},
'power': dict},
'container_exit': {'container_uuid': basestring,
'profile_data': dict},
'performance': {'container_uuid': basestring,
'payload': int},
'progress': {'application_uuid': basestring,
'payload': int},
}
MSGFORMATS['down_event'] = {'application_start':
{'container_uuid': basestring,
'application_uuid': basestring},
'application_exit':
{'application_uuid': basestring},
'progress': {'payload': int},
'performance': {'payload': int,
'application_uuid': basestring,
'container_uuid': basestring},
'progress': {'payload': int,
'application_uuid': basestring,
'container_uuid': basestring},
'phase_context': {'cpu': int,
'startcompute': int,
'endcompute': int,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment