From 2b37a4c7b0a1e835073fc6e11c2828ae4bd02311 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Thu, 26 Sep 2013 10:26:15 -0700 Subject: [PATCH] Better tracking of resources associated with pathfinding. --- src/ripple_app/paths/PathRequest.cpp | 2 ++ src/ripple_app/paths/PathRequest.h | 5 ++++- src/ripple_app/paths/PathState.h | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ripple_app/paths/PathRequest.cpp b/src/ripple_app/paths/PathRequest.cpp index 9bf17dea9..74e58931e 100644 --- a/src/ripple_app/paths/PathRequest.cpp +++ b/src/ripple_app/paths/PathRequest.cpp @@ -362,6 +362,8 @@ void PathRequest::updateAll (Ledger::ref ledger, bool newOnly, CancelCallback sh { std::set requests; + LoadEvent::autoptr event (getApp().getJobQueue().getLoadEventAP(jtPATH_FIND, "PathRequest::updateAll")); + { StaticScopedLockType sl (sLock, __FILE__, __LINE__); requests = sRequests; diff --git a/src/ripple_app/paths/PathRequest.h b/src/ripple_app/paths/PathRequest.h index 91d1e2b51..29632edd8 100644 --- a/src/ripple_app/paths/PathRequest.h +++ b/src/ripple_app/paths/PathRequest.h @@ -17,9 +17,12 @@ class RippleLineCache; #define PFR_PJ_NOCHANGE 0 #define PFR_PJ_CHANGE 1 -class PathRequest : public boost::enable_shared_from_this +class PathRequest : public boost::enable_shared_from_this, public CountedObject { public: + + static char const* getCountedObjectName () { return "PathRequest"; } + typedef boost::weak_ptr wptr; typedef boost::shared_ptr pointer; typedef const pointer& ref; diff --git a/src/ripple_app/paths/PathState.h b/src/ripple_app/paths/PathState.h index e03de8481..6b9405f2f 100644 --- a/src/ripple_app/paths/PathState.h +++ b/src/ripple_app/paths/PathState.h @@ -15,9 +15,12 @@ typedef boost::unordered_map ::const_iterator curIssu extern std::size_t hash_value (const aciSource& asValue); // Holds a path state under incremental application. -class PathState +class PathState : public CountedObject { public: + + static char const* getCountedObjectName () { return "PathState"; } + class Node { public: