Workspace 6.21.5
|
#include <memory>
#include <QDataStream>
#include <QList>
#include <QObject>
#include <QThread>
#include <QUuid>
#include "Workspace/Application/LanguageUtils/stringhelpers.h"
#include "Workspace/Application/LanguageUtils/scopeguard.h"
#include "Workspace/DataExecution/Operations/operation.h"
#include "Workspace/DataExecution/Serialization/serialize.h"
#include "Workspace/api_workspace.h"
Classes | |
class | ExecutionTimekeeper::Event |
Event to be passed around. More... | |
class | ExecutionTimekeeper |
This class is a singleton and receives all notifications about operations' execution. It then sends a signal notifying the event. Any component wishing to make use of the operations' execution events should connect to this singleton and watch for the signal. More... | |
class | ExecutionTimekeeper::Publisher |
Process that can publish their profiling data. More... | |
Namespaces | |
namespace | CSIRO |
Top level namespace for all Workspace code. | |
namespace | CSIRO::DataExecution |
Base workspace functionality not requiring a user interface. | |
namespace | CSIRO::Widgets |
This namespace contains support for widgets attached to workspace data objects. | |
Macros | |
#define | WS_CODEBLOCK_PROFILE_EVENT_(tag, type, file, line, func) |
#define | WS_PROFILE(tag) WS_PROFILE_(tag, __FILE__, __LINE__, __FUNCTION__) |
#define | WS_PROFILE_(tag, file, line, func) |
#define | WS_PROFILE_BEGIN(tag) WS_PROFILE_BEGIN_(tag, __FILE__, __LINE__, __FUNCTION__) |
#define | WS_PROFILE_BEGIN_(tag, file, line, func) WS_CODEBLOCK_PROFILE_EVENT_(tag, CSIRO::DataExecution::ExecutionTimekeeper::CodeBlockBegin, file, line, func) |
#define | WS_PROFILE_END(tag) WS_PROFILE_END_(tag, __FILE__, __LINE__, __FUNCTION__) |
#define | WS_PROFILE_END_(tag, file, line, func) WS_CODEBLOCK_PROFILE_EVENT_(tag, CSIRO::DataExecution::ExecutionTimekeeper::CodeBlockEnd, file, line, func) |
Functions | |
QDataStream & | operator<< (QDataStream &out, const ExecutionTimekeeper::Event &event) |
QDataStream & | operator<< (QDataStream &out, const ExecutionTimekeeper::Publisher &publisher) |
QDataStream & | operator>> (QDataStream &in, ExecutionTimekeeper::Event &event) |
QDataStream & | operator>> (QDataStream &in, ExecutionTimekeeper::Publisher &publisher) |
#define WS_CODEBLOCK_PROFILE_EVENT_ | ( | tag, | |
type, | |||
file, | |||
line, | |||
func | |||
) |
tag | QString equivilant to identify a codeblock |
type | should be either ExecutionTimekeeper::CodeBlockBegin or ExecutionTimekeeper::CodeBlockEnd |
file | filename where the codeblock is located |
line | line number of the codeblock |
func | function that contains the codeblock |
#define WS_PROFILE | ( | tag | ) | WS_PROFILE_(tag, __FILE__, __LINE__, __FUNCTION__) |
tag | QString equivilant to identify a codeblock |
Logs a pair of codeblock profiling events within the current code scope.
Sample usage from a real use case in Workspace: ``` bool InsertColumnIntoSqlTableImpl::execute() {
// ... omitting a few lines here.
SqlResultSet result; QString selectQuery = QString("SELECT * FROM %1") .arg(database.driver()->escapeIdentifier(tableName, QSqlDriver::TableName)); { WS_PROFILE(selectQuery); // A generated tag name. if (!result.exec(selectQuery, database) || result.lastError().isValid()) { logLine(LOG_ERROR, tr("Unable to execute query \"%1\".Details below: \n%2").arg(selectQuery).arg(result.lastError().text())); return false; } }
// ... omitting a few lines here.
// Profile a specified scope: { WS_PROFILE("fetchMore"); while (model.canFetchMore()) { model.fetchMore(); } }
// ... omitting a few lines here.
// Profile the rest of current scope. WS_PROFILE("set records");
// ... omitting a few lines here.
} ```
#define WS_PROFILE_ | ( | tag, | |
file, | |||
line, | |||
func | |||
) |
tag | QString equivilant to identify a codeblock |
file | filename where the codeblock is located |
line | line number of the codeblock |
func | function that contains the codeblock |
#define WS_PROFILE_BEGIN | ( | tag | ) | WS_PROFILE_BEGIN_(tag, __FILE__, __LINE__, __FUNCTION__) |
tag | QString equivilant to identify a codeblock |
Logs a beginning of a codeblock profiling event. Should pair up with a WS_PROFILE_END usually in the same scope of code.
#define WS_PROFILE_BEGIN_ | ( | tag, | |
file, | |||
line, | |||
func | |||
) | WS_CODEBLOCK_PROFILE_EVENT_(tag, CSIRO::DataExecution::ExecutionTimekeeper::CodeBlockBegin, file, line, func) |
#define WS_PROFILE_END | ( | tag | ) | WS_PROFILE_END_(tag, __FILE__, __LINE__, __FUNCTION__) |
tag | QString equivilant to identify a codeblock |
Logs an ending of a codeblock profiling event. Should pair up with a WS_PROFILE_BEGIN usually in the same scope of code.
#define WS_PROFILE_END_ | ( | tag, | |
file, | |||
line, | |||
func | |||
) | WS_CODEBLOCK_PROFILE_EVENT_(tag, CSIRO::DataExecution::ExecutionTimekeeper::CodeBlockEnd, file, line, func) |