From 3565469ebf9920ceba852080342b6c7da2cbbae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Gra=CC=88tzer?= Date: Wed, 22 Feb 2017 18:56:35 +0100 Subject: [PATCH] Some stuff --- arangod/Pregel/Conductor.cpp | 1 + arangod/Pregel/Statistics.h | 9 +++++++++ arangod/Pregel/Worker.cpp | 10 +++++----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/arangod/Pregel/Conductor.cpp b/arangod/Pregel/Conductor.cpp index f3ae9e88da..f806eccd90 100644 --- a/arangod/Pregel/Conductor.cpp +++ b/arangod/Pregel/Conductor.cpp @@ -288,6 +288,7 @@ VPackBuilder Conductor::finishedWorkerStep(VPackSlice const& data) { LOG_TOPIC(INFO, Logger::PREGEL) << "Finished gss " << _globalSuperstep << " in " << (TRI_microtime() - _computationStartTimeSecs) << "s"; + _statistics.debugOutput(); _globalSuperstep++; // don't block the response for workers waiting on this callback diff --git a/arangod/Pregel/Statistics.h b/arangod/Pregel/Statistics.h index 4e29ccb197..f5c98445ac 100644 --- a/arangod/Pregel/Statistics.h +++ b/arangod/Pregel/Statistics.h @@ -110,6 +110,15 @@ struct StatsManager { } return send == received; } + + void debugOutput() { + uint64_t send = 0, received = 0; + for (auto const& pair : _serverStats) { + send += pair.second.sendCount; + received += pair.second.receivedCount; + } + LOG_TOPIC(INFO, Logger::PREGEL) << send << " - " << received << " : " << send - received; + } /// tests if active count is greater 0 bool executionFinished() { diff --git a/arangod/Pregel/Worker.cpp b/arangod/Pregel/Worker.cpp index 3ad32a8ee1..520db53781 100644 --- a/arangod/Pregel/Worker.cpp +++ b/arangod/Pregel/Worker.cpp @@ -423,17 +423,17 @@ bool Worker::_processVertices( MessageStats stats; stats.sendCount = outCache->sendCount(); stats.superstepRuntimeSecs = TRI_microtime() - start; - if (t > 0.005) { - LOG_TOPIC(INFO, Logger::PREGEL) << "Total " << stats.superstepRuntimeSecs - << " s merge took " << t << " s"; - } - inCache->clear(); outCache->clear(); bool lastThread = false; { // only one thread at a time MUTEX_LOCKER(guard, _threadMutex); + if (t > 0.005) { + LOG_TOPIC(INFO, Logger::PREGEL) << "Total " << stats.superstepRuntimeSecs + << " s merge took " << t << " s"; + } + // merge the thread local stats and aggregators _workerAggregators->aggregateValues(workerAggregator); _messageStats.accumulate(stats);