summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-11-22 15:52:18 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2011-02-04 15:23:18 (GMT)
commit5e59a2546f9dbbf58adb3a2169c3fffb58606d7e (patch)
treeb84ea9b8230db9fd0449b290d20e85f6404fef8d /demos
parent59caa5b23104dd1c6fb368fbd840a6b491536130 (diff)
downloadQt-5e59a2546f9dbbf58adb3a2169c3fffb58606d7e.zip
Qt-5e59a2546f9dbbf58adb3a2169c3fffb58606d7e.tar.gz
Qt-5e59a2546f9dbbf58adb3a2169c3fffb58606d7e.tar.bz2
demo browser: Verbose output about Zerocopy usage
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();