From 18fc854bf38c5ed577dbc9f5aefc7bbe6a338160 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 6885c66b3..bb0775b42 100644 --- a/src/ripple_app/paths/PathRequest.cpp +++ b/src/ripple_app/paths/PathRequest.cpp @@ -376,6 +376,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 9f013db59..3f8f80514 100644 --- a/src/ripple_app/paths/PathRequest.h +++ b/src/ripple_app/paths/PathRequest.h @@ -31,9 +31,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 8676f7d37..2068d8aea 100644 --- a/src/ripple_app/paths/PathState.h +++ b/src/ripple_app/paths/PathState.h @@ -29,9 +29,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: