Process monitoring

Poll running processes and record process start and stop events for a monitoring session.

Process snapshots


source

get_current_processes

def get_current_processes(
    excluded_process_set
):

Return running (pid, process_name) pairs excluding configured processes.

Process event monitoring


source

start_process_monitoring

def start_process_monitoring(
    session_id, stop_event, excluded_processes, time_interval:int=5
):

Poll processes until stopped and log process start and stop events.

  • get_current_processes assumes the values returned by proc.info retain the requested ['pid', 'name'] order. Confirm this is an intentional psutil usage assumption.
  • The module logs process events and prints changes, but does not document or handle process-access exceptions such as permissions errors. Confirm whether those cases are handled elsewhere or should be addressed after the nbdev migration.