morpheus.controllers.monitor_controller.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.

description

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

smoothing

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

unit

Units to show in the rate value.

delayed_start

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_fn

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

log_level : morpheus.utils.logger.LogLevels

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.

Previous morpheus.controllers.monitor_controller
Next morpheus.controllers.rss_controller
© Copyright 2024, NVIDIA. Last updated on Apr 25, 2024.