def _notify_trace(self, device_uuid, event_name, trace):
        """Notify that we have received tracing data from a device.

        This routine is called synchronously in the event loop by the DeviceManager
        """

        if device_uuid not in self._connections:
            self._logger.debug("Dropping trace data for device without an active connection, uuid=0x%X", device_uuid)
            return

        conn_data = self._connections[device_uuid]
        last_trace = conn_data['last_trace']
        now = monotonic()

        conn_data['trace_accum'] += bytes(trace)

        # If we're throttling tracing data, we need to see if we should accumulate this trace or
        # send it now.  We acculumate if we've last sent tracing data less than self.throttle_trace seconds ago
        if last_trace is not None and (now - last_trace) < self.throttle_trace:
            if not conn_data['trace_scheduled']:
                self._loop.call_later(self.throttle_trace - (now - last_trace), self._send_accum_trace, device_uuid)
                conn_data['trace_scheduled'] = True
                self._logger.debug("Deferring trace data due to throttling uuid=0x%X", device_uuid)
        else:
            self._send_accum_trace(device_uuid)
def _notify_trace ( self , device_uuid , event_name , trace ) : if device_uuid not in self . _connections : self . _logger . debug ( "Dropping trace data for device without an active connection, uuid=0x%X" , device_uuid ) return conn_data = self . _connections [ device_uuid ] last_trace = conn_data [ 'last_trace' ] now = monotonic ( ) conn_data [ 'trace_accum' ] += bytes ( trace ) if last_trace is not None and ( now - last_trace ) < self . throttle_trace : if not conn_data [ 'trace_scheduled' ] : self . _loop . call_later ( self . throttle_trace - ( now - last_trace ) , self . _send_accum_trace , device_uuid ) conn_data [ 'trace_scheduled' ] = True self . _logger . debug ( "Deferring trace data due to throttling uuid=0x%X" , device_uuid ) else : self . _send_accum_trace ( device_uuid )
Notify that we have received tracing data from a device.

        This routine is called synchronously in the event loop by the DeviceManager