summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-12-19 15:22:17 +0100
committerGitHub <noreply@github.com>2022-12-19 15:22:17 +0100
commit701ae22e4b334d3fe9fcca3b9aac95c4cf3d613e (patch)
treef14b60aabc204ec5d514272268db1513c0f902b0
parent041c857aa774df3ac8ea1ae83390f36691c6b2d3 (diff)
parent4e4169c32c2788f8e4875355a50115e9c95622ee (diff)
Merge pull request #25291 from vespa-engine/geirst/flush-meta-start-simplify
Simplify implementation of FlushEngine::FlushMeta::getStart().
-rw-r--r--searchcore/src/vespa/searchcore/proton/flushengine/flushengine.h2
-rw-r--r--vespalib/src/vespa/vespalib/util/time.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.h b/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.h
index f8036ad4a92..4b15c3503f3 100644
--- a/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.h
+++ b/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.h
@@ -27,7 +27,7 @@ public:
~FlushMeta();
const vespalib::string & getName() const { return _name; }
const vespalib::string& handler_name() const { return _handler_name; }
- vespalib::system_time getStart() const { return vespalib::system_clock::now() - std::chrono::duration_cast<vespalib::system_time::duration>(elapsed()); }
+ vespalib::system_time getStart() const { return vespalib::to_utc(_timer.get_start()); }
vespalib::duration elapsed() const { return _timer.elapsed(); }
uint32_t getId() const { return _id; }
bool operator < (const FlushMeta & rhs) const { return _id < rhs._id; }
diff --git a/vespalib/src/vespa/vespalib/util/time.h b/vespalib/src/vespa/vespalib/util/time.h
index 783831b5171..2355b269fa5 100644
--- a/vespalib/src/vespa/vespalib/util/time.h
+++ b/vespalib/src/vespa/vespalib/util/time.h
@@ -84,6 +84,7 @@ private:
public:
Timer() : _start(steady_clock::now()) {}
~Timer();
+ steady_time get_start() const { return _start; }
duration elapsed() const { return (steady_clock::now() - _start); }
static void waitAtLeast(duration dur, bool busyWait);
};