summaryrefslogtreecommitdiff
path: root/src/mongo/transport
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2017-08-11 12:29:01 -0400
committerAndrew Morrow <acm@mongodb.com>2017-08-16 12:38:49 -0400
commitf5a7735f92136611b3158d8185727d540df8e94d (patch)
treedfe8561a545f0b06be71223ec0292bf8e7eaa427 /src/mongo/transport
parent8b5b8220fa00538df41cf4f1bedbf0e0aefd71cb (diff)
downloadmongo-f5a7735f92136611b3158d8185727d540df8e94d.tar.gz
SERVER-30527 SERVER-30529 SERVER-30535 Fixup stats for adaptive executor
Diffstat (limited to 'src/mongo/transport')
-rw-r--r--src/mongo/transport/service_executor_adaptive.cpp20
-rw-r--r--src/mongo/transport/service_executor_adaptive.h4
2 files changed, 12 insertions, 12 deletions
diff --git a/src/mongo/transport/service_executor_adaptive.cpp b/src/mongo/transport/service_executor_adaptive.cpp
index 7e4a49b51b7..b0ce8dda74d 100644
--- a/src/mongo/transport/service_executor_adaptive.cpp
+++ b/src/mongo/transport/service_executor_adaptive.cpp
@@ -74,13 +74,13 @@ thread_local TickSource::Tick ticksSpentExecuting = 0;
thread_local TickSource::Tick ticksSpentScheduled = 0;
thread_local int tasksExecuted = 0;
-constexpr auto kTotalScheduled = "totalScheduled"_sd;
+constexpr auto kTotalQueued = "totalQueued"_sd;
constexpr auto kTotalExecuted = "totalExecuted"_sd;
-constexpr auto kQueueDepth = "queueDepth"_sd;
-constexpr auto kTotalTimeExecutingUs = "totaltimeExecutingMicros"_sd;
+constexpr auto kTasksQueued = "tasksQueued"_sd;
+constexpr auto kTotalTimeExecutingUs = "totalTimeExecutingMicros"_sd;
constexpr auto kTotalTimeRunningUs = "totalTimeRunningMicros"_sd;
constexpr auto kTotalTimeQueuedUs = "totalTimeQueuedMicros"_sd;
-constexpr auto kTasksExecuting = "tasksExecutng";
+constexpr auto kTasksExecuting = "tasksExecuting";
constexpr auto kThreadsRunning = "threadsRunning";
constexpr auto kThreadsPending = "threadsPending";
constexpr auto kExecutorLabel = "executor";
@@ -175,10 +175,10 @@ Status ServiceExecutorAdaptive::shutdown() {
Status ServiceExecutorAdaptive::schedule(ServiceExecutorAdaptive::Task task, ScheduleFlags flags) {
auto scheduleTime = _tickSource->getTicks();
- auto pending = _tasksPending.addAndFetch(1);
+ auto pending = _tasksQueued.addAndFetch(1);
_ioContext->post([ this, task = std::move(task), scheduleTime ] {
- _tasksPending.subtractAndFetch(1);
+ _tasksQueued.subtractAndFetch(1);
auto start = _tickSource->getTicks();
ticksSpentScheduled += (start - scheduleTime);
_tasksExecuting.addAndFetch(1);
@@ -195,7 +195,7 @@ Status ServiceExecutorAdaptive::schedule(ServiceExecutorAdaptive::Task task, Sch
});
_lastScheduleTimer.reset();
- _totalScheduled.addAndFetch(1);
+ _totalQueued.addAndFetch(1);
if (_isStarved(pending) && !(flags & DeferredTask)) {
_scheduleCondition.notify_one();
@@ -210,7 +210,7 @@ bool ServiceExecutorAdaptive::_isStarved(int pending) const {
return false;
if (pending == -1) {
- pending = _tasksPending.load();
+ pending = _tasksQueued.load();
}
// If there are no pending tasks, then we definitely aren't starved
if (pending == 0)
@@ -476,8 +476,8 @@ void ServiceExecutorAdaptive::_workerThreadRoutine(
void ServiceExecutorAdaptive::appendStats(BSONObjBuilder* bob) const {
BSONObjBuilder section(bob->subobjStart("serviceExecutorTaskStats"));
section << kExecutorLabel << kExecutorName //
- << kTotalScheduled << _totalScheduled.load() << kTotalExecuted << _totalExecuted.load()
- << kQueueDepth << _tasksPending.load() << kTasksExecuting << _tasksExecuting.load()
+ << kTotalQueued << _totalQueued.load() << kTotalExecuted << _totalExecuted.load()
+ << kTasksQueued << _tasksQueued.load() << kTasksExecuting << _tasksExecuting.load()
<< kTotalTimeRunningUs << ticksToMicros(_totalSpentRunning.load(), _tickSource)
<< kTotalTimeExecutingUs << ticksToMicros(_totalSpentExecuting.load(), _tickSource)
<< kTotalTimeQueuedUs << ticksToMicros(_totalSpentScheduled.load(), _tickSource)
diff --git a/src/mongo/transport/service_executor_adaptive.h b/src/mongo/transport/service_executor_adaptive.h
index 1ff32831d16..75773900978 100644
--- a/src/mongo/transport/service_executor_adaptive.h
+++ b/src/mongo/transport/service_executor_adaptive.h
@@ -146,7 +146,7 @@ private:
AtomicWord<int> _threadsRunning{0};
AtomicWord<int> _threadsPending{0};
AtomicWord<int> _tasksExecuting{0};
- AtomicWord<int> _tasksPending{0};
+ AtomicWord<int> _tasksQueued{0};
TickTimer _lastScheduleTimer;
AtomicWord<TickSource::Tick> _totalSpentExecuting{0};
AtomicWord<TickSource::Tick> _totalSpentRunning{0};
@@ -155,7 +155,7 @@ private:
std::list<TickTimer> _threadsRunningTimers;
// These counters are only used for reporting in serverStatus.
- AtomicWord<int64_t> _totalScheduled{0};
+ AtomicWord<int64_t> _totalQueued{0};
AtomicWord<int64_t> _totalExecuted{0};
AtomicWord<TickSource::Tick> _totalSpentScheduled{0};