diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-10 10:33:31 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-10 10:33:31 +0100 |
commit | c1c336a9064557bb987c30582bce84bab3f869bc (patch) | |
tree | 7868cfdb5662bf508c30d8f29c222f6aab76bb3d /common/genericresource.cpp | |
parent | 1f547bac86c0b4dc3f4ce6d872fe49bbfd77ea51 (diff) | |
download | sink-c1c336a9064557bb987c30582bce84bab3f869bc.tar.gz sink-c1c336a9064557bb987c30582bce84bab3f869bc.zip |
Gather more timings
Diffstat (limited to 'common/genericresource.cpp')
-rw-r--r-- | common/genericresource.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp index c097893..2688df0 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp | |||
@@ -234,15 +234,17 @@ private slots: | |||
234 | //Process all messages of this queue | 234 | //Process all messages of this queue |
235 | KAsync::Job<void> processQueue(MessageQueue *queue) | 235 | KAsync::Job<void> processQueue(MessageQueue *queue) |
236 | { | 236 | { |
237 | auto time = QSharedPointer<QTime>::create(); | ||
237 | return KAsync::start<void>([this](){ | 238 | return KAsync::start<void>([this](){ |
238 | mPipeline->startTransaction(); | 239 | mPipeline->startTransaction(); |
239 | }).then(KAsync::dowhile( | 240 | }).then(KAsync::dowhile( |
240 | [queue]() { return !queue->isEmpty(); }, | 241 | [queue]() { return !queue->isEmpty(); }, |
241 | [this, queue](KAsync::Future<void> &future) { | 242 | [this, queue, time](KAsync::Future<void> &future) { |
242 | queue->dequeueBatch(sBatchSize, [this](const QByteArray &data) { | 243 | queue->dequeueBatch(sBatchSize, [this, time](const QByteArray &data) { |
243 | return KAsync::start<void>([this, data](KAsync::Future<void> &future) { | 244 | time->start(); |
244 | processQueuedCommand(data).then<void, qint64>([&future, this](qint64 createdRevision) { | 245 | return KAsync::start<void>([this, data, time](KAsync::Future<void> &future) { |
245 | Trace() << "Created revision " << createdRevision; | 246 | processQueuedCommand(data).then<void, qint64>([&future, this, time](qint64 createdRevision) { |
247 | Trace() << "Created revision " << createdRevision << ". Processing took: " << Log::TraceTime(time->elapsed()); | ||
246 | future.setFinished(); | 248 | future.setFinished(); |
247 | }).exec(); | 249 | }).exec(); |
248 | }); | 250 | }); |
@@ -264,12 +266,15 @@ private slots: | |||
264 | 266 | ||
265 | KAsync::Job<void> processPipeline() | 267 | KAsync::Job<void> processPipeline() |
266 | { | 268 | { |
269 | auto time = QSharedPointer<QTime>::create(); | ||
270 | time->start(); | ||
267 | mPipeline->startTransaction(); | 271 | mPipeline->startTransaction(); |
268 | Trace() << "Cleaning up from " << mPipeline->cleanedUpRevision() + 1 << " to " << mLowerBoundRevision; | 272 | Trace() << "Cleaning up from " << mPipeline->cleanedUpRevision() + 1 << " to " << mLowerBoundRevision; |
269 | for (qint64 revision = mPipeline->cleanedUpRevision() + 1; revision <= mLowerBoundRevision; revision++) { | 273 | for (qint64 revision = mPipeline->cleanedUpRevision() + 1; revision <= mLowerBoundRevision; revision++) { |
270 | mPipeline->cleanupRevision(revision); | 274 | mPipeline->cleanupRevision(revision); |
271 | } | 275 | } |
272 | mPipeline->commit(); | 276 | mPipeline->commit(); |
277 | Trace() << "Cleanup done." << Log::TraceTime(time->elapsed()); | ||
273 | 278 | ||
274 | //Go through all message queues | 279 | //Go through all message queues |
275 | auto it = QSharedPointer<QListIterator<MessageQueue*> >::create(mCommandQueues); | 280 | auto it = QSharedPointer<QListIterator<MessageQueue*> >::create(mCommandQueues); |