aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/debugger/qqmlprofilerservice_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-07-28 13:22:33 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-08-04 13:34:22 +0000
commit4e6de08ba154e541587b2939137a3da1081750be (patch)
tree7e5f85abcdabdb3b560fe5b4fd4b38c8d20c73d3 /src/qml/debugger/qqmlprofilerservice_p.h
parente77e9dc2c32edd0f7c437df48fc40c9b6a2a03cc (diff)
Periodically flush profiling data to client.
This reduces memory usage as the data can be deleted once it is sent. It also reduces the time it takes to transmit the data when profiling is stopped. It does incur a runtime cost as the sending now takes place while the application is running. The decision to periodically flush or not is left to the client, who can specify a flush interval when starting profiling. Usage of the flushing feature also relaxes the guarantees regarding the sorting of events before they are sent. Events with higher timestamps are now allowed to arrive before events with lower timestamps. Any clients implementing the flushing need to take this into account. This will eventually allow us to do away with the server-side ordering altogether. Task-number: QTBUG-39756 Change-Id: Idaf4931dc17f224c2bd492078b99e88b1405234e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/debugger/qqmlprofilerservice_p.h')
-rw-r--r--src/qml/debugger/qqmlprofilerservice_p.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/debugger/qqmlprofilerservice_p.h b/src/qml/debugger/qqmlprofilerservice_p.h
index 518f60bb7c..d593c43b9c 100644
--- a/src/qml/debugger/qqmlprofilerservice_p.h
+++ b/src/qml/debugger/qqmlprofilerservice_p.h
@@ -57,6 +57,7 @@
#include <QtCore/qvector.h>
#include <QtCore/qstringbuilder.h>
#include <QtCore/qwaitcondition.h>
+#include <QtCore/qtimer.h>
#include <limits>
@@ -90,6 +91,13 @@ public:
void dataReady(QQmlAbstractProfilerAdapter *profiler);
+signals:
+ void startFlushTimer();
+ void stopFlushTimer();
+
+private slots:
+ void flush();
+
protected:
virtual void stateAboutToBeChanged(State state);
virtual void messageReceived(const QByteArray &);
@@ -101,6 +109,8 @@ private:
void removeProfilerFromStartTimes(const QQmlAbstractProfilerAdapter *profiler);
QElapsedTimer m_timer;
+ QTimer m_flushTimer;
+ bool m_waitingForStop;
QList<QQmlAbstractProfilerAdapter *> m_globalProfilers;
QMultiHash<QQmlEngine *, QQmlAbstractProfilerAdapter *> m_engineProfilers;