summaryrefslogtreecommitdiffstats
path: root/metrics
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahoo-inc.com>2017-04-28 13:09:34 +0200
committerGitHub <noreply@github.com>2017-04-28 13:09:34 +0200
commitfc9c8ec3a2aa9e433dc12e67e0ed5d72353e8f3d (patch)
tree7fbf9c911c4ca68ae40f1f1872944cd3478316fd /metrics
parentff9c5764ce454d356f8faf727905cd9b67c82f94 (diff)
parentd336400e3e95685d62ec05c09e1582c3abcb34fc (diff)
Merge pull request #2307 from yahoo/balder/no-virtual-on-override-for-some-minor-storagemodules
no virtual on override + optimize includes.
Diffstat (limited to 'metrics')
-rw-r--r--metrics/src/tests/metricmanagertest.cpp14
-rw-r--r--metrics/src/tests/metricsettest.cpp6
-rw-r--r--metrics/src/tests/snapshottest.cpp9
-rw-r--r--metrics/src/tests/stresstest.cpp4
-rw-r--r--metrics/src/tests/testrunner.cpp6
5 files changed, 15 insertions, 24 deletions
diff --git a/metrics/src/tests/metricmanagertest.cpp b/metrics/src/tests/metricmanagertest.cpp
index 362cad83a66..0ba6bdfbd2f 100644
--- a/metrics/src/tests/metricmanagertest.cpp
+++ b/metrics/src/tests/metricmanagertest.cpp
@@ -9,8 +9,6 @@
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/data/slime/slime.h>
-#include <fstream>
-#include <sstream>
#include <vespa/log/log.h>
LOG_SETUP(".test.metricmanager");
@@ -143,22 +141,20 @@ struct MetricNameVisitor : public MetricVisitor {
MetricNameVisitor(bool debug_ = false) : debug(debug_) {}
- virtual bool visitMetricSet(const MetricSet& metricSet,
- bool autoGenerated) override
- {
+ bool visitMetricSet(const MetricSet& metricSet, bool autoGenerated) override {
if (debug) {
ost << "<" << (autoGenerated ? "*" : "")
<< metricSet.getPath() << ">\n";
}
return true;
}
- virtual void doneVisitingMetricSet(const MetricSet& metricSet) override {
+ void doneVisitingMetricSet(const MetricSet& metricSet) override {
if (debug) {
ost << "</" << metricSet.getPath() << ">\n";
}
}
- virtual bool visitMetric(const Metric& m, bool autoGenerated) override {
+ bool visitMetric(const Metric& m, bool autoGenerated) override {
ost << (autoGenerated ? "*" : "") << m.getPath() << "\n";
return true;
}
@@ -390,7 +386,7 @@ namespace {
struct FakeTimer : public MetricManager::Timer {
time_t _time;
FakeTimer(time_t startTime = 0) : _time(startTime) {}
- virtual time_t getTime() const override { return _time; }
+ time_t getTime() const override { return _time; }
};
struct BriefValuePrinter : public MetricVisitor {
@@ -399,7 +395,7 @@ namespace {
BriefValuePrinter() : count(0), ost() {}
- virtual bool visitMetric(const Metric& metric, bool) override {
+ bool visitMetric(const Metric& metric, bool) override {
if (++count > 1) ost << ",";
//ost << metric.getPath() << ":";
ost << metric.getDoubleValue("value");
diff --git a/metrics/src/tests/metricsettest.cpp b/metrics/src/tests/metricsettest.cpp
index 176572acbd4..2b45bd049e0 100644
--- a/metrics/src/tests/metricsettest.cpp
+++ b/metrics/src/tests/metricsettest.cpp
@@ -1,5 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
+
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/vespalib/objects/floatingpointtype.h>
#include <vespa/metrics/metrics.h>
@@ -28,7 +28,7 @@ namespace {
TestMetricVisitor(uint32_t setsToVisit_ = 100)
: ost(), setsToVisit(setsToVisit_) {}
- virtual bool visitMetricSet(const MetricSet& set, bool autoGenerated) override {
+ bool visitMetricSet(const MetricSet& set, bool autoGenerated) override {
ost << "[" << (autoGenerated ? "*" : "") << set.getName() << "]\n";
if (setsToVisit > 0) {
--setsToVisit;
@@ -36,7 +36,7 @@ namespace {
}
return false;
}
- virtual bool visitMetric(const Metric& m, bool autoGenerated) override {
+ bool visitMetric(const Metric& m, bool autoGenerated) override {
ost << (autoGenerated ? "*" : "") << m.getName() << "\n";
return true;
}
diff --git a/metrics/src/tests/snapshottest.cpp b/metrics/src/tests/snapshottest.cpp
index bee3e910fb3..5c13a0f82b6 100644
--- a/metrics/src/tests/snapshottest.cpp
+++ b/metrics/src/tests/snapshottest.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include <vespa/metrics/metrics.h>
#include <vespa/metrics/loadmetric.hpp>
#include <vespa/metrics/summetric.hpp>
@@ -40,8 +39,8 @@ struct SubSubMetricSet : public MetricSet {
SubSubMetricSet(vespalib::stringref name, const LoadTypeSet& loadTypes_, MetricSet* owner = 0);
~SubSubMetricSet();
- virtual MetricSet* clone(std::vector<Metric::UP> &ownerList, CopyType copyType,
- metrics::MetricSet* owner, bool includeUnused) const override;
+ MetricSet* clone(std::vector<Metric::UP> &ownerList, CopyType copyType,
+ metrics::MetricSet* owner, bool includeUnused) const override;
void incValues();
};
@@ -191,10 +190,8 @@ TestMetricSet::incValues() {
struct FakeTimer : public MetricManager::Timer {
uint32_t _timeInSecs;
-
FakeTimer() : _timeInSecs(1) {}
-
- virtual time_t getTime() const override { return _timeInSecs; }
+ time_t getTime() const override { return _timeInSecs; }
};
} // End of anonymous namespace
diff --git a/metrics/src/tests/stresstest.cpp b/metrics/src/tests/stresstest.cpp
index 5a2a736e9ba..70194ecd861 100644
--- a/metrics/src/tests/stresstest.cpp
+++ b/metrics/src/tests/stresstest.cpp
@@ -1,5 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
+
#include <vespa/metrics/metrics.h>
#include <vespa/metrics/loadmetric.hpp>
#include <vespa/metrics/summetric.hpp>
@@ -108,7 +108,7 @@ OuterMetricSet::~OuterMetricSet() { }
//std::cerr << "Loadgiver thread joined\n";
}
- virtual void run() override {
+ void run() override {
uint64_t i = 0;
while (running()) {
++i;
diff --git a/metrics/src/tests/testrunner.cpp b/metrics/src/tests/testrunner.cpp
index 5d8dc8d4c1f..9bf86e3276a 100644
--- a/metrics/src/tests/testrunner.cpp
+++ b/metrics/src/tests/testrunner.cpp
@@ -1,14 +1,12 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <iostream>
-#include <vespa/log/log.h>
#include <vespa/vdstestlib/cppunit/cppunittestrunner.h>
+#include <vespa/log/log.h>
LOG_SETUP("storagecppunittests");
int
-main(int argc, char **argv)
+main(int argc, const char *argv[])
{
vdstestlib::CppUnitTestRunner testRunner;
return testRunner.run(argc, argv);