From b901e0dcf367e14b49de4471b352920be6b5d322 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Thu, 5 Dec 2013 22:04:42 -0800 Subject: [PATCH] Fix load stats in get_info --- src/ripple_core/functional/JobQueue.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ripple_core/functional/JobQueue.cpp b/src/ripple_core/functional/JobQueue.cpp index f089b7484..e9b00e495 100644 --- a/src/ripple_core/functional/JobQueue.cpp +++ b/src/ripple_core/functional/JobQueue.cpp @@ -277,12 +277,10 @@ public: if (type == jtGENERIC) continue; - LoadMonitor::Stats stats; + LoadMonitor::Stats stats = m_loads [i].getStats (); int jobCount; int threadCount; - m_loads [i].getStats (); - MapType::const_iterator it = m_jobCounts.find (type); if (it == m_jobCounts.end ()) @@ -299,13 +297,13 @@ public: if ((stats.count != 0) || (jobCount != 0) || (stats.latencyPeak != 0) || (threadCount != 0)) { - Json::Value pri (Json::objectValue); + Json::Value& pri = priorities.append (Json::objectValue); + + pri["job_type"] = Job::toString (type); if (stats.isOverloaded) pri["over_target"] = true; - pri["job_type"] = Job::toString (type); - if (jobCount != 0) pri["waiting"] = jobCount; @@ -320,8 +318,6 @@ public: if (threadCount != 0) pri["in_progress"] = threadCount; - - priorities.append (pri); } }