mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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"
|
||||
|
||||
Q_LOGGING_CATEGORY(trace_test, "trace.test")
|
||||
|
||||
TestScriptingInterface* TestScriptingInterface::getInstance() {
|
||||
static TestScriptingInterface sharedInstance;
|
||||
return &sharedInstance;
|
||||
|
@ -125,3 +127,10 @@ bool TestScriptingInterface::waitForCondition(qint64 maxWaitMs, std::function<bo
|
|||
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);
|
||||
|
||||
void startTraceEvent(QString name);
|
||||
|
||||
void endTraceEvent(QString name);
|
||||
|
||||
|
||||
private:
|
||||
bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue