summaryrefslogtreecommitdiff
path: root/src/mongo/db/kill_sessions_common.h
diff options
context:
space:
mode:
authorsamantharitter <samantha.ritter@10gen.com>2017-10-18 18:11:25 -0400
committersamantharitter <samantha.ritter@10gen.com>2017-11-01 12:47:44 -0400
commit7cd8508b06e1574bea211dff054855b70b7cc20e (patch)
treefa2767c3cccbd8ac3fecb004526f9200f440ac43 /src/mongo/db/kill_sessions_common.h
parentef8db41490338502892d2e546e9a745d529ad614 (diff)
downloadmongo-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.h8
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;
};