def on_shmem_queue_full(match, state): """It happens when the ShareMemory queue is full and data is dropped.""" port = get_port_number(match[0], state) port_name = get_port_name(int(match[0], 16)) count_max = match[1] max_size = match[2] log_cfg( "ShareMemory limits for queue %s (%s) are: max_num=%s, max_size=%s" % (port, port_name, count_max, max_size), state) log_error( "[LP-19] Sample dropped because ShareMemory queue %s is full." % port, state)
def set_local_address(guid, state): """Set the local address.""" address = guid.split() local_address = (address[0], address[1]) # If the local address is already in the list you are most likely # writing the output of two different apps in the same file. if 'local_address' not in state: state['local_address'] = set() elif local_address not in state['local_address']: log_warning("You may have written output from two different apps.", state) state['local_address'].add(local_address) if state['obfuscate']: address[0] = obfuscate(address[0], state)[:15] address[1] = obfuscate(address[1], state)[:5] log_cfg("Local address: %s %s" % (address[0], address[1]), state)
def on_get_valid_interface(match, state): """It happens when a valid interface is queried.""" if match[2] == "1": multicast = "with" if match[3] == "1" else "no" log_cfg("Valid interface: %s (%s multicast)" % (match[1], multicast), state)
def on_find_valid_interface(match, state): """It happens when a valid interface is found.""" log_cfg("Valid interface: %s" % match[0], state)
def on_envvar_file_found(match, state): """It happens when the middleware found an env var or file.""" log_cfg("%s %s found" % (match[0].capitalize(), match[1]), state)
def on_participant_initial_peers(match, state): """It happens for the initial peers.""" initial_peers = [get_locator(peer, state) for peer in match[0].split(",")] state['initial_peers'] = initial_peers log_cfg("Initial peers: %s" % ", ".join(initial_peers), state)
def on_library_version(match, state): """It happens for the library version.""" log_cfg("Version of %s is %s" % (match[0], match[1]), state)