The monitor Module
A utility that prints the DBMS activity statistics, like currently running processes and some details about each process.
It can be used as a command line utility to monitor database activity or monitor a specific process.
It can also be used as Python API to run a long-running process within a database with performance monitoring.
- class Lock(data: List)[source]
Class resenting detailed information about a database lock
See also PostgreSQL Documentation
- class DBMonitorConfig(subclass, doc)[source]
Configuration for DBActivityMonitor class, a subclass of a general class
dorieh.platform.loader.common.DBConnectionConfig
It adds two parameters:
pid - process id to monitor. If it is given, then only this process is monitored
status - if this parameter is defined only processes with the specified status are monitored
Creates a new object
- Parameters:
subclass¶ – A concrete class containing configuration information Configuration options must be defined as class memebers with names, starting with one ‘_’ characters and values be instances of :class Argument:
description¶ – Optional text to use as description. If not specified, then it is extracted from subclass documentation
- pid: List[int]
process id list
- state: Optional[str]
Display only processes in the given state
- class DBActivityMonitor(context: Optional[DBConnectionConfig] = None)[source]
Main class of this module. Provides API to monitor database activity and execute long-running processes while monitoring their status.
- classmethod get_instance(context: DBConnectionConfig) DBMonitorConfig [source]
- run()[source]
This method is being run when the module is used as CLI. Prints current activity for selected processes. Processes are selected based on the value of pid and status configuration parameters.
See
dorieh.platform.loader.monitor.DBMonitorConfig
:return:
- get_indexing_progress() List[str] [source]
This method provides a more detailed statistics for processes that build an index. :return:
- get_activity(pid: Optional[int] = None) List[str] [source]
Returns a list of statuses, one status for every processed being monitored.
- Parameters:
pid¶ – optional process id, if given only status of this process would be provided
- Returns: