firebird.lib.monitor¶
Enums¶
- class firebird.lib.monitor.BackupState(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnum
Physical backup state.
- MERGE = 2¶
- NORMAL = 0¶
- STALLED = 1¶
- class firebird.lib.monitor.State(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnum
Object state.
- ACTIVE = 1¶
- IDLE = 0¶
- class firebird.lib.monitor.IsolationMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnum
Transaction solation mode.
Changed in version 1.4.0: -
READ_COMMITTED_READ_CONSISTENCY
value added- CONCURRENCY = 1¶
- CONSISTENCY = 0¶
- READ_COMMITTED_NO_RV = 3¶
- READ_COMMITTED_READ_CONSISTENCY = 4¶
- READ_COMMITTED_RV = 2¶
- class firebird.lib.monitor.Group(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnum
Statistics group.
- ATTACHMENT = 1¶
- CALL = 4¶
- DATABASE = 0¶
- STATEMENT = 3¶
- TRANSACTION = 2¶
Classes¶
- class firebird.lib.monitor.Monitor(connection: Connection)[source]¶
Bases:
object
Class for access to Firebird monitoring tables.
- Parameters:
connection (Connection)
- __init__(connection: Connection)[source]¶
- Parameters:
connection (Connection) – Connection that should be used to access monitoring tables.
- clear()[source]¶
Clear all data fetched from monitoring tables.
Note
A snapshot is created the first time any of the monitoring information is being accessed.
- take_snapshot() None [source]¶
Takes fresh snapshot of the monitoring information.
- Return type:
None
- property attachments: DataList[AttachmentInfo]¶
List of all attachments.
- property callstack: DataList[CallStackInfo]¶
List with complete call stack.
- property closed: bool¶
True if link to
Connection
is closed.
- property compiled_statements: DataList[CompiledStatementInfo]¶
List of all compiled statements.
Added in version 1.4.0.
- property db: DatabaseInfo¶
DatabaseInfo
object for attached database.
- property iostats: DataList[IOStatsInfo]¶
List of all I/O statistics.
- property statements: DataList[StatementInfo]¶
List of all statements.
- property tablestats: DataList[TableStatsInfo]¶
List of all table record I/O statistics.
- property this_attachment: AttachmentInfo¶
AttachmentInfo
object for current connection.
- property transactions: DataList[TransactionInfo]¶
List of all transactions.
- property variables: DataList[ContextVariableInfo]¶
List of all context variables.
- class firebird.lib.monitor.InfoItem(monitor: Monitor, attributes: Dict[str, Any])[source]¶
Bases:
object
Base class for all database monitoring objects.
- class firebird.lib.monitor.DatabaseInfo(monitor: Monitor, attributes: Dict[str, Any])[source]¶
Bases:
InfoItem
Information about attached database.
- property backup_state: BackupState¶
Current state of database with respect to nbackup physical backup.
- property created: datetime¶
Creation date and time, i.e., when the database was created or last restored.
- property crypt_state: CryptState | None¶
Current state of database encryption.
Added in version 1.4.0.
- property file_id: str | None¶
Unique ID of the database file at the filesystem level.
Added in version 1.4.0.
- property guid: UUID | None¶
Database GUID (persistent until restore / fixup).
Added in version 1.4.0.
- property iostats: IOStatsInfo¶
IOStatsInfo
for this object.
- property next_attachment: int | None¶
Current value of the next attachment ID counter.
Added in version 1.4.0.
- property next_statement: int | None¶
Current value of the next statement ID counter.
Added in version 1.4.0.
- property ost: int¶
Transaction ID of the Oldest Snapshot, i.e., the number of the OAT when the last garbage collection was done.
- property shutdown_mode: ShutdownMode¶
Current shutdown mode.
- property sweep_interval: int¶
The sweep interval configured in the database header. Value 0 indicates that sweeping is disabled.
- property tablestats: Dict[str, TableStatsInfo]¶
Dictionary of
TableStatsInfo
instances for this object.
- class firebird.lib.monitor.AttachmentInfo(monitor: Monitor, attributes: Dict[str, Any])[source]¶
Bases:
InfoItem
Information about attachment (connection) to database.
- is_gc_allowed() bool [source]¶
Returns True if Garbage Collection is enabled for this attachment.
- Return type:
- terminate() None [source]¶
Terminates client session associated with this attachment.
- Raises:
firebird.base.types.Error – If attachement is current session.
- Return type:
None
- property character_set: CharacterSet¶
Character set name for this attachment.
- property iostats: IOStatsInfo¶
IOStatsInfo
for this object.
- property statements: DataList[StatementInfo]¶
List of statements associated with attachment.
- property tablestats: Dict[str, TableStatsInfo]¶
Dictionary of
TableStatsInfo
instances for this object.
- property transactions: DataList[TransactionInfo]¶
List of transactions associated with attachment.
- property variables: DataList[ContextVariableInfo]¶
List of variables associated with attachment.
- class firebird.lib.monitor.TransactionInfo(monitor: Monitor, attributes: Dict[str, Any])[source]¶
Bases:
InfoItem
Information about transaction.
- property attachment: AttachmentInfo¶
AttachmentInfo
instance to which this transaction belongs.
- property iostats: IOStatsInfo¶
IOStatsInfo
for this object.
- property isolation_mode: IsolationMode¶
Transaction isolation mode code.
- property statements: DataList[StatementInfo]¶
List of statements associated with transaction.
- property tablestats: Dict[str, TableStatsInfo]¶
Dictionary of
TableStatsInfo
instances for this object.
- property variables: DataList[ContextVariableInfo]¶
List of variables associated with transaction.
- class firebird.lib.monitor.StatementInfo(monitor: Monitor, attributes: Dict[str, Any])[source]¶
Bases:
InfoItem
Information about executed SQL statement.
- terminate() None [source]¶
Terminates execution of statement.
- Raises:
Error – If this attachement is current session.
- Return type:
None
- property attachment: AttachmentInfo¶
AttachmentInfo
instance to which this statement belongs.
- property callstack: DataList[CallStackInfo]¶
List with call stack for statement.
- property compiled_statement: CompiledStatementInfo | None¶
CompiledStatementInfo
instance to which this statement relates.Added in version 1.4.0.
- property iostats: IOStatsInfo¶
IOStatsInfo
for this object.
- property tablestats: Dict[str, TableStatsInfo]¶
Dictionary of
TableStatsInfo
instances for this object.
- property transaction: TransactionInfo¶
TransactionInfo
instance to which this statement belongs or None.
- class firebird.lib.monitor.CallStackInfo(monitor: Monitor, attributes: Dict[str, Any])[source]¶
Bases:
InfoItem
Information about PSQL call (stack frame).
- property caller: CallStackInfo¶
Call stack entry (
CallStackInfo
) of the caller.
- property compiled_statement: CompiledStatementInfo | None¶
CompiledStatementInfo
instance to which this statement relates.Added in version 1.4.0.
- property iostats: IOStatsInfo¶
IOStatsInfo
for this object.
- property object_type: ObjectType¶
PSQL object type.
- property statement: StatementInfo¶
Top-level
StatementInfo
instance to which this call stack entry belongs.
- class firebird.lib.monitor.IOStatsInfo(monitor: Monitor, attributes: Dict[str, Any])[source]¶
Bases:
InfoItem
Information about page and row level I/O operations, and about memory consumption.
- property backouts: int¶
Number of records where a new primary record version or a change to an existing primary record version is backed out due to rollback or savepoint undo.
- property expunges: int¶
Number of records where record version chain is being deleted due to deletions by transactions older than OAT.
- property intermediate_gc: int | None¶
Number of records processed by the intermediate garbage collection.
Added in version 1.4.0.
- property max_memory_allocated: int¶
Maximum number of bytes allocated from the operating system by this object.
- property owner: DatabaseInfo | AttachmentInfo | TransactionInfo | StatementInfo | CallStackInfo¶
Object that owns this IOStats instance.
- class firebird.lib.monitor.TableStatsInfo(monitor: Monitor, attributes: Dict[str, Any])[source]¶
Bases:
InfoItem
Information about row level I/O operations on single table.
- property backouts: int¶
Number of records where a new primary record version or a change to an existing primary record version is backed out due to rollback or savepoint undo.
- property expunges: int¶
Number of records where record version chain is being deleted due to deletions by transactions older than OAT.
- property owner: DatabaseInfo | AttachmentInfo | TransactionInfo | StatementInfo | CallStackInfo¶
Object that owns this TableStatsInfo instance.
- class firebird.lib.monitor.ContextVariableInfo(monitor: Monitor, attributes: Dict[str, Any])[source]¶
Bases:
InfoItem
Information about context variable.
- is_attachment_var() bool [source]¶
Returns True if variable is associated to attachment context.
- Return type:
- is_transaction_var() bool [source]¶
Returns True if variable is associated to transaction context.
- Return type:
- property attachment: AttachmentInfo¶
AttachmentInfo
instance to which this context variable belongs or None.
- property transaction: TransactionInfo¶
TransactionInfo
instance to which this context variable belongs or None.
- class firebird.lib.monitor.CompiledStatementInfo(monitor: Monitor, attributes: Dict[str, Any])[source]¶
Bases:
InfoItem
Information about compiled statement.
Added in version 1.4.0.
- property iostats: IOStatsInfo¶
IOStatsInfo
for this object.
- property object_type: ObjectType | None¶
PSQL object type.