|
QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
|
Provides a method of recording run time profiles of operations, allowing easy recording of their overall run time. More...
#include <qgsruntimeprofiler.h>

Public Member Functions | |
| QgsRuntimeProfiler () | |
| Constructor to create a new runtime profiler. | |
| ~QgsRuntimeProfiler () override | |
| QString | asText (const QString &group=QString()) |
| Returns the model as a multi-line text string. | |
| Q_DECL_DEPRECATED void | beginGroup (const QString &name) |
| Begin the group for the profiler. | |
| QStringList | childGroups (const QString &parent=QString(), const QString &group="startup") const |
| Returns a list of all child groups with the specified parent. | |
| void | clear (const QString &group="startup") |
| clear Clear all profile data. | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| void | end (const QString &group="startup") |
| End the current profile event. | |
| Q_DECL_DEPRECATED void | endGroup () |
| End the current active group. | |
| void | groupAdded (const QString &group) |
| Emitted when a new group has started being profiled. | |
| bool | groupIsActive (const QString &group) const |
Returns true if the specified group is currently being logged, i.e. | |
| QSet< QString > | groups () const |
| Returns the set of known groups. | |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| QModelIndex | parent (const QModelIndex &child) const override |
| double | profileTime (const QString &name, const QString &group="startup") const |
| Returns the profile time for the specified name. | |
| void | record (const QString &name, double time, const QString &group="startup", const QString &id=QString()) |
| Manually adds a profile event with the given name and total time (in seconds). | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| void | start (const QString &name, const QString &group="startup", const QString &id=QString()) |
| Start a profile event with the given name. | |
| double | totalTime (const QString &group="startup") |
| The current total time collected in the profiler. | |
Static Public Member Functions | |
| static QString | translateGroupName (const QString &group) |
| Returns the translated name of a standard profile group. | |
Friends | |
| class | QgsApplication |
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 through QgsApplication::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.
Definition at line 185 of file qgsruntimeprofiler.h.
| QgsRuntimeProfiler::QgsRuntimeProfiler | ( | ) |
Constructor to create a new runtime profiler.
Definition at line 167 of file qgsruntimeprofiler.cpp.
|
overridedefault |
| QString QgsRuntimeProfiler::asText | ( | const QString & | group = QString() | ) |
Returns the model as a multi-line text string.
| group | A group name to filter the model against. |
Definition at line 668 of file qgsruntimeprofiler.cpp.
| void QgsRuntimeProfiler::beginGroup | ( | const QString & | name | ) |
Begin the group for the profiler.
Groups will append {GroupName}/ to the front of the profile tag set using start.
| name | The name of the group. |
Definition at line 187 of file qgsruntimeprofiler.cpp.
| QStringList QgsRuntimeProfiler::childGroups | ( | const QString & | parent = QString(), |
| const QString & | group = "startup" ) const |
Returns a list of all child groups with the specified parent.
Definition at line 197 of file qgsruntimeprofiler.cpp.
| void QgsRuntimeProfiler::clear | ( | const QString & | group = "startup" | ) |
clear Clear all profile data.
Definition at line 325 of file qgsruntimeprofiler.cpp.
|
override |
Definition at line 371 of file qgsruntimeprofiler.cpp.
|
override |
Definition at line 405 of file qgsruntimeprofiler.cpp.
| void QgsRuntimeProfiler::end | ( | const QString & | group = "startup" | ) |
End the current profile event.
Definition at line 246 of file qgsruntimeprofiler.cpp.
| void QgsRuntimeProfiler::endGroup | ( | ) |
End the current active group.
Definition at line 192 of file qgsruntimeprofiler.cpp.
| void QgsRuntimeProfiler::groupAdded | ( | const QString & | group | ) |
Emitted when a new group has started being profiled.
| bool QgsRuntimeProfiler::groupIsActive | ( | const QString & | group | ) | const |
Returns true if the specified group is currently being logged, i.e.
it has a entry which has started and not yet stopped.
Definition at line 346 of file qgsruntimeprofiler.cpp.
|
inline |
Returns the set of known groups.
Definition at line 266 of file qgsruntimeprofiler.h.
|
override |
Definition at line 436 of file qgsruntimeprofiler.cpp.
|
override |
Definition at line 377 of file qgsruntimeprofiler.cpp.
|
override |
Definition at line 389 of file qgsruntimeprofiler.cpp.
| double QgsRuntimeProfiler::profileTime | ( | const QString & | name, |
| const QString & | group = "startup" ) const |
Returns the profile time for the specified name.
Definition at line 316 of file qgsruntimeprofiler.cpp.
| void QgsRuntimeProfiler::record | ( | const QString & | name, |
| double | time, | ||
| const QString & | group = "startup", | ||
| const QString & | id = QString() ) |
Manually adds a profile event with the given name and total time (in seconds).
The optional id argument can be used to provider a unique ID to disambiguate nodes with the same name.
Definition at line 278 of file qgsruntimeprofiler.cpp.
|
override |
Definition at line 362 of file qgsruntimeprofiler.cpp.
| void QgsRuntimeProfiler::start | ( | const QString & | name, |
| const QString & | group = "startup", | ||
| const QString & | id = QString() ) |
Start a profile event with the given name.
The name of the profile event. Will have the name of the active group appended after ending.
Since QGIS 3.34, the optional id argument can be used to provide a unique ID to disambiguate nodes with the same name.
Definition at line 214 of file qgsruntimeprofiler.cpp.
| double QgsRuntimeProfiler::totalTime | ( | const QString & | group = "startup" | ) |
The current total time collected in the profiler.
Definition at line 338 of file qgsruntimeprofiler.cpp.
|
static |
Returns the translated name of a standard profile group.
Definition at line 351 of file qgsruntimeprofiler.cpp.
|
friend |
Definition at line 338 of file qgsruntimeprofiler.h.