Skip to content

ptp4l_monitor_task

Monitor task for ptp4l systemd units.

Classes:

Ptp4lMonitorTask

Ptp4lMonitorTask(unit_name: str, hostname: str)

Bases: MonitorTask

Monitor task for a ptp4l systemd unit.

Parameters:

  • unit_name (str) –

    The systemd unit name to monitor.

  • hostname (str) –

    The local hostname.

Raises:

Methods:

  • __str__

    Return a string representation of the task.

  • pmc_to_graph_updates

    Convert a PTP instance state to graph updates.

  • poll

    Poll journal and PMC for updates, yielding graph updates.

  • ptp4l_to_graph_updates

    Convert a ptp4l state change to graph updates (currently unused).

  • run_loop

    Run the polling loop at the specified period.

  • stop

    Stop the monitor task and reset the PMC monitor.

__str__

__str__() -> str

Return a string representation of the task.

pmc_to_graph_updates

pmc_to_graph_updates(inst: PtpInstance)

Convert a PTP instance state to graph updates.

poll async

poll()

Poll journal and PMC for updates, yielding graph updates.

ptp4l_to_graph_updates

ptp4l_to_graph_updates(
    state_change: SystemdUnitStateChange,
)

Convert a ptp4l state change to graph updates (currently unused).

run_loop async

run_loop(period_s: float)

Run the polling loop at the specified period.

stop

stop()

Stop the monitor task and reset the PMC monitor.