aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--metrics/src/tests/stresstest.cpp8
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/scheduledexecutor.h2
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/metrics/src/tests/stresstest.cpp b/metrics/src/tests/stresstest.cpp
index 20693d2f841..f3e709b4b04 100644
--- a/metrics/src/tests/stresstest.cpp
+++ b/metrics/src/tests/stresstest.cpp
@@ -4,6 +4,7 @@
#include <vespa/metrics/metricmanager.h>
#include <vespa/metrics/metrics.h>
#include <vespa/metrics/summetric.hpp>
+#include <vespa/vespalib/util/time.h>
#include <thread>
#include <vespa/vespalib/gtest/gtest.h>
@@ -40,7 +41,7 @@ InnerMetricSet::InnerMetricSet(const char* name, const LoadTypeSet& lt, MetricSe
_valueSum.addMetricToSum(_value1);
_valueSum.addMetricToSum(_value2);
}
-InnerMetricSet::~InnerMetricSet() { }
+InnerMetricSet::~InnerMetricSet() = default;
MetricSet*
InnerMetricSet::clone(std::vector<Metric::UP> &ownerList, CopyType copyType,
@@ -134,11 +135,10 @@ TEST(StressTest, test_stress)
FastOS_ThreadPool threadPool(256 * 1024);
std::vector<Hammer::UP> hammers;
for (uint32_t i=0; i<10; ++i) {
- hammers.push_back(Hammer::UP(
- new Hammer(metrics, loadTypes, threadPool)));
+ hammers.push_back(std::make_unique<Hammer>(metrics, loadTypes, threadPool));
}
LOG(info, "Waiting to let loadgivers hammer a while");
- std::this_thread::sleep_for(std::chrono::milliseconds(5 * 1000));
+ std::this_thread::sleep_for(5s);
LOG(info, "Removing loadgivers");
hammers.clear();
diff --git a/staging_vespalib/src/vespa/vespalib/util/scheduledexecutor.h b/staging_vespalib/src/vespa/vespalib/util/scheduledexecutor.h
index dd12985aeda..d7e56494828 100644
--- a/staging_vespalib/src/vespa/vespalib/util/scheduledexecutor.h
+++ b/staging_vespalib/src/vespa/vespalib/util/scheduledexecutor.h
@@ -13,7 +13,7 @@ namespace vespalib {
class TimerTask;
/**
- * Timer is a class capable of running Tasks at a regular
+ * ScheduledExecutor is a class capable of running Tasks at a regular
* interval. The timer can be reset to clear all tasks currently being
* scheduled.
*/
diff --git a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp
index cf8130f97c1..99857107860 100644
--- a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp
@@ -16,7 +16,7 @@ void ShutdownGuard::Run(FastOS_ThreadInterface *, void *)
while (_dieAtTime > steady_clock::now() && ! GetThread()->GetBreakFlag()) {
std::this_thread::sleep_for(5ms);
}
- if (_dieAtTime < steady_clock::now()) {
+ if (_dieAtTime <= steady_clock::now()) {
LOG(warning, "ShutdownGuard is now forcing an exit of the process.");
_exit(EXIT_FAILURE);
}