Skip to main content

Monitor

class automation.monitor.Monitor()

Base class for monitoring Tasks on the system. Inherit to implement specific logic


get_query_parameters

get_query_parameters()

Return the query parameters for the monitoring. This should be overloaded with specific implementation query

  • Return dict

    Example dictionary: {‘status’: [‘failed’], ‘order_by’: [‘-last_update’]}

  • Return type

    dict


monitor

monitor(pool_period=15.0)

Main loop function, this call will never leave, it implements the main monitoring loop. Every loop step, monitor_step is called (implementing the filter/query interface) In order to combine multiple Monitor objects, call monitor_step manually.

  • Parameters

    pool_period (float ) – pool period in seconds

  • Return type

    ()

  • Returns

    Function will never return


monitor_step

monitor_step()

Implement the main query / interface of the monitor class. In order to combine multiple Monitor objects, call monitor_step manually. If Tasks are detected in this call,

  • Return type

    ()

  • Returns

    None


process_task

process_task(task)

type: (Task) -> ()

Abstract function

Called on every Task that we monitor. For example, monitoring failed Task, will call this Task the first time the Task was detected as failed.

  • Returns

    None


set_projects

set_projects(project_names=None, project_names_re=None, project_ids=None)

Set the specific projects to monitor, default is all projects.

  • Parameters

    • project_names (Optional [ Sequence [ str ] ] ) – List of project names to monitor (exact name matched)

    • project_names_re (Optional [ Sequence [ str ] ] ) – List of project names to monitor (with regular expression matching)

    • project_ids (Optional [ Sequence [ str ] ] ) – List of project ids to monitor

  • Return type

    ()

  • Returns


set_task_name_filter

set_task_name_filter(task_name_filter=None)

Set the task filter selection

  • Parameters

    task_name_filter (Optional [ str ] ) – List of project names to monitor (exact name matched)

  • Return type

    ()

  • Returns