aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-12-16 15:43:32 -0800
committerGitHub <noreply@github.com>2019-12-16 15:43:32 -0800
commit2f8e6f0cb74ef77a645e7543975aca736f7649a9 (patch)
tree3cd1f386e75cfdefaedb1ba19f8fbdc5533fc5b7 /searchcore/src/tests
parent40e8a8b4ac2a021ede5a5babd42976ab313ce0b8 (diff)
parent0da20f33e911811b72bea5de39e90d17632bf8bd (diff)
Merge pull request #11535 from vespa-engine/balder/remove-steadytimestamp-2
Balder/remove steadytimestamp 2
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r--searchcore/src/tests/grouping/grouping.cpp19
-rw-r--r--searchcore/src/tests/proton/common/cachedselect_test.cpp6
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp4
-rw-r--r--searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp34
-rw-r--r--searchcore/src/tests/proton/index/indexcollection_test.cpp4
-rw-r--r--searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp6
-rw-r--r--searchcore/src/tests/proton/matching/matching_stats_test.cpp42
-rw-r--r--searchcore/src/tests/proton/matching/matching_test.cpp5
-rw-r--r--searchcore/src/tests/proton/matching/request_context/request_context_test.cpp2
-rw-r--r--searchcore/src/tests/proton/matching/sessionmanager_test.cpp14
-rw-r--r--searchcore/src/tests/proton/server/memoryflush/memoryflush_test.cpp1
14 files changed, 67 insertions, 76 deletions
diff --git a/searchcore/src/tests/grouping/grouping.cpp b/searchcore/src/tests/grouping/grouping.cpp
index edaa8792d6c..e5ac6ed15b0 100644
--- a/searchcore/src/tests/grouping/grouping.cpp
+++ b/searchcore/src/tests/grouping/grouping.cpp
@@ -22,7 +22,8 @@ using namespace search::grouping;
using namespace search;
using search::attribute::test::MockAttributeContext;
using proton::matching::SessionManager;
-using fastos::SteadyTimeStamp;
+using vespalib::steady_time;
+using vespalib::duration;
//-----------------------------------------------------------------------------
@@ -111,8 +112,8 @@ private:
struct DoomFixture {
vespalib::Clock clock;
- fastos::SteadyTimeStamp timeOfDoom;
- DoomFixture() : clock(), timeOfDoom(fastos::SteadyTimeStamp::FUTURE) {}
+ steady_time timeOfDoom;
+ DoomFixture() : clock(), timeOfDoom(steady_time::max()) {}
};
//-----------------------------------------------------------------------------
@@ -472,24 +473,24 @@ TEST_F("test session timeout", DoomFixture()) {
SessionId id1("foo");
SessionId id2("bar");
- GroupingContext initContext1(f1.clock, SteadyTimeStamp(10));
- GroupingContext initContext2(f1.clock, SteadyTimeStamp(20));
+ GroupingContext initContext1(f1.clock, steady_time(duration(10)));
+ GroupingContext initContext2(f1.clock, steady_time(duration(20)));
GroupingSession::UP s1(new GroupingSession(id1, initContext1, world.attributeContext));
GroupingSession::UP s2(new GroupingSession(id2, initContext2, world.attributeContext));
mgr.insert(std::move(s1));
mgr.insert(std::move(s2));
- mgr.pruneTimedOutSessions(SteadyTimeStamp(5));
+ mgr.pruneTimedOutSessions(steady_time(5ns));
SessionManager::Stats stats(mgr.getGroupingStats());
ASSERT_EQUAL(2u, stats.numCached);
- mgr.pruneTimedOutSessions(SteadyTimeStamp(10));
+ mgr.pruneTimedOutSessions(steady_time(10ns));
stats = mgr.getGroupingStats();
ASSERT_EQUAL(2u, stats.numCached);
- mgr.pruneTimedOutSessions(SteadyTimeStamp(11));
+ mgr.pruneTimedOutSessions(steady_time(11ns));
stats = mgr.getGroupingStats();
ASSERT_EQUAL(1u, stats.numCached);
- mgr.pruneTimedOutSessions(SteadyTimeStamp(21));
+ mgr.pruneTimedOutSessions(steady_time(21ns));
stats = mgr.getGroupingStats();
ASSERT_EQUAL(0u, stats.numCached);
}
diff --git a/searchcore/src/tests/proton/common/cachedselect_test.cpp b/searchcore/src/tests/proton/common/cachedselect_test.cpp
index 74d65a5bf7f..0fc290c9d2c 100644
--- a/searchcore/src/tests/proton/common/cachedselect_test.cpp
+++ b/searchcore/src/tests/proton/common/cachedselect_test.cpp
@@ -617,7 +617,7 @@ TEST_F("Test performance when using attributes", TestFixture)
uint32_t i;
const uint32_t loopcnt = 30000;
LOG(info, "Starting minibm loop, %u ierations of 4 docs each", loopcnt);
- fastos::StopWatch sw;
+ vespalib::Timer sw;
for (i = 0; i < loopcnt; ++i) {
ctx._docId = 1u;
if (sel->contains(ctx) != Result::False)
@@ -632,11 +632,11 @@ TEST_F("Test performance when using attributes", TestFixture)
if (sel->contains(ctx) != Result::Invalid)
break;
}
- fastos::TimeStamp elapsed = sw.elapsed();
+ vespalib::duration elapsed = sw.elapsed();
EXPECT_EQUAL(loopcnt, i);
LOG(info,
"Elapsed time for %u iterations of 4 docs each: %" PRId64 " ns, %8.4f ns/doc",
- i, elapsed.ns(), static_cast<double>(elapsed.ns()) / ( 4 * i));
+ i, vespalib::count_ns(elapsed), static_cast<double>(vespalib::count_ns(elapsed)) / ( 4 * i));
}
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 637ce90c72e..3e86e703e1e 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -646,7 +646,7 @@ Test::requireThatSummariesTimeout()
1);
DocsumRequest req;
- req.setTimeout(0);
+ req.setTimeout(vespalib::duration::zero());
EXPECT_TRUE(req.expired());
req.resultClassName = "class2";
req.hits.push_back(DocsumRequest::Hit(gid1));
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
index 069541eea91..1ad6b6cdc43 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
@@ -127,7 +127,7 @@ ViewSet::ViewSet()
_dmsc(),
_gidToLidChangeHandler(),
_lidReuseDelayer(),
- _commitTimeTracker(TimeStamp()),
+ _commitTimeTracker(vespalib::duration::zero()),
searchView(),
feedView(),
_hwInfo()
@@ -256,7 +256,7 @@ struct MyFastAccessFeedView
_dmsc(),
_gidToLidChangeHandler(make_shared<DummyGidToLidChangeHandler>()),
_lidReuseDelayer(),
- _commitTimeTracker(TimeStamp()),
+ _commitTimeTracker(vespalib::duration::zero()),
_feedView()
{
init();
diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
index 839228b79b8..ca513cb1cfb 100644
--- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
@@ -707,7 +707,7 @@ FixtureBase::FixtureBase(vespalib::duration visibilityDelay)
_writeServiceReal(_sharedExecutor),
_writeService(_writeServiceReal),
_lidReuseDelayer(_writeService, _dmsc->get()),
- _commitTimeTracker(vespalib::count_ns(visibilityDelay)),
+ _commitTimeTracker(visibilityDelay),
serial(0),
_gidToLidChangeHandler(std::make_shared<MyGidToLidChangeHandler>())
{
diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
index fdb7488bf65..0720f59471b 100644
--- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
@@ -197,7 +197,7 @@ struct MySessionCachePruner : public ISessionCachePruner
{
bool isInvoked;
MySessionCachePruner() : isInvoked(false) { }
- void pruneTimedOutSessions(fastos::SteadyTimeStamp current) override {
+ void pruneTimedOutSessions(vespalib::steady_time current) override {
(void) current;
isInvoked = true;
}
diff --git a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
index 2d5f86fbc58..7c9df8d3e47 100644
--- a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
@@ -94,8 +94,7 @@ struct MyMinimalFeedView : public MyMinimalFeedViewBase, public StoreOnlyFeedVie
MyMinimalFeedViewBase(),
StoreOnlyFeedView(StoreOnlyFeedView::Context(summaryAdapter,
search::index::Schema::SP(),
- DocumentMetaStoreContext::SP(
- new DocumentMetaStoreContext(metaStore)),
+ std::make_shared<DocumentMetaStoreContext>(metaStore),
*gidToLidChangeHandler,
myGetDocumentTypeRepo(),
writeService,
@@ -109,23 +108,19 @@ struct MyMinimalFeedView : public MyMinimalFeedViewBase, public StoreOnlyFeedVie
outstandingMoveOps(outstandingMoveOps_)
{
}
- virtual void removeAttributes(SerialNum s, const LidVector &l,
- bool immediateCommit, OnWriteDoneType onWriteDone) override {
+ void removeAttributes(SerialNum s, const LidVector &l, bool immediateCommit, OnWriteDoneType onWriteDone) override {
StoreOnlyFeedView::removeAttributes(s, l, immediateCommit, onWriteDone);
++removeMultiAttributesCount;
}
- virtual void removeIndexedFields(SerialNum s, const LidVector &l,
- bool immediateCommit,
- OnWriteDoneType onWriteDone) override {
- StoreOnlyFeedView::removeIndexedFields(s, l,
- immediateCommit, onWriteDone);
+ void removeIndexedFields(SerialNum s, const LidVector &l, bool immediateCommit, OnWriteDoneType onWriteDone) override {
+ StoreOnlyFeedView::removeIndexedFields(s, l, immediateCommit, onWriteDone);
++removeMultiIndexFieldsCount;
}
- virtual void heartBeatIndexedFields(SerialNum s) override {
+ void heartBeatIndexedFields(SerialNum s) override {
StoreOnlyFeedView::heartBeatIndexedFields(s);
++heartBeatIndexedFieldsCount;
}
- virtual void heartBeatAttributes(SerialNum s) override {
+ void heartBeatAttributes(SerialNum s) override {
StoreOnlyFeedView::heartBeatAttributes(s);
++heartBeatAttributesCount;
}
@@ -154,26 +149,23 @@ struct MoveOperationFeedView : public MyMinimalFeedView {
removeIndexFieldsCount(0),
onWriteDoneContexts()
{}
- virtual void putAttributes(SerialNum, search::DocumentIdT, const document::Document &,
- bool, OnPutDoneType onWriteDone) override {
+ void putAttributes(SerialNum, search::DocumentIdT, const document::Document &, bool, OnPutDoneType onWriteDone) override {
++putAttributesCount;
EXPECT_EQUAL(1, outstandingMoveOps);
onWriteDoneContexts.push_back(onWriteDone);
}
- virtual void putIndexedFields(SerialNum, search::DocumentIdT, const document::Document::SP &,
- bool, OnOperationDoneType onWriteDone) override {
+ void putIndexedFields(SerialNum, search::DocumentIdT, const document::Document::SP &,
+ bool, OnOperationDoneType onWriteDone) override {
++putIndexFieldsCount;
EXPECT_EQUAL(1, outstandingMoveOps);
onWriteDoneContexts.push_back(onWriteDone);
}
- virtual void removeAttributes(SerialNum, search::DocumentIdT,
- bool, OnRemoveDoneType onWriteDone) override {
+ void removeAttributes(SerialNum, search::DocumentIdT, bool, OnRemoveDoneType onWriteDone) override {
++removeAttributesCount;
EXPECT_EQUAL(1, outstandingMoveOps);
onWriteDoneContexts.push_back(onWriteDone);
}
- virtual void removeIndexedFields(SerialNum, search::DocumentIdT,
- bool, OnRemoveDoneType onWriteDone) override {
+ void removeIndexedFields(SerialNum, search::DocumentIdT, bool, OnRemoveDoneType onWriteDone) override {
++removeIndexFieldsCount;
EXPECT_EQUAL(1, outstandingMoveOps);
onWriteDoneContexts.push_back(onWriteDone);
@@ -186,7 +178,7 @@ struct MoveOperationCallback : public IDestructorCallback {
MoveOperationCallback(int &outstandingMoveOps_) : outstandingMoveOps(outstandingMoveOps_) {
++outstandingMoveOps;
}
- virtual ~MoveOperationCallback() {
+ ~MoveOperationCallback() override {
ASSERT_GREATER(outstandingMoveOps, 0);
--outstandingMoveOps;
}
@@ -220,7 +212,7 @@ struct FixtureBase {
sharedExecutor(1, 0x10000),
writeService(sharedExecutor),
lidReuseDelayer(writeService, *metaStore),
- commitTimeTracker(fastos::TimeStamp()),
+ commitTimeTracker(vespalib::duration::zero()),
feedview()
{
StoreOnlyFeedView::PersistentParams params(0, 0, DocTypeName("foo"), subdb_id, subDbType);
diff --git a/searchcore/src/tests/proton/index/indexcollection_test.cpp b/searchcore/src/tests/proton/index/indexcollection_test.cpp
index 7a42fe574c2..113901e893f 100644
--- a/searchcore/src/tests/proton/index/indexcollection_test.cpp
+++ b/searchcore/src/tests/proton/index/indexcollection_test.cpp
@@ -75,7 +75,7 @@ public:
}
IndexCollection::UP create_warmup(const IndexCollection::SP& prev, const IndexCollection::SP& next) {
- return std::make_unique<WarmupIndexCollection>(WarmupConfig(1.0, false), prev, next, *_warmup, _executor, *this);
+ return std::make_unique<WarmupIndexCollection>(WarmupConfig(1s, false), prev, next, *_warmup, _executor, *this);
}
virtual void warmupDone(ISearchableIndexCollection::SP current) override {
@@ -90,7 +90,7 @@ public:
_executor(1, 128*1024),
_warmup(new FakeIndexSearchable)
{}
- ~IndexCollectionTest() {}
+ ~IndexCollectionTest() = default;
};
diff --git a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp
index 478cf0b2f98..2d0482b0d92 100644
--- a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp
+++ b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp
@@ -289,9 +289,9 @@ TEST("require that the match phase limiter is able to pre-limit the query") {
MaybeMatchPhaseLimiter &limiter = yes_limiter;
EXPECT_TRUE(limiter.is_enabled());
EXPECT_EQUAL(12u, limiter.sample_hits_per_thread(10));
- RelativeTime clock(std::make_unique<CountingClock>(fastos::TimeStamp::fromSec(10000000), 1700000L));
+ RelativeTime clock(std::make_unique<CountingClock>(vespalib::count_ns(10000000s), 1700000L));
Trace trace(clock, 7);
- trace.start(4);
+ trace.start(4, false);
SearchIterator::UP search = limiter.maybe_limit(prepare(new MockSearch("search")), 0.1, 100000, trace.maybeCreateCursor(7, "limit"));
limiter.updateDocIdSpaceEstimate(1000, 9000);
EXPECT_EQUAL(1680u, limiter.getDocIdSpaceEstimate());
@@ -315,7 +315,7 @@ TEST("require that the match phase limiter is able to pre-limit the query") {
trace.done();
verify(
"{"
- " start_time_relative: '1970-04-26 17:46:40.000 UTC',"
+ " start_time: '1970-04-26 17:46:40.000 UTC',"
" traces: ["
" {"
" timestamp_ms: 1.7,"
diff --git a/searchcore/src/tests/proton/matching/matching_stats_test.cpp b/searchcore/src/tests/proton/matching/matching_stats_test.cpp
index 9bf627a6289..0d7778274b8 100644
--- a/searchcore/src/tests/proton/matching/matching_stats_test.cpp
+++ b/searchcore/src/tests/proton/matching/matching_stats_test.cpp
@@ -150,7 +150,7 @@ TEST("requireThatPartitionsAreAddedCorrectly") {
EXPECT_EQUAL(0u, all1.docsMatched());
EXPECT_EQUAL(0u, all1.getNumPartitions());
EXPECT_EQUAL(0u, all1.softDoomed());
- EXPECT_EQUAL(0u, all1.doomOvertime());
+ EXPECT_EQUAL(vespalib::duration::zero(), all1.doomOvertime());
MatchingStats::Partition subPart;
subPart.docsCovered(7).docsMatched(3).docsRanked(2).docsReRanked(1)
@@ -158,8 +158,8 @@ TEST("requireThatPartitionsAreAddedCorrectly") {
EXPECT_EQUAL(0u, subPart.softDoomed());
EXPECT_EQUAL(0u, subPart.softDoomed(false).softDoomed());
EXPECT_EQUAL(1u, subPart.softDoomed(true).softDoomed());
- EXPECT_EQUAL(0l, subPart.doomOvertime());
- EXPECT_EQUAL(1000, subPart.doomOvertime(1000).doomOvertime());
+ EXPECT_EQUAL(vespalib::duration::zero(), subPart.doomOvertime());
+ EXPECT_EQUAL(1000ns, subPart.doomOvertime(1000ns).doomOvertime());
EXPECT_EQUAL(7u, subPart.docsCovered());
EXPECT_EQUAL(3u, subPart.docsMatched());
EXPECT_EQUAL(2u, subPart.docsRanked());
@@ -180,7 +180,7 @@ TEST("requireThatPartitionsAreAddedCorrectly") {
EXPECT_EQUAL(1u, all1.docsReRanked());
EXPECT_EQUAL(1u, all1.getNumPartitions());
EXPECT_EQUAL(1u, all1.softDoomed());
- EXPECT_EQUAL(1000, all1.doomOvertime());
+ EXPECT_EQUAL(1000ns, all1.doomOvertime());
EXPECT_EQUAL(7u, all1.getPartition(0).docsCovered());
EXPECT_EQUAL(3u, all1.getPartition(0).docsMatched());
EXPECT_EQUAL(2u, all1.getPartition(0).docsRanked());
@@ -194,14 +194,14 @@ TEST("requireThatPartitionsAreAddedCorrectly") {
EXPECT_EQUAL(1.0, all1.getPartition(0).active_time_max());
EXPECT_EQUAL(0.5, all1.getPartition(0).wait_time_max());
EXPECT_EQUAL(1u, all1.getPartition(0).softDoomed());
- EXPECT_EQUAL(1000, all1.getPartition(0).doomOvertime());
+ EXPECT_EQUAL(1000ns, all1.getPartition(0).doomOvertime());
MatchingStats::Partition otherSubPart;
otherSubPart.docsCovered(7).docsMatched(3).docsRanked(2).docsReRanked(1)
- .active_time(0.5).wait_time(1.0).softDoomed(true).doomOvertime(300);
+ .active_time(0.5).wait_time(1.0).softDoomed(true).doomOvertime(300ns);
all1.merge_partition(otherSubPart, 1);
EXPECT_EQUAL(1u, all1.softDoomed());
- EXPECT_EQUAL(1000, all1.doomOvertime());
+ EXPECT_EQUAL(1000ns, all1.doomOvertime());
EXPECT_EQUAL(14u, all1.docidSpaceCovered());
EXPECT_EQUAL(6u, all1.docsMatched());
EXPECT_EQUAL(4u, all1.docsRanked());
@@ -219,7 +219,7 @@ TEST("requireThatPartitionsAreAddedCorrectly") {
EXPECT_EQUAL(0.5, all1.getPartition(1).active_time_max());
EXPECT_EQUAL(1.0, all1.getPartition(1).wait_time_max());
EXPECT_EQUAL(1u, all1.getPartition(1).softDoomed());
- EXPECT_EQUAL(300, all1.getPartition(1).doomOvertime());
+ EXPECT_EQUAL(300ns, all1.getPartition(1).doomOvertime());
MatchingStats all2;
all2.merge_partition(otherSubPart, 0);
@@ -227,7 +227,7 @@ TEST("requireThatPartitionsAreAddedCorrectly") {
all1.add(all2);
EXPECT_EQUAL(2u, all1.softDoomed());
- EXPECT_EQUAL(1000, all1.doomOvertime());
+ EXPECT_EQUAL(1000ns, all1.doomOvertime());
EXPECT_EQUAL(28u, all1.docidSpaceCovered());
EXPECT_EQUAL(12u, all1.docsMatched());
EXPECT_EQUAL(8u, all1.docsRanked());
@@ -245,7 +245,7 @@ TEST("requireThatPartitionsAreAddedCorrectly") {
EXPECT_EQUAL(1.0, all1.getPartition(0).active_time_max());
EXPECT_EQUAL(1.0, all1.getPartition(0).wait_time_max());
EXPECT_EQUAL(2u, all1.getPartition(0).softDoomed());
- EXPECT_EQUAL(1000, all1.getPartition(0).doomOvertime());
+ EXPECT_EQUAL(1000ns, all1.getPartition(0).doomOvertime());
EXPECT_EQUAL(6u, all1.getPartition(1).docsMatched());
EXPECT_EQUAL(4u, all1.getPartition(1).docsRanked());
EXPECT_EQUAL(2u, all1.getPartition(1).docsReRanked());
@@ -258,7 +258,7 @@ TEST("requireThatPartitionsAreAddedCorrectly") {
EXPECT_EQUAL(1.0, all1.getPartition(1).active_time_max());
EXPECT_EQUAL(1.0, all1.getPartition(1).wait_time_max());
EXPECT_EQUAL(2u, all1.getPartition(1).softDoomed());
- EXPECT_EQUAL(1000, all1.getPartition(1).doomOvertime());
+ EXPECT_EQUAL(1000ns, all1.getPartition(1).doomOvertime());
}
TEST("requireThatSoftDoomIsSetAndAdded") {
@@ -280,19 +280,19 @@ TEST("requireThatSoftDoomFacorIsComputedCorrectlyForDownAdjustment") {
EXPECT_EQUAL(0ul, stats.softDoomed());
EXPECT_EQUAL(0.5, stats.softDoomFactor());
stats.softDoomed(1);
- stats.updatesoftDoomFactor(1.0, 0.5, 2.0);
+ stats.updatesoftDoomFactor(1000ms, 500ms, 2000ms);
EXPECT_EQUAL(1ul, stats.softDoomed());
EXPECT_EQUAL(0.47, stats.softDoomFactor());
- stats.updatesoftDoomFactor(1.0, 0.5, 2.0);
+ stats.updatesoftDoomFactor(1000ms, 500ms, 2000ms);
EXPECT_EQUAL(1ul, stats.softDoomed());
EXPECT_EQUAL(0.44, stats.softDoomFactor());
- stats.updatesoftDoomFactor(0.0009, 0.5, 2.0); // hard limits less than 1ms should be ignored
+ stats.updatesoftDoomFactor(900us, 500ms, 2000ms); // hard limits less than 1ms should be ignored
EXPECT_EQUAL(1ul, stats.softDoomed());
EXPECT_EQUAL(0.44, stats.softDoomFactor());
- stats.updatesoftDoomFactor(1.0, 0.0009, 2.0); // soft limits less than 1ms should be ignored
+ stats.updatesoftDoomFactor(1000ms, 900us, 2000ms); // soft limits less than 1ms should be ignored
EXPECT_EQUAL(1ul, stats.softDoomed());
EXPECT_EQUAL(0.44, stats.softDoomFactor());
- stats.updatesoftDoomFactor(1.0, 0.5, 10.0); // Prevent changes above 10%
+ stats.updatesoftDoomFactor(1000ms, 500ms, 10s); // Prevent changes above 10%
EXPECT_EQUAL(1ul, stats.softDoomed());
EXPECT_EQUAL(0.396, stats.softDoomFactor());
}
@@ -302,20 +302,20 @@ TEST("requireThatSoftDoomFacorIsComputedCorrectlyForUpAdjustment") {
EXPECT_EQUAL(0ul, stats.softDoomed());
EXPECT_EQUAL(0.5, stats.softDoomFactor());
stats.softDoomed(1);
- stats.updatesoftDoomFactor(1.0, 0.9, 0.1);
+ stats.updatesoftDoomFactor(1s, 900ms, 100ms);
EXPECT_EQUAL(1ul, stats.softDoomed());
EXPECT_EQUAL(0.508, stats.softDoomFactor());
- stats.updatesoftDoomFactor(1.0, 0.9, 0.1);
+ stats.updatesoftDoomFactor(1s, 900ms, 100ms);
EXPECT_EQUAL(1ul, stats.softDoomed());
EXPECT_EQUAL(0.516, stats.softDoomFactor());
- stats.updatesoftDoomFactor(0.0009, 0.9, 0.1); // hard limits less than 1ms should be ignored
+ stats.updatesoftDoomFactor(900us, 900ms, 100ms); // hard limits less than 1ms should be ignored
EXPECT_EQUAL(1ul, stats.softDoomed());
EXPECT_EQUAL(0.516, stats.softDoomFactor());
- stats.updatesoftDoomFactor(1.0, 0.0009, 0.1); // soft limits less than 1ms should be ignored
+ stats.updatesoftDoomFactor(1s, 900us, 100ms); // soft limits less than 1ms should be ignored
EXPECT_EQUAL(1ul, stats.softDoomed());
EXPECT_EQUAL(0.516, stats.softDoomFactor());
stats.softDoomFactor(0.1);
- stats.updatesoftDoomFactor(1.0, 0.9, 0.001); // Prevent changes above 5%
+ stats.updatesoftDoomFactor(1s, 900ms, 1ms); // Prevent changes above 5%
EXPECT_EQUAL(1ul, stats.softDoomed());
EXPECT_EQUAL(0.105, stats.softDoomFactor());
}
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp
index 88705e73bc5..8c4bf0d55b0 100644
--- a/searchcore/src/tests/proton/matching/matching_test.cpp
+++ b/searchcore/src/tests/proton/matching/matching_test.cpp
@@ -261,7 +261,7 @@ struct MyWorld {
static SearchRequest::SP createRequest(const vespalib::string &stack_dump)
{
SearchRequest::SP request(new SearchRequest);
- request->setTimeout(60 * fastos::TimeStamp::SEC);
+ request->setTimeout(60s);
setStackDump(*request, stack_dump);
request->maxhits = 10;
return request;
@@ -768,8 +768,7 @@ TEST("require that getSummaryFeatures prefers cached query setup") {
ASSERT_EQUAL(0u, fs->numDocs()); // "spread" has no hits
// Empty cache
- auto pruneTime = fastos::ClockSteady::now() +
- fastos::TimeStamp::MINUTE * 10;
+ auto pruneTime = vespalib::steady_clock::now() + 600s;
world.sessionManager->pruneTimedOutSessions(pruneTime);
fs = world.getSummaryFeatures(req);
diff --git a/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp b/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp
index 3152b737ea7..109a4cc7a25 100644
--- a/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp
+++ b/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp
@@ -42,7 +42,7 @@ private:
public:
RequestContextTest()
: _clock(),
- _doom(_clock, fastos::SteadyTimeStamp::ZERO, fastos::SteadyTimeStamp::ZERO, false),
+ _doom(_clock, vespalib::steady_time(), vespalib::steady_time(), false),
_attr_ctx(),
_props(),
_request_ctx(_doom, _attr_ctx, _props),
diff --git a/searchcore/src/tests/proton/matching/sessionmanager_test.cpp b/searchcore/src/tests/proton/matching/sessionmanager_test.cpp
index 5998b165b51..f3edf2bf747 100644
--- a/searchcore/src/tests/proton/matching/sessionmanager_test.cpp
+++ b/searchcore/src/tests/proton/matching/sessionmanager_test.cpp
@@ -18,7 +18,7 @@ using vespalib::string;
using namespace proton;
using namespace proton::matching;
using vespalib::StateExplorer;
-using fastos::SteadyTimeStamp;
+using vespalib::steady_time;
namespace {
@@ -35,8 +35,8 @@ void checkStats(SessionManager::Stats stats, uint32_t numInsert,
TEST("require that SessionManager handles SearchSessions.") {
string session_id("foo");
- SteadyTimeStamp start(100);
- SteadyTimeStamp doom(1000);
+ steady_time start(100ns);
+ steady_time doom(1000ns);
MatchToolsFactory::UP mtf;
SearchSession::OwnershipBundle owned_objects;
auto session = std::make_shared<SearchSession>(session_id, start, doom, std::move(mtf), std::move(owned_objects));
@@ -50,9 +50,9 @@ TEST("require that SessionManager handles SearchSessions.") {
TEST_DO(checkStats(session_manager.getSearchStats(), 0, 1, 0, 1, 0));
session_manager.insert(std::move(session));
TEST_DO(checkStats(session_manager.getSearchStats(), 1, 0, 0, 1, 0));
- session_manager.pruneTimedOutSessions(SteadyTimeStamp(500));
+ session_manager.pruneTimedOutSessions(steady_time(500ns));
TEST_DO(checkStats(session_manager.getSearchStats(), 0, 0, 0, 1, 0));
- session_manager.pruneTimedOutSessions(SteadyTimeStamp(2000));
+ session_manager.pruneTimedOutSessions(steady_time(2000ns));
TEST_DO(checkStats(session_manager.getSearchStats(), 0, 0, 0, 0, 1));
session = session_manager.pickSearch(session_id);
@@ -60,8 +60,8 @@ TEST("require that SessionManager handles SearchSessions.") {
}
TEST("require that SessionManager can be explored") {
- SteadyTimeStamp start(100);
- SteadyTimeStamp doom(1000);
+ steady_time start(100ns);
+ steady_time doom(1000ns);
SessionManager session_manager(10);
session_manager.insert(std::make_shared<SearchSession>("foo", start, doom,
MatchToolsFactory::UP(), SearchSession::OwnershipBundle()));
diff --git a/searchcore/src/tests/proton/server/memoryflush/memoryflush_test.cpp b/searchcore/src/tests/proton/server/memoryflush/memoryflush_test.cpp
index 41eda598726..549b2d2626a 100644
--- a/searchcore/src/tests/proton/server/memoryflush/memoryflush_test.cpp
+++ b/searchcore/src/tests/proton/server/memoryflush/memoryflush_test.cpp
@@ -9,7 +9,6 @@
using fastos::TimeStamp;
using vespalib::system_time;
-using fastos::SteadyTimeStamp;
using search::SerialNum;
using namespace proton;
using namespace searchcorespi;