mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 11:44:09 +02:00
Allow scripts to inject tracing events
This commit is contained in:
parent
1dd2747ef9
commit
31f39d7eef
2 changed files with 14 additions and 0 deletions
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(trace_test, "trace.test")
|
||||||
|
|
||||||
TestScriptingInterface* TestScriptingInterface::getInstance() {
|
TestScriptingInterface* TestScriptingInterface::getInstance() {
|
||||||
static TestScriptingInterface sharedInstance;
|
static TestScriptingInterface sharedInstance;
|
||||||
return &sharedInstance;
|
return &sharedInstance;
|
||||||
|
@ -125,3 +127,10 @@ bool TestScriptingInterface::waitForCondition(qint64 maxWaitMs, std::function<bo
|
||||||
return condition();
|
return condition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestScriptingInterface::startTraceEvent(QString name) {
|
||||||
|
tracing::traceEvent(trace_test(), name, tracing::DurationBegin, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
void TestScriptingInterface::endTraceEvent(QString name) {
|
||||||
|
tracing::traceEvent(trace_test(), name, tracing::DurationEnd);
|
||||||
|
}
|
||||||
|
|
|
@ -65,6 +65,11 @@ public slots:
|
||||||
*/
|
*/
|
||||||
bool stopTracing(QString filename);
|
bool stopTracing(QString filename);
|
||||||
|
|
||||||
|
void startTraceEvent(QString name);
|
||||||
|
|
||||||
|
void endTraceEvent(QString name);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition);
|
bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue