NVIDIA Morpheus (24.06)
(Latest Version)

morpheus.utils.monitor_utils.MonitorController

class MonitorController(position, description, smoothing, unit, delayed_start, determine_count_fn, log_level, tqdm_class=None)[source]

Bases: object

Controls and displays throughput numbers at a specific point in the pipeline.

Parameters:
position: int

Specifies the monitor’s position on the console.

descriptionstr, default = “Progress”

Name to show for this Monitor Stage in the console window.

smoothingfloat

Smoothing parameter to determine how much the throughput should be averaged. 0 = Instantaneous, 1 = Average.

unitstr

Units to show in the rate value.

delayed_startbool

When delayed_start is enabled, the progress bar will not be shown until the first message is received. Otherwise, the progress bar is shown on pipeline startup and will begin timing immediately. In large pipelines, this option may be desired to give a more accurate timing.

determine_count_fntyping.Callable[[typing.Any], int]

Custom function for determining the count in a message. Gets called for each message. Allows for correct counting of batched and sliced messages.

log_levelmorpheus.utils.logger.LogLevels, default = ‘INFO’

Enable this stage when the configured log level is at log_level or lower.

tqdm_class: `tqdm`, default = None

Custom implementation of tqdm if required.

Attributes:
delayed_start

progress

Methods

auto_count_fn(x)

This is a helper function that is used to determine the count of messages received by the monitor.

ensure_progress_bar()

Ensures that the progress bar is initialized and ready for display.

is_enabled()

Returns a boolean indicating whether or not the logger is enabled.

progress_sink(x)

Receives a message and determines the count of the message.

refresh_progress(_)

Refreshes the progress bar display.

sink_on_completed()

Stops the progress bar and prevents the monitors from writing over each other when the last stage completes.

auto_count_fn(x)[source]

This is a helper function that is used to determine the count of messages received by the monitor.

Parameters:
x: typing.Union[cudf.DataFrame, MultiMessage, MessageMeta, ControlMessage, typing.List]

Message that determines the count of the message

Returns:
Message count.

ensure_progress_bar()[source]

Ensures that the progress bar is initialized and ready for display.

is_enabled()[source]

Returns a boolean indicating whether or not the logger is enabled.

progress_sink(x)[source]

Receives a message and determines the count of the message. The progress bar is displayed and the progress is updated.

Parameters:
x: typing.Union[cudf.DataFrame, MultiMessage, MessageMeta, ControlMessage, typing.List]

Message that determines the count of the message

Returns:
x: typing.Union[cudf.DataFrame, MultiMessage, MessageMeta, ControlMessage, typing.List]

refresh_progress(_)[source]

Refreshes the progress bar display.

sink_on_completed()[source]

Stops the progress bar and prevents the monitors from writing over each other when the last stage completes.

© Copyright 2023, NVIDIA. Last updated on Oct 12, 2023.