parsl.monitoring.db_logger.MonitoringConfig

class parsl.monitoring.db_logger.MonitoringConfig(host=None, port=None, enable_ssl=True, database_type='local_database', index_name='my_python_index', logger_name='parsl_db_logger', eng_link=None, version='1.0.0', web_app_host='http://localhost', web_app_port=8899, resource_loop_sleep_duration=15, workflow_name=None)[source]

This is a config class for monitoring.

__init__(host=None, port=None, enable_ssl=True, database_type='local_database', index_name='my_python_index', logger_name='parsl_db_logger', eng_link=None, version='1.0.0', web_app_host='http://localhost', web_app_port=8899, resource_loop_sleep_duration=15, workflow_name=None)[source]

Initializes a monitoring configuration class.

Parameters:
  • host (str) – Used with Elasticsearch logging, the location of where to access Elasticsearch. Required when using logging_type = ‘elasticsearch’.
  • port (int) – Used with Elasticsearch logging, the port of where to access Elasticsearch. Required when using logging_type = ‘elasticsearch’.
  • enable_ssl (Bool, optional) – Used with Elasticsearch logging, whether to use ssl when connecting to Elasticsearch.
  • database_type (str, optional) – Determines whether to use Elasticsearch logging or local database logging, defaults to ‘local_database’ and accepts ‘elasticsearch’.
  • index_name (str, optional) – Used with Elasticsearch logging, the name of the index to log to.
  • logger_name (str, optional) – Used with both Elasticsearch and local db logging to define naming conventions for loggers.
  • eng_link (str, optional) – Used with local database logging, SQLalchemy engine link to define where to connect to the database. If not set, DFK init will use a sqlite3 database inside the rundir.
  • version (str, optional) – Optional workflow identification to distinguish between workflows with the same name, not used internally only for display to user.
  • web_app_host (str, optional) – Used with local database logging, how to access the tornado logging server that is spawned by Parsl.
  • web_app_port (int, optional) – Used with local database logging, how to access the tornado logging server that is spawned by Parsl. Additionally, used with web app visualization. Opens a new port at web_app_host:(web_app_port + 1).
  • resource_loop_sleep_duration (float, optional) – The amount of time in seconds to sleep in between resource monitoring logs per task.
  • workflow_name (str, optional) – Name to record as the workflow base name, defaults to the name of the parsl script file if left as None.

Example

import parsl
from parsl.config import Config
from parsl.executors.threads import ThreadPoolExecutor
from parsl.monitoring.db_logger import MonitoringConfig

config = Config(
    executors=[ThreadPoolExecutor()],
    lazy_errors=True,
    monitoring_config=MonitoringConfig()
    # an example customization that will log to a specified database instead of the default and operate on a locally specified port.
    # monitoring_config=MonitoringConfig(eng_link='sqlite:///monitoring.db', web_app_host='http://localhost', web_app_port=9999)
)
parsl.load(config)

Methods

__init__([host, port, enable_ssl, …]) Initializes a monitoring configuration class.