firebird.lib.trace

Enums

class firebird.lib.trace.Status(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Trace event status codes.

FAILED = 'F'
OK = ' '
UNAUTHORIZED = 'U'
UNKNOWN = '?'
class firebird.lib.trace.Event(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Trace event codes.

ATTACH_DATABASE = 7
ATTACH_SERVICE = 26
CLOSE_CURSOR = 18
COMMIT_RETAINING = 12
COMMIT_TRANSACTION = 10
COMPILE_BLR = 36
CREATE_DATABASE = 5
DETACH_DATABASE = 8
DETACH_SERVICE = 27
DROP_DATABASE = 6
ERROR = 30
EXECUTE_BLR = 37
EXECUTE_DYN = 38
EXECUTE_FUNCTION_FINISH = 22
EXECUTE_FUNCTION_START = 21
EXECUTE_PROCEDURE_FINISH = 24
EXECUTE_PROCEDURE_START = 23
EXECUTE_STATEMENT_FINISH = 16
EXECUTE_STATEMENT_START = 15
EXECUTE_TRIGGER_FINISH = 20
EXECUTE_TRIGGER_START = 19
FREE_STATEMENT = 17
PREPARE_STATEMENT = 14
QUERY_SERVICE = 28
ROLLBACK_RETAINING = 13
ROLLBACK_TRANSACTION = 11
SET_CONTEXT = 29
START_SERVICE = 25
START_TRANSACTION = 9
SWEEP_FAILED = 35
SWEEP_FINISH = 34
SWEEP_PROGRESS = 33
SWEEP_START = 32
TRACE_FINI = 4
TRACE_INIT = 2
TRACE_SUSPENDED = 3
UNKNOWN = 1
WARNING = 31

Dataclasses

class firebird.lib.trace.AttachmentInfo(attachment_id: int, database: str, charset: str, protocol: str, address: str, user: str, role: str, remote_process: str, remote_pid: int)[source]

Bases: TraceInfo

Information about database attachment.

Parameters:
  • attachment_id (int) –

  • database (str) –

  • charset (str) –

  • protocol (str) –

  • address (str) –

  • user (str) –

  • role (str) –

  • remote_process (str) –

  • remote_pid (int) –

address: str

Network address

attachment_id: int

Attachamnet ID

charset: str

Database character set

database: str

Database name/file

protocol: str

Network protocol

remote_pid: int

Remote process ID

remote_process: str

Remote process

role: str

Role name

user: str

User name

class firebird.lib.trace.TransactionInfo(attachment_id: int, transaction_id: int, initial_id: int, options: List[str])[source]

Bases: TraceInfo

Information about transaction.

Parameters:
  • attachment_id (int) –

  • transaction_id (int) –

  • initial_id (int) –

  • options (List[str]) –

attachment_id: int

Attachamnet ID

initial_id: int

Initial transaction ID (for retained ones)

options: List[str]

List of transaction options

transaction_id: int

Transaction ID

class firebird.lib.trace.ServiceInfo(service_id: int, user: str, protocol: str, address: str, remote_process: str, remote_pid: int)[source]

Bases: TraceInfo

Information about service attachment.

Parameters:
  • service_id (int) –

  • user (str) –

  • protocol (str) –

  • address (str) –

  • remote_process (str) –

  • remote_pid (int) –

address: str

Network address

protocol: str

Network protocol

remote_pid: int

Remote process ID

remote_process: str

Remote process

service_id: int

Service ID

user: str

User name

class firebird.lib.trace.SQLInfo(sql_id: int, sql: str, plan: str)[source]

Bases: TraceInfo

Information about SQL statement.

Parameters:
  • sql_id (int) –

  • sql (str) –

  • plan (str) –

plan: str

Execution plan

sql: str

SQL command

sql_id: int

SQL ID

class firebird.lib.trace.ParamSet(par_id: int, params: List[Tuple[str, Any]])[source]

Bases: TraceInfo

Information about set of parameters.

Parameters:
par_id: int

Parameter set ID

params: List[Tuple[str, Any]]

List of parameters (name, value pairs)

class firebird.lib.trace.AccessStats(table: str, natural: int, index: int, update: int, insert: int, delete: int, backout: int, purge: int, expunge: int)[source]

Bases: TraceInfo

Table access statistics.

Parameters:
  • table (str) –

  • natural (int) –

  • index (int) –

  • update (int) –

  • insert (int) –

  • delete (int) –

  • backout (int) –

  • purge (int) –

  • expunge (int) –

backout: int

Number of rows where a new primary record version or a change to an existing primary record version is backed out due to rollback or savepoint undo

delete: int

Number of deleted rows

expunge: int

Number of rows where record version chain is being deleted due to deletions by transactions older than OAT

index: int

Number of rows accessed via index

insert: int

Number of inserted rows

natural: int

Number of rows accessed sequentially

purge: int

Number of rows where record version chain is being purged of versions no longer needed by OAT or younger transactions

table: str

Table name

update: int

Number of updated rows

class firebird.lib.trace.EventTraceInit(event_id: int, timestamp: datetime, session_name: str)[source]

Bases: TraceEvent

Trace session initialized trace event

Parameters:
event_id: int

Trace event ID

session_name: str

Trace session name

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventTraceSuspend(event_id: int, timestamp: datetime, session_name: str)[source]

Bases: TraceEvent

Trace session suspended trace event

Parameters:
event_id: int

Trace event ID

session_name: str

Trace session name

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventTraceFinish(event_id: int, timestamp: datetime, session_name: str)[source]

Bases: TraceEvent

Trace session finished trace event

Parameters:
event_id: int

Trace event ID

session_name: str

Trace session name

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventCreate(event_id: int, timestamp: datetime, status: Status, attachment_id: int, database: str, charset: str, protocol: str, address: str, user: str, role: str, remote_process: str, remote_pid: int)[source]

Bases: TraceEvent

Create database trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • database (str) –

  • charset (str) –

  • protocol (str) –

  • address (str) –

  • user (str) –

  • role (str) –

  • remote_process (str) –

  • remote_pid (int) –

address: str

Netwrok address

attachment_id: int

Database attachent ID

charset: str

Connection character set

database: str

Database name/file

event_id: int

Trace event ID

protocol: str

Netwrok protocol

remote_pid: int

Remote process

remote_process: str

Remote process

role: str

Role name

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

user: str

User name

class firebird.lib.trace.EventDrop(event_id: int, timestamp: datetime, status: Status, attachment_id: int, database: str, charset: str, protocol: str, address: str, user: str, role: str, remote_process: str, remote_pid: int)[source]

Bases: TraceEvent

Drop database trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • database (str) –

  • charset (str) –

  • protocol (str) –

  • address (str) –

  • user (str) –

  • role (str) –

  • remote_process (str) –

  • remote_pid (int) –

address: str

Netwrok address

attachment_id: int

Database attachent ID

charset: str

Connection character set

database: str

Database name/file

event_id: int

Trace event ID

protocol: str

Netwrok protocol

remote_pid: int

Remote process

remote_process: str

Remote process

role: str

Role name

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

user: str

User name

class firebird.lib.trace.EventAttach(event_id: int, timestamp: datetime, status: Status, attachment_id: int, database: str, charset: str, protocol: str, address: str, user: str, role: str, remote_process: str, remote_pid: int)[source]

Bases: TraceEvent

Database attach trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • database (str) –

  • charset (str) –

  • protocol (str) –

  • address (str) –

  • user (str) –

  • role (str) –

  • remote_process (str) –

  • remote_pid (int) –

address: str

Netwrok address

attachment_id: int

Database attachent ID

charset: str

Connection character set

database: str

Database name/file

event_id: int

Trace event ID

protocol: str

Netwrok protocol

remote_pid: int

Remote process

remote_process: str

Remote process

role: str

Role name

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

user: str

User name

class firebird.lib.trace.EventDetach(event_id: int, timestamp: datetime, status: Status, attachment_id: int, database: str, charset: str, protocol: str, address: str, user: str, role: str, remote_process: str, remote_pid: int)[source]

Bases: TraceEvent

Database detach trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • database (str) –

  • charset (str) –

  • protocol (str) –

  • address (str) –

  • user (str) –

  • role (str) –

  • remote_process (str) –

  • remote_pid (int) –

address: str

Netwrok address

attachment_id: int

Database attachent ID

charset: str

Connection character set

database: str

Database name/file

event_id: int

Trace event ID

protocol: str

Netwrok protocol

remote_pid: int

Remote process

remote_process: str

Remote process

role: str

Role name

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

user: str

User name

class firebird.lib.trace.EventTransactionStart(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, options: List[str])[source]

Bases: TraceEvent

Transaction start trace event

Parameters:
attachment_id: int

Database attachent ID

event_id: int

Trace event ID

options: List[str]

List of transaction options

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

class firebird.lib.trace.EventCommit(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, options: List[str], run_time: int, reads: int, writes: int, fetches: int, marks: int)[source]

Bases: TraceEvent

Commit trace event

Parameters:
attachment_id: int

Database attachent ID

event_id: int

Trace event ID

fetches: int

Number of page fetches

marks: int

Number of pages with changes pending

options: List[str]

List of transaction options

reads: int

Number of page reads

run_time: int

Execution time in ms

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

writes: int

Number of page writes

class firebird.lib.trace.EventRollback(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, options: List[str], run_time: int, reads: int, writes: int, fetches: int, marks: int)[source]

Bases: TraceEvent

Rollback trace event

Parameters:
attachment_id: int

Database attachent ID

event_id: int

Trace event ID

fetches: int

Number of page fetches

marks: int

Number of pages with changes pending

options: List[str]

List of transaction options

reads: int

Number of page reads

run_time: int

Execution time in ms

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

writes: int

Number of page writes

class firebird.lib.trace.EventCommitRetaining(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, options: List[str], new_transaction_id: int, run_time: int, reads: int, writes: int, fetches: int, marks: int)[source]

Bases: TraceEvent

Commit retaining trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • transaction_id (int) –

  • options (List[str]) –

  • new_transaction_id (int) –

  • run_time (int) –

  • reads (int) –

  • writes (int) –

  • fetches (int) –

  • marks (int) –

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

fetches: int

Number of page fetches

marks: int

Number of pages with changes pending

new_transaction_id: int

New transaction number

options: List[str]

List of transaction options

reads: int

Number of page reads

run_time: int

Execution time in ms

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

writes: int

Number of page writes

class firebird.lib.trace.EventRollbackRetaining(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, options: List[str], new_transaction_id: int, run_time: int, reads: int, writes: int, fetches: int, marks: int)[source]

Bases: TraceEvent

Rollback retaining trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • transaction_id (int) –

  • options (List[str]) –

  • new_transaction_id (int) –

  • run_time (int) –

  • reads (int) –

  • writes (int) –

  • fetches (int) –

  • marks (int) –

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

fetches: int

Number of page fetches

marks: int

Number of pages with changes pending

new_transaction_id: int

New transaction number

options: List[str]

List of transaction options

reads: int

Number of page reads

run_time: int

Execution time in ms

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

writes: int

Number of page writes

class firebird.lib.trace.EventPrepareStatement(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, statement_id: int, sql_id: int, prepare_time: int)[source]

Bases: TraceEvent

Prepare statement trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • transaction_id (int) –

  • statement_id (int) –

  • sql_id (int) –

  • prepare_time (int) –

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

prepare_time: int

Statement prepare time in ms

sql_id: int

SQL ID (SQLInfo)

statement_id: int

Statement ID

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

class firebird.lib.trace.EventStatementStart(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, statement_id: int, sql_id: int, param_id: int)[source]

Bases: TraceEvent

Statement start trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • transaction_id (int) –

  • statement_id (int) –

  • sql_id (int) –

  • param_id (int) –

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

param_id: int

Param set ID (ParamSet)

sql_id: int

SQL ID (SQLInfo)

statement_id: int

Statement ID

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

class firebird.lib.trace.EventStatementFinish(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, statement_id: int, sql_id: int, param_id: int, records: int, run_time: int, reads: int, writes: int, fetches: int, marks: int, access: List[AccessStats])[source]

Bases: TraceEvent

Statement finish trace event

Parameters:
access: List[AccessStats]

List with table access statistics

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

fetches: int

Number of page fetches

marks: int

Number of pages with changes pending

param_id: int

Param set ID (ParamSet)

reads: int

Number of page reads

records: int

Number of affected rows

run_time: int

Execution time in ms

sql_id: int

SQL ID (SQLInfo)

statement_id: int

Statement ID

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

writes: int

Number of page writes

class firebird.lib.trace.EventFreeStatement(event_id: int, timestamp: datetime, attachment_id: int, statement_id: int, sql_id: int)[source]

Bases: TraceEvent

Free statement trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • attachment_id (int) –

  • statement_id (int) –

  • sql_id (int) –

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

sql_id: int

SQL ID (SQLInfo)

statement_id: int

Statement ID

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventCloseCursor(event_id: int, timestamp: datetime, attachment_id: int, statement_id: int, sql_id: int)[source]

Bases: TraceEvent

Close cursor trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • attachment_id (int) –

  • statement_id (int) –

  • sql_id (int) –

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

sql_id: int

SQL ID (SQLInfo)

statement_id: int

Statement ID

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventTriggerStart(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, trigger: str, table: str, event: str)[source]

Bases: TraceEvent

Trigger start trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • transaction_id (int) –

  • trigger (str) –

  • table (str) –

  • event (str) –

attachment_id: int

Database attachent ID

event: str

Trigger event

event_id: int

Trace event ID

status: Status

Event status

table: str

Table name

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

trigger: str

trigger name

class firebird.lib.trace.EventTriggerFinish(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, trigger: str, table: str, event: str, run_time: int, reads: int, writes: int, fetches: int, marks: int, access: List[AccessStats])[source]

Bases: TraceEvent

Trigger finish trace event

Parameters:
access: List[AccessStats]

List with table access statistics

attachment_id: int

Database attachent ID

event: str

Trigger event

event_id: int

Trace event ID

fetches: int

Number of page fetches

marks: int

Number of pages with changes pending

reads: int

Number of page reads

run_time: int

Execution time in ms

status: Status

Event status

table: str

Table name

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

trigger: str

trigger name

writes: int

Number of page writes

class firebird.lib.trace.EventProcedureStart(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, procedure: str, param_id: int)[source]

Bases: TraceEvent

Procedure start trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • transaction_id (int) –

  • procedure (str) –

  • param_id (int) –

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

param_id: int

Param set ID (ParamSet)

procedure: str

procedure name

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

class firebird.lib.trace.EventProcedureFinish(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, procedure: str, param_id: int, records: int, run_time: int, reads: int, writes: int, fetches: int, marks: int, access: List[AccessStats])[source]

Bases: TraceEvent

Procedure finish trace event

Parameters:
access: List[AccessStats]

List with table access statistics

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

fetches: int

Number of page fetches

marks: int

Number of pages with changes pending

param_id: int

Param set ID (ParamSet)

procedure: str

procedure name

reads: int

Number of page reads

records: int

Number of affected rows

run_time: int

Execution time in ms

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

writes: int

Number of page writes

class firebird.lib.trace.EventFunctionStart(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, function: str, param_id: int)[source]

Bases: TraceEvent

Function start trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • transaction_id (int) –

  • function (str) –

  • param_id (int) –

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

function: str

procedure name

param_id: int

Param set ID (ParamSet)

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

class firebird.lib.trace.EventFunctionFinish(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, function: str, param_id: int, returns: Tuple[str, Any], run_time: int, reads: int, writes: int, fetches: int, marks: int, access: List[AccessStats])[source]

Bases: TraceEvent

Function finish trace event

Parameters:
access: List[AccessStats]

List with table access statistics

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

fetches: int

Number of page fetches

function: str

procedure name

marks: int

Number of pages with changes pending

param_id: int

Param set ID (ParamSet)

reads: int

Number of page reads

returns: Tuple[str, Any]

Return value

run_time: int

Execution time in ms

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

writes: int

Number of page writes

class firebird.lib.trace.EventServiceAttach(event_id: int, timestamp: datetime, status: Status, service_id: int)[source]

Bases: TraceEvent

Service attach trace event

Parameters:
event_id: int

Trace event ID

service_id: int

Service ID

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventServiceDetach(event_id: int, timestamp: datetime, status: Status, service_id: int)[source]

Bases: TraceEvent

Service detach trace event

Parameters:
event_id: int

Trace event ID

service_id: int

Service ID

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventServiceStart(event_id: int, timestamp: datetime, status: Status, service_id: int, action: str, parameters: List[str])[source]

Bases: TraceEvent

Service start trace event

Parameters:
action: str

Action performed by service

event_id: int

Trace event ID

parameters: List[str]

List of action parameters

service_id: int

Service ID

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventServiceQuery(event_id: int, timestamp: datetime, status: Status, service_id: int, action: str, sent: List[str], received: List[str])[source]

Bases: TraceEvent

Service query trace event

Parameters:
action: str

Action performed by service

event_id: int

Trace event ID

received: List[str]

List of received items

sent: List[str]

List of sent items

service_id: int

Service ID

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventSetContext(event_id: int, timestamp: datetime, attachment_id: int, transaction_id: int, context: str, key: str, value: str)[source]

Bases: TraceEvent

Set context variable trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • attachment_id (int) –

  • transaction_id (int) –

  • context (str) –

  • key (str) –

  • value (str) –

attachment_id: int

Database attachent ID

context: str

Context name

event_id: int

Trace event ID

key: str

Key

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

value: str

Value

class firebird.lib.trace.EventError(event_id: int, timestamp: datetime, attachment_id: int, place: str, details: List[str])[source]

Bases: TraceEvent

Error trace event

Parameters:
attachment_id: int

Database attachent ID

details: List[str]

Error details

event_id: int

Trace event ID

place: str

Place where error occured

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventWarning(event_id: int, timestamp: datetime, attachment_id: int, place: str, details: List[str])[source]

Bases: TraceEvent

Warning trace event

Parameters:
attachment_id: int

Database attachent ID

details: List[str]

Warning details

event_id: int

Trace event ID

place: str

Place where warning occured

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventServiceError(event_id: int, timestamp: datetime, service_id: int, place: str, details: List[str])[source]

Bases: TraceEvent

Service error trace event

Parameters:
details: List[str]

Error details

event_id: int

Trace event ID

place: str

Place where error occured

service_id: int

Service ID

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventServiceWarning(event_id: int, timestamp: datetime, service_id: int, place: str, details: List[str])[source]

Bases: TraceEvent

Service warning trace event

Parameters:
details: List[str]

Warning details

event_id: int

Trace event ID

place: str

Place where warning occured

service_id: int

Service ID

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventSweepStart(event_id: int, timestamp: datetime, attachment_id: int, oit: int, oat: int, ost: int, next: int)[source]

Bases: TraceEvent

Sweep start trace event

Parameters:
attachment_id: int

Database attachent ID

event_id: int

Trace event ID

next: int

Transaction ID of the next transaction that will be started

oat: int

Transaction ID of the oldest active transaction

oit: int

Transaction ID of the oldest [interesting] transaction

ost: int

Transaction ID of the Oldest Snapshot

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventSweepProgress(event_id: int, timestamp: datetime, attachment_id: int, run_time: int, reads: int, writes: int, fetches: int, marks: int, access: List[AccessStats])[source]

Bases: TraceEvent

Sweep progress trace event

Parameters:
access: List[AccessStats]

List with table access statistics

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

fetches: int

Number of page fetches

marks: int

Number of pages with changes pending

reads: int

Number of page reads

run_time: int

Execution time in ms

timestamp: datetime

Timestamp when the event occurred

writes: int

Number of page writes

class firebird.lib.trace.EventSweepFinish(event_id: int, timestamp: datetime, attachment_id: int, oit: int, oat: int, ost: int, next: int, run_time: int, reads: int, writes: int, fetches: int, marks: int, access: List[AccessStats])[source]

Bases: TraceEvent

Sweep finished trace event

Parameters:
access: List[AccessStats]

List with table access statistics

attachment_id: int

Database attachent ID

event_id: int

Trace event ID

fetches: int

Number of page fetches

marks: int

Number of pages with changes pending

next: int

Transaction ID of the next transaction that will be started

oat: int

Transaction ID of the oldest active transaction

oit: int

Transaction ID of the oldest [interesting] transaction

ost: int

Transaction ID of the Oldest Snapshot

reads: int

Number of page reads

run_time: int

Execution time in ms

timestamp: datetime

Timestamp when the event occurred

writes: int

Number of page writes

class firebird.lib.trace.EventSweepFailed(event_id: int, timestamp: datetime, attachment_id: int)[source]

Bases: TraceEvent

Sweep failed trace event

Parameters:
attachment_id: int

Database attachent ID

event_id: int

Trace event ID

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventBLRCompile(event_id: int, timestamp: datetime, status: Status, attachment_id: int, statement_id: int, content: str, prepare_time: int)[source]

Bases: TraceEvent

BLR compile trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • statement_id (int) –

  • content (str) –

  • prepare_time (int) –

attachment_id: int

Database attachent ID

content: str

BLR content

event_id: int

Trace event ID

prepare_time: int

Prepare time in ms

statement_id: int

Statement ID

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

class firebird.lib.trace.EventBLRExecute(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, statement_id: int, content: str, run_time: int, reads: int, writes: int, fetches: int, marks: int, access: List[AccessStats])[source]

Bases: TraceEvent

BLR execution trace event

Parameters:
access: List[AccessStats]

List with table access statistics

attachment_id: int

Database attachent ID

content: str

BLR content

event_id: int

Trace event ID

fetches: int

Number of page fetches

marks: int

Number of pages with changes pending

reads: int

Number of page reads

run_time: int

Execution time in ms

statement_id: int

Statement ID

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

writes: int

Number of page writes

class firebird.lib.trace.EventDYNExecute(event_id: int, timestamp: datetime, status: Status, attachment_id: int, transaction_id: int, content: str, run_time: int)[source]

Bases: TraceEvent

DYN execution trace event

Parameters:
  • event_id (int) –

  • timestamp (datetime) –

  • status (Status) –

  • attachment_id (int) –

  • transaction_id (int) –

  • content (str) –

  • run_time (int) –

attachment_id: int

Database attachent ID

content: str

DYN content

event_id: int

Trace event ID

run_time: int

Execution time in ms

status: Status

Event status

timestamp: datetime

Timestamp when the event occurred

transaction_id: int

Transaction ID

class firebird.lib.trace.EventUnknown(event_id: int, timestamp: datetime, data: str)[source]

Bases: TraceEvent

Uknown trace event

Parameters:
data: str

Event data

event_id: int

Trace event ID

timestamp: datetime

Timestamp when the event occurred

Classes

class firebird.lib.trace.TraceInfo[source]

Bases: object

Base class for trace info blocks.

class firebird.lib.trace.TraceEvent[source]

Bases: object

Base class for trace events.

class firebird.lib.trace.TraceParser[source]

Bases: object

Parser for standard textual trace log. Produces dataclasses describing individual trace log entries/events.

parse(lines: Iterable)[source]

Parse output from Firebird trace session.

Parameters:

lines (Iterable) – Iterable that return lines produced by Firebird trace session.

Yields:

TraceEvent and TraceInfo dataclasses describing individual trace log entries/events.

Raises:

firebird.base.types.Error – When any problem is found in input stream.

parse_event(trace_block: List[str]) TraceEvent[source]

Parse single trace event.

Parameters:

trace_block (List[str]) – List with trace entry lines for single trace event.

Return type:

TraceEvent

push(line: str | Sentinel) List[TraceEvent | TraceInfo] | None[source]

Push parser.

Parameters:

line (str | Sentinel) – Single trace output line, or STOP sentinel.

Returns:

None, or list with parsed elements (single event preceded by any info blocks related to it).

Raises:

Error – When pushed line is not recognized as part of trace event.

Return type:

List[TraceEvent | TraceInfo] | None

retrieve_info() List[TraceInfo][source]

Returns list of TraceInfo instances produced by last parse_event() call.

The list could be empty.

Important

The internal buffer for info instances is cleared after call to this method, so all produced info instances are returned only once.

Return type:

List[TraceInfo]

has_statement_free: bool

Parsing option indicating that parsed trace contains FREE_STATEMENT events. This has impact on cleanup of SQLInfo ID cache. When True, the SQLInfo is discarded when its FREE_STATEMENT event is processed. When False, the SQLInfo is discarded when its EXECUTE_STATEMENT_FINISH is processed.

next_event_id: int

Sequence id that would be assigned to next parsed event (starts with 1)

next_param_id: int

Sequence id that would be assigned to next parsed unique parameter (starts with 1)

next_sql_id: int

Sequence id that would be assigned to next parsed unique SQL command (starts with 1)

param_map

Dictionary that maps parameters (statement or procedure) keys to internal ids

seen_attachments: Set[int]

Set of attachment ids that were already processed

seen_services: set[int]

Set of service ids that were already processed

seen_transactions: Set[int]

Set of transaction ids that were already processed

sqlinfo_map: Dict[Tuple[str, str], int]

Dictionary that maps (sql_cmd, plan) keys to internal ids