aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/tests/storageserver/statereportertest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storage/src/tests/storageserver/statereportertest.cpp')
-rw-r--r--storage/src/tests/storageserver/statereportertest.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/storage/src/tests/storageserver/statereportertest.cpp b/storage/src/tests/storageserver/statereportertest.cpp
index 47d70cf436e..01cf12f7947 100644
--- a/storage/src/tests/storageserver/statereportertest.cpp
+++ b/storage/src/tests/storageserver/statereportertest.cpp
@@ -25,8 +25,8 @@ namespace storage {
class DummyApplicationGenerationFether : public ApplicationGenerationFetcher {
public:
- int64_t getGeneration() const override { return 1; }
- std::string getComponentName() const override { return "component"; }
+ [[nodiscard]] int64_t getGeneration() const override { return 1; }
+ [[nodiscard]] std::string getComponentName() const override { return "component"; }
};
struct StateReporterTest : Test {
@@ -54,8 +54,8 @@ struct MetricClock : public metrics::MetricManager::Timer
{
framework::Clock& _clock;
explicit MetricClock(framework::Clock& c) : _clock(c) {}
- time_t getTime() const override { return _clock.getTimeInSeconds().getTime(); }
- time_t getTimeInMilliSecs() const override { return _clock.getTimeInMillis().getTime(); }
+ [[nodiscard]] time_t getTime() const override { return vespalib::count_s(_clock.getMonotonicTime().time_since_epoch()); }
+ [[nodiscard]] time_t getTimeInMilliSecs() const override { return vespalib::count_ms(_clock.getMonotonicTime().time_since_epoch()); }
};
}
@@ -245,8 +245,8 @@ TEST_F(StateReporterTest, report_metrics) {
"/state/v1/metrics?consumer=status"
};
- for (int i = 0; i < pathCount; i++) {
- framework::HttpUrlPath path(paths[i]);
+ for (auto & path_str : paths) {
+ framework::HttpUrlPath path(path_str);
std::ostringstream ost;
_stateReporter->reportStatus(ost, path);
std::string jsonData = ost.str();