diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-10-22 09:25:39 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-10-22 09:25:39 +0000 |
commit | 2aff6c0940effc2e500db9e989e5fd833ddd6079 (patch) | |
tree | 77ae5f1fc1e749a22a98c6e8aabc79025d24c7f1 | |
parent | 720e14be4da9613ed8fda193bf2571a2f163d6a1 (diff) |
Rename executorCount -> threadCount
4 files changed, 9 insertions, 9 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.cpp b/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.cpp index 7681af43afc..5283ba5150e 100644 --- a/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.cpp @@ -334,7 +334,7 @@ AdaptiveSequencedExecutor::getStats() { auto guard = std::lock_guard(_mutex); ExecutorStats stats = _stats; - stats.executorCount = _cfg.num_threads; + stats.threadCount = _cfg.num_threads; steady_time now = steady_clock::now(); for (size_t i(0); i < _worker_stack.size(); i++) { _idleTracker.was_idle(_worker_stack.access(i)->idleTracker.reset(now)); diff --git a/vespalib/src/tests/executor/threadstackexecutor_test.cpp b/vespalib/src/tests/executor/threadstackexecutor_test.cpp index 56dbf0d19b5..00e23db244b 100644 --- a/vespalib/src/tests/executor/threadstackexecutor_test.cpp +++ b/vespalib/src/tests/executor/threadstackexecutor_test.cpp @@ -195,7 +195,7 @@ TEST("require that stats can be accumulated") { EXPECT_EQUAL(2u, stats.acceptedTasks); EXPECT_EQUAL(3u, stats.rejectedTasks); EXPECT_EQUAL(7u, stats.wakeupCount); - EXPECT_EQUAL(3u, stats.executorCount); + EXPECT_EQUAL(3u, stats.threadCount); EXPECT_EQUAL(0.6, stats.absUtil); EXPECT_EQUAL(0.2, stats.getUtil()); stats.aggregate(ExecutorStats(7, ExecutorStats::QueueSizeT(7),8,9,11, 1.9)); @@ -206,7 +206,7 @@ TEST("require that stats can be accumulated") { EXPECT_EQUAL(8u, stats.queueSize.max()); EXPECT_EQUAL(4.0, stats.queueSize.average()); - EXPECT_EQUAL(10u, stats.executorCount); + EXPECT_EQUAL(10u, stats.threadCount); EXPECT_EQUAL(10u, stats.acceptedTasks); EXPECT_EQUAL(12u, stats.rejectedTasks); EXPECT_EQUAL(18u, stats.wakeupCount); diff --git a/vespalib/src/vespa/vespalib/util/executor_stats.h b/vespalib/src/vespa/vespalib/util/executor_stats.h index 3ebf1d8744d..4b4354dc977 100644 --- a/vespalib/src/vespa/vespalib/util/executor_stats.h +++ b/vespalib/src/vespa/vespalib/util/executor_stats.h @@ -55,7 +55,7 @@ private: **/ struct ExecutorStats { using QueueSizeT = AggregatedAverage<size_t>; - uint32_t executorCount; + uint32_t threadCount; QueueSizeT queueSize; size_t acceptedTasks; size_t rejectedTasks; @@ -63,7 +63,7 @@ struct ExecutorStats { double absUtil; ExecutorStats() : ExecutorStats(1, QueueSizeT(), 0, 0, 0, 1.0) {} ExecutorStats(uint32_t executorCount_in, QueueSizeT queueSize_in, size_t accepted, size_t rejected, size_t wakeupCount_in, double absUtil_in) - : executorCount(executorCount_in), + : threadCount(executorCount_in), queueSize(queueSize_in), acceptedTasks(accepted), rejectedTasks(rejected), @@ -71,7 +71,7 @@ struct ExecutorStats { absUtil(absUtil_in) {} void aggregate(const ExecutorStats & rhs) { - executorCount += rhs.executorCount; + threadCount += rhs.threadCount; queueSize = QueueSizeT(queueSize.count() + rhs.queueSize.count(), queueSize.total() + rhs.queueSize.total(), queueSize.min() + rhs.queueSize.min(), @@ -81,7 +81,7 @@ struct ExecutorStats { wakeupCount += rhs.wakeupCount; absUtil += rhs.absUtil; } - double getUtil() const { return absUtil / executorCount; } + double getUtil() const { return absUtil / threadCount; } }; } diff --git a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp index e5da270e099..aeaeea51746 100644 --- a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp +++ b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp @@ -183,7 +183,7 @@ void ThreadStackExecutorBase::start(uint32_t threads) { assert(threads > 0); - _stats.executorCount = threads; + _stats.threadCount = threads; _idleTracker.reset(steady_clock::now(), threads); for (uint32_t i = 0; i < threads; ++i) { FastOS_ThreadInterface *thread = _pool->NewThread(_thread_init.get()); @@ -237,7 +237,7 @@ ThreadStackExecutorBase::getStats() { std::unique_lock guard(_lock); ExecutorStats stats = _stats; - stats.executorCount = getNumThreads(); + stats.threadCount = getNumThreads(); steady_time now = steady_clock::now(); for (size_t i(0); i < _workers.size(); i++) { _idleTracker.was_idle(_workers.access(i)->idleTracker.reset(now)); |