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
- description
- smoothing
- unit
- delayed_start
- determine_count_fn
-
log_level :
morpheus.utils.logger.LogLevels
- tqdm_class: `tqdm`, default = None
Specifies the monitor’s position on the console.
Name to show for this Monitor Stage in the console window.
Smoothing parameter to determine how much the throughput should be averaged. 0 = Instantaneous, 1 = Average.
Units to show in the rate value.
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.
Custom function for determining the count in a message. Gets called for each message. Allows for correct counting of batched and sliced messages.
Enable this stage when the configured log level is at
log_level
or lower.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.