Class: QgsRuntimeProfiler¶
- class qgis.core.QgsRuntimeProfiler¶
Bases:
PyQt5.QtCore.QAbstractItemModel
Constructor to create a new runtime profiler.
Warning
QgsRuntimeProfiler
is not usually instantied manually, but rather accessed throughQgsApplication.profiler()
.Provides a method of recording run time profiles of operations, allowing easy recording of their overall run time.
QgsRuntimeProfiler
is not usually instantied manually, but rather accessed throughQgsApplication.profiler()
.This class is thread-safe only if accessed through
QgsApplication.profiler()
. If accessed in this way, operations can be profiled from non-main threads.Methods
Begin the group for the profiler.
beginInsertColumns
beginInsertRows
beginMoveColumns
beginMoveRows
beginRemoveColumns
beginRemoveRows
changePersistentIndex
Returns a list of all child groups with the specified
parent
.clear Clear all profile data.
- param parent
createIndex
- param index
decodeData
End the current profile event.
End the current active group.
Emitted when a new group has started being profiled.
Returns
True
if the specifiedgroup
is currently being logged, i.e. it has a entry which has started and not yet stopped.Returns the set of known groups.
- param section
- param row
- param child
Returns the profile time for the specified
name
.- param parent
Start a profile event with the given name.
The current total time collected in the profiler.
Returns the translated name of a standard profile
group
.- beginGroup(self, name: str)¶
Begin the group for the profiler. Groups will append {GroupName}/ to the front of the profile tag set using start.
- Parameters
name (str) – The name of the group.
Deprecated since version use:
start()
instead
- QgsRuntimeProfiler.beginInsertColumns(self, QModelIndex, int, int)
- QgsRuntimeProfiler.beginInsertRows(self, QModelIndex, int, int)
- QgsRuntimeProfiler.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsRuntimeProfiler.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsRuntimeProfiler.beginRemoveColumns(self, QModelIndex, int, int)
- QgsRuntimeProfiler.beginRemoveRows(self, QModelIndex, int, int)
- beginResetModel(self)¶
- QgsRuntimeProfiler.changePersistentIndex(self, QModelIndex, QModelIndex)
- changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])¶
- childEvent(self, QChildEvent)¶
- childGroups(self, parent: str = '', group: str = '') → List[str]¶
Returns a list of all child groups with the specified
parent
.New in version 3.14.
- Parameters
parent (str = '') –
group (str = '') –
- Return type
List[str]
- clear(self, group: str = '')¶
clear Clear all profile data.
- Parameters
group (str = '') –
- columnCount(self, parent: QModelIndex = QModelIndex()) → int¶
- Parameters
parent (QModelIndex = QModelIndex()) –
- Return type
int
- connectNotify(self, QMetaMethod)¶
- QgsRuntimeProfiler.createIndex(self, int, int, object: object = 0) -> QModelIndex
- customEvent(self, QEvent)¶
- data(self, index: QModelIndex, role: int = Qt.DisplayRole) → Any¶
- Parameters
index (QModelIndex) –
role (int = Qt.DisplayRole) –
- Return type
Any
- QgsRuntimeProfiler.decodeData(self, int, int, QModelIndex, QDataStream) -> bool
- disconnectNotify(self, QMetaMethod)¶
- encodeData(self, Iterable[QModelIndex], QDataStream)¶
- end(self, group: str = '')¶
End the current profile event.
- Parameters
group (str = '') –
- endInsertColumns(self)¶
- endInsertRows(self)¶
- endMoveColumns(self)¶
- endMoveRows(self)¶
- endRemoveColumns(self)¶
- endRemoveRows(self)¶
- endResetModel(self)¶
- groupAdded(self, group: str)¶
Emitted when a new group has started being profiled.
- Parameters
group (str) –
- groupIsActive(self, group: str) → bool¶
Returns
True
if the specifiedgroup
is currently being logged, i.e. it has a entry which has started and not yet stopped.New in version 3.14.
- Parameters
group (str) –
- Return type
bool
- groups(self) → Set[str]¶
Returns the set of known groups.
- Return type
Set[str]
- headerData(self, section: int, orientation: Qt.Orientation, role: int = Qt.DisplayRole) → Any¶
- Parameters
section (int) –
orientation (Qt.Orientation) –
role (int = Qt.DisplayRole) –
- Return type
Any
- index(self, row: int, column: int, parent: QModelIndex = QModelIndex()) → QModelIndex¶
- Parameters
row (int) –
column (int) –
parent (QModelIndex = QModelIndex()) –
- Return type
QModelIndex
- isSignalConnected(self, QMetaMethod) → bool¶
- parent(self, child: QModelIndex) → QModelIndex¶
- Parameters
child (QModelIndex) –
- Return type
QModelIndex
- persistentIndexList(self) → List[QModelIndex]¶
- profileTime(self, name: str, group: str = '') → float¶
Returns the profile time for the specified
name
.New in version 3.14.
- Parameters
name (str) –
group (str = '') –
- Return type
float
- receivers(self, PYQT_SIGNAL) → int¶
- resetInternalData(self)¶
- rowCount(self, parent: QModelIndex = QModelIndex()) → int¶
- Parameters
parent (QModelIndex = QModelIndex()) –
- Return type
int
- sender(self) → QObject¶
- senderSignalIndex(self) → int¶
- start(self, name: str, group: str = '')¶
Start a profile event with the given name. The
name
of the profile event. Will have the name of the activegroup
appended after ending.- Parameters
name (str) –
group (str = '') –
- timerEvent(self, QTimerEvent)¶
- totalTime(self, group: str = '') → float¶
The current total time collected in the profiler.
- Return type
float
- Returns
The current total time collected in the profiler.
- Parameters
group (str = '') –
- translateGroupName(group: str) → str¶
Returns the translated name of a standard profile
group
.- Parameters
group (str) –
- Return type
str