Skip to content

Commit

Permalink
Improve comms debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
ccuetom committed Jun 17, 2024
1 parent 6af89ad commit 472f412
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions mosaic/comms/comms.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,19 +771,20 @@ def _process_send(self, method, cmd=None, reply=False, **kwargs):
'cmd': cmd,
}

msg = serialise(msg)
msg_size = sizeof(msg)

if not method.startswith('log') and not method.startswith('update_monitored_node'):
if method == 'cmd':
method = '%s:%s.%s' % (method, cmd['type'], cmd['method'])

self.logger.debug('Sending cmd %s %s to %s (%s) from %s' % (method, cmd['method'],
self.uid, cmd['uid'],
self._runtime.uid))
self.logger.debug('Sending cmd %s %s to %s (%s) from %s '
'(size %.2f MB)' % (method, cmd['method'], self.uid, cmd['uid'],
self._runtime.uid, msg_size/1024**2))
else:
self.logger.debug('Sending msg %s to %s from %s' % (method, self.uid,
self._runtime.uid))

msg = serialise(msg)
msg_size = sizeof(msg)
self.logger.debug('Sending msg %s to %s from %s '
'(size %.2f MB)' % (method, self.uid, self._runtime.uid,
msg_size/1024**2))

compression = []
compressed_msg = []
Expand Down

0 comments on commit 472f412

Please sign in to comment.