aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmldebug
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-08-31 18:04:47 +0200
committerUlf Hermann <ulf.hermann@qt.io>2018-09-10 15:56:35 +0000
commitde2f5d2bc11a71fe12fcc4c08fff9bf59571db36 (patch)
tree7e67a981ab3d8e7c2670478e6e13900ce6baad6b /src/qmldebug
parentbf07bdcdf97473f1239ff965c7de795ec6caca42 (diff)
Qml Preview: Record more detailed frame statistics
Just the number of frames per second doesn't tell us the reason for any low frame rates. The problem could either be GPU-bound, and rendering could take very long, or the problem could be CPU-bound, with synchronizing or the gap between frames being very long. Reporting the rendering and synchronization times in more detail gives the client an idea of what is actually going on. Change-Id: Ib2840a9e1aa9b9738e967730c668769946659be2 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/qmldebug')
-rw-r--r--src/qmldebug/qqmlpreviewclient.cpp7
-rw-r--r--src/qmldebug/qqmlpreviewclient_p.h14
2 files changed, 17 insertions, 4 deletions
diff --git a/src/qmldebug/qqmlpreviewclient.cpp b/src/qmldebug/qqmlpreviewclient.cpp
index ba27457765..60937b9cfd 100644
--- a/src/qmldebug/qqmlpreviewclient.cpp
+++ b/src/qmldebug/qqmlpreviewclient.cpp
@@ -75,9 +75,10 @@ void QQmlPreviewClient::messageReceived(const QByteArray &message)
break;
}
case Fps: {
- quint16 frames;
- packet >> frames;
- emit fps(frames);
+ FpsInfo info;
+ packet >> info.numSyncs >> info.minSync >> info.maxSync >> info.totalSync
+ >> info.numRenders >> info.minRender >> info.maxRender >> info.totalRender;
+ emit fps(info);
break;
}
default:
diff --git a/src/qmldebug/qqmlpreviewclient_p.h b/src/qmldebug/qqmlpreviewclient_p.h
index 67615cabb2..65661613e9 100644
--- a/src/qmldebug/qqmlpreviewclient_p.h
+++ b/src/qmldebug/qqmlpreviewclient_p.h
@@ -76,6 +76,18 @@ public:
Language
};
+ struct FpsInfo {
+ quint16 numSyncs = 0;
+ quint16 minSync = std::numeric_limits<quint16>::max();
+ quint16 maxSync = 0;
+ quint16 totalSync = 0;
+
+ quint16 numRenders = 0;
+ quint16 minRender = std::numeric_limits<quint16>::max();
+ quint16 maxRender = 0;
+ quint16 totalRender = 0;
+ };
+
QQmlPreviewClient(QQmlDebugConnection *parent);
void messageReceived(const QByteArray &message) override;
@@ -91,7 +103,7 @@ public:
signals:
void request(const QString &path);
void error(const QString &message);
- void fps(quint16 frames);
+ void fps(const FpsInfo &info);
};
QT_END_NAMESPACE