diff options
author | samantharitter <samantha.ritter@10gen.com> | 2017-10-18 18:11:25 -0400 |
---|---|---|
committer | samantharitter <samantha.ritter@10gen.com> | 2017-11-01 12:47:44 -0400 |
commit | 7cd8508b06e1574bea211dff054855b70b7cc20e (patch) | |
tree | fa2767c3cccbd8ac3fecb004526f9200f440ac43 /src/mongo/db/kill_sessions_common.h | |
parent | ef8db41490338502892d2e546e9a745d529ad614 (diff) | |
download | mongo-7cd8508b06e1574bea211dff054855b70b7cc20e.tar.gz |
SERVER-31565 Add stats about logical sessions background jobs to serverStatus
Diffstat (limited to 'src/mongo/db/kill_sessions_common.h')
-rw-r--r-- | src/mongo/db/kill_sessions_common.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/kill_sessions_common.h b/src/mongo/db/kill_sessions_common.h index 4b6556db7a8..6be4d8f3cec 100644 --- a/src/mongo/db/kill_sessions_common.h +++ b/src/mongo/db/kill_sessions_common.h @@ -84,7 +84,7 @@ public: KillSessionsCursorManagerVisitor(OperationContext* opCtx, const SessionKiller::Matcher& matcher, Eraser&& eraser) - : _opCtx(opCtx), _matcher(matcher), _eraser(eraser) {} + : _opCtx(opCtx), _matcher(matcher), _cursorsKilled(0), _eraser(eraser) {} template <typename Mgr> void operator()(Mgr& mgr) { @@ -99,6 +99,7 @@ public: for (const auto& id : cursors) { try { _eraser(mgr, id); + _cursorsKilled++; } catch (...) { _failures.push_back(exceptionToStatus()); } @@ -123,10 +124,15 @@ public: << _failures.back().reason()); } + int getCursorsKilled() const { + return _cursorsKilled; + } + private: OperationContext* _opCtx; const SessionKiller::Matcher& _matcher; std::vector<Status> _failures; + int _cursorsKilled; Eraser _eraser; }; |