summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/browser/networkaccessmanager.cpp9
-rw-r--r--demos/browser/networkaccessmanager.h1
2 files changed, 8 insertions, 2 deletions
diff --git a/demos/browser/networkaccessmanager.cpp b/demos/browser/networkaccessmanager.cpp
index 9e717bb..c63c0eb 100644
--- a/demos/browser/networkaccessmanager.cpp
+++ b/demos/browser/networkaccessmanager.cpp
@@ -64,7 +64,7 @@
NetworkAccessManager::NetworkAccessManager(QObject *parent)
: QNetworkAccessManager(parent),
requestFinishedCount(0), requestFinishedFromCacheCount(0), requestFinishedPipelinedCount(0),
- requestFinishedSecureCount(0)
+ requestFinishedSecureCount(0), requestFinishedDownloadBufferCount(0)
{
connect(this, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
@@ -106,14 +106,19 @@ void NetworkAccessManager::requestFinished(QNetworkReply *reply)
if (reply->attribute(QNetworkRequest::ConnectionEncryptedAttribute).toBool() == true)
requestFinishedSecureCount++;
+ if (reply->attribute(QNetworkRequest::DownloadBufferAttribute).isValid() == true)
+ requestFinishedDownloadBufferCount++;
+
if (requestFinishedCount % 10)
return;
double pctCached = (double(requestFinishedFromCacheCount) * 100.0/ double(requestFinishedCount));
double pctPipelined = (double(requestFinishedPipelinedCount) * 100.0/ double(requestFinishedCount));
double pctSecure = (double(requestFinishedSecureCount) * 100.0/ double(requestFinishedCount));
+ double pctDownloadBuffer = (double(requestFinishedDownloadBufferCount) * 100.0/ double(requestFinishedCount));
+
#ifdef QT_DEBUG
- qDebug("STATS [%lli requests total] [%3.2f%% from cache] [%3.2f%% pipelined] [%3.2f%% SSL/TLS]", requestFinishedCount, pctCached, pctPipelined, pctSecure);
+ qDebug("STATS [%lli requests total] [%3.2f%% from cache] [%3.2f%% pipelined] [%3.2f%% SSL/TLS] [%3.2f%% Zerocopy]", requestFinishedCount, pctCached, pctPipelined, pctSecure, pctDownloadBuffer);
#endif
}
diff --git a/demos/browser/networkaccessmanager.h b/demos/browser/networkaccessmanager.h
index 76fc198..d6e6ede 100644
--- a/demos/browser/networkaccessmanager.h
+++ b/demos/browser/networkaccessmanager.h
@@ -60,6 +60,7 @@ private:
qint64 requestFinishedFromCacheCount;
qint64 requestFinishedPipelinedCount;
qint64 requestFinishedSecureCount;
+ qint64 requestFinishedDownloadBufferCount;
public slots:
void loadSettings();