QGIS/python/core/auto_generated/qgsruntimeprofiler.sip.in
Denis Rouzaud 35c557a234 run sipify
2021-05-26 14:30:54 +02:00

193 lines
5.6 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsruntimeprofiler.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsRuntimeProfiler : QAbstractItemModel
{
%Docstring(signature="appended")
Provides a method of recording run time profiles of operations, allowing
easy recording of their overall run time.
:py:class:`QgsRuntimeProfiler` is not usually instantied manually, but rather accessed
through :py:func:`QgsApplication.profiler()`.
This class is thread-safe only if accessed through :py:func:`QgsApplication.profiler()`.
If accessed in this way, operations can be profiled from non-main threads.
%End
%TypeHeaderCode
#include "qgsruntimeprofiler.h"
%End
public:
QgsRuntimeProfiler();
%Docstring
Constructor to create a new runtime profiler.
.. warning::
QgsRuntimeProfiler is not usually instantied manually, but rather accessed
through :py:func:`QgsApplication.profiler()`.
%End
~QgsRuntimeProfiler();
void beginGroup( const QString &name ) /Deprecated/;
%Docstring
Begin the group for the profiler. Groups will append {GroupName}/ to the
front of the profile tag set using start.
:param name: The name of the group.
.. deprecated::
use :py:func:`~QgsRuntimeProfiler.start` instead
%End
void endGroup() /Deprecated/;
%Docstring
End the current active group.
.. deprecated::
use :py:func:`~QgsRuntimeProfiler.end` instead
%End
QStringList childGroups( const QString &parent = QString(), const QString &group = "startup" ) const;
%Docstring
Returns a list of all child groups with the specified ``parent``.
.. versionadded:: 3.14
%End
void start( const QString &name, const QString &group = "startup" );
%Docstring
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.
%End
void end( const QString &group = "startup" );
%Docstring
End the current profile event.
%End
double profileTime( const QString &name, const QString &group = "startup" ) const;
%Docstring
Returns the profile time for the specified ``name``.
.. versionadded:: 3.14
%End
void clear( const QString &group = "startup" );
%Docstring
clear Clear all profile data.
%End
double totalTime( const QString &group = "startup" );
%Docstring
The current total time collected in the profiler.
:return: The current total time collected in the profiler.
%End
QSet< QString > groups() const;
%Docstring
Returns the set of known groups.
%End
bool groupIsActive( const QString &group ) const;
%Docstring
Returns ``True`` if the specified ``group`` is currently being logged,
i.e. it has a entry which has started and not yet stopped.
.. versionadded:: 3.14
%End
static QString translateGroupName( const QString &group );
%Docstring
Returns the translated name of a standard profile ``group``.
%End
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
virtual QModelIndex parent( const QModelIndex &child ) const;
virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
void groupAdded( const QString &group );
%Docstring
Emitted when a new group has started being profiled.
%End
};
class QgsScopedRuntimeProfile
{
%Docstring(signature="appended")
Scoped object for logging of the runtime for a single operation or group of operations.
This class automatically takes care of registering an operation in the :py:func:`QgsApplication.profiler()`
registry upon construction, and recording of the elapsed runtime upon destruction.
Python scripts should not use :py:class:`QgsScopedRuntimeProfile` directly. Instead, use :py:func:`QgsRuntimeProfiler.profile()`
.. code-block:: python
with QgsRuntimeProfiler.profile('My operation'):
# do something
.. versionadded:: 3.14
%End
%TypeHeaderCode
#include "qgsruntimeprofiler.h"
%End
public:
QgsScopedRuntimeProfile( const QString &name, const QString &group = "startup" );
%Docstring
Constructor for QgsScopedRuntimeProfile.
Automatically registers the operation in the :py:func:`QgsApplication.profiler()` instance
and starts recording the run time of the operation.
%End
~QgsScopedRuntimeProfile();
void switchTask( const QString &name );
%Docstring
Switches the current task managed by the scoped profile to a new task with the given ``name``.
The current task will be finalised before switching.
This is useful for reusing an existing scoped runtime profiler with multi-step processes.
.. versionadded:: 3.14
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsruntimeprofiler.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/