ogstools.logparser.monitor module#

class ogstools.logparser.monitor.Monitor[source]#

Bases: object

A class to manage the data source for monitoring logs in Bokeh.

__init__(notebook_execution=True)[source]#
start_log_file_handler(log_file)[source]#

Set up the log file handler to monitor the log file. :type log_file: Path :param log_file: The path to the log file to monitor.

Return type:

None

build_layout(log_data, time_y_axis_type)[source]#

Builds a Bokeh figure, or a grid layout of figures, for log_data.

Parameters:
  • log_data (str | list[list[str]]) – Plot type. Can be a single string or a list of list of strings. E.g., [[‘step_start_time’, ‘step_size’], [‘assembly_time’, ‘linear_solver_time’]]

  • time_y_axis_type (str) – Type of the y-axis (‘linear’ or ‘log’) for simulation time-based data.

Return type:

figure | layout

generate_figure(log_data, time_y_axis_type)[source]#

Generates a Bokeh figure for the given log data.

Return type:

figure

update_data(handle_line_chart, time_window_length, iteration_window_length, update_interval=2)[source]#

Update the data source with new records from the queue. :type handle_line_chart: CommsHandle :param handle_line_chart: The handle for the Bokeh line chart. :type time_window_length: int :param time_window_length: The length of the time window for the data. :type iteration_window_length: int :param iteration_window_length: The length of the iteration window for the data. :type update_interval: float :param update_interval: The interval in seconds to update the plot.

Return type:

None