diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-02-08 11:44:01 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-02-08 11:44:01 +0000 |
commit | 46d78e85240e31ce60e0fa608b216e5e5b8170ba (patch) | |
tree | 501f0df45cf8bb7aa4fe8c9786a23c1277273903 /searchcore | |
parent | b6a1d963deb0a71d4a3981d37b26d6fe388779c5 (diff) |
Use the term doom overtime instead.
Diffstat (limited to 'searchcore')
5 files changed, 26 insertions, 28 deletions
diff --git a/searchcore/src/tests/proton/matching/matching_stats_test.cpp b/searchcore/src/tests/proton/matching/matching_stats_test.cpp index e61d8de48e6..cf08e7de12b 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.timeLeftAtDoom()); + EXPECT_EQUAL(0u, 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.timeLeftAtDoom()); - EXPECT_EQUAL(1000, subPart.timeLeftAtDoom(1000).timeLeftAtDoom()); + EXPECT_EQUAL(0l, subPart.doomOvertime()); + EXPECT_EQUAL(1000, subPart.doomOvertime(1000).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.timeLeftAtDoom()); + EXPECT_EQUAL(1000, 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).timeLeftAtDoom()); + EXPECT_EQUAL(1000, 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).timeLeftAtDoom(-300); + .active_time(0.5).wait_time(1.0).softDoomed(true).doomOvertime(-300); all1.merge_partition(otherSubPart, 1); EXPECT_EQUAL(1u, all1.softDoomed()); - EXPECT_EQUAL(-300, all1.timeLeftAtDoom()); + EXPECT_EQUAL(1000, 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).timeLeftAtDoom()); + EXPECT_EQUAL(-300, 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(-300, all1.timeLeftAtDoom()); + EXPECT_EQUAL(1000, 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(-300, all1.getPartition(0).timeLeftAtDoom()); + EXPECT_EQUAL(1000, 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(-300, all1.getPartition(1).timeLeftAtDoom()); + EXPECT_EQUAL(1000, all1.getPartition(1).doomOvertime()); } TEST("requireThatSoftDoomIsSetAndAdded") { diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp index defae440971..2e92f2d63c3 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp @@ -178,7 +178,7 @@ MatchThread::match_loop(MatchTools &tools, HitCollector &hits) { bool softDoomed = false; uint32_t docsCovered = 0; - fastos::TimeStamp left(0); + fastos::TimeStamp overtime(0); Context context(matchParams.rankDropLimit, tools, hits, num_threads); for (DocidRange docid_range = scheduler.first_range(thread_id); !docid_range.empty(); @@ -188,7 +188,7 @@ MatchThread::match_loop(MatchTools &tools, HitCollector &hits) uint32_t lastCovered = inner_match_loop<Strategy, do_rank, do_limit, do_share_work>(context, tools, docid_range); softDoomed = (lastCovered < docid_range.end); if (softDoomed) { - left = context.timeLeft(); + overtime = - context.timeLeft(); } docsCovered += std::min(lastCovered, docid_range.end) - docid_range.begin; } @@ -205,9 +205,7 @@ MatchThread::match_loop(MatchTools &tools, HitCollector &hits) thread_stats.docsMatched(matches); thread_stats.softDoomed(softDoomed); if (softDoomed) { - thread_stats.timeLeftAtDoom(left); - } else { - thread_stats.timeLeftAtDoom(context.timeLeft()); + thread_stats.doomOvertime(overtime); } if (do_rank) { thread_stats.docsRanked(matches); diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index 23cfb24a5a9..b25ad2176bb 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -316,7 +316,7 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl _stats.add(my_stats); if (my_stats.softDoomed()) { double old = _stats.softDoomFactor(); - fastos::TimeStamp left = my_stats.timeLeftAtDoom(); + fastos::TimeStamp left = my_stats.doomOvertime(); fastos::TimeStamp realTimeout = (left >= 0) ? request.getTimeout() : (request.getTimeout() - left); fastos::TimeStamp softLimit = uint64_t((1.0 - _rankSetup->getSoftTimeoutTailCost()) * realTimeout); _stats.updatesoftDoomFactor(request.getTimeout(), softLimit, duration); diff --git a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp index 9c86425c056..91ee3e0662b 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp @@ -27,7 +27,7 @@ MatchingStats::MatchingStats() _docsRanked(0), _docsReRanked(0), _softDoomed(0), - _leftAtDoom(), + _doomOvertime(), _softDoomFactor(0.5), _queryCollateralTime(), _queryLatency(), @@ -48,7 +48,7 @@ MatchingStats::merge_partition(const Partition &partition, size_t id) _docsMatched += partition.docsMatched(); _docsRanked += partition.docsRanked(); _docsReRanked += partition.docsReRanked(); - _leftAtDoom.add(Avg().set(partition.timeLeftAtDoom().sec())); + _doomOvertime.add(Avg().set(partition.doomOvertime().sec())); if (partition.softDoomed()) { _softDoomed = 1; } @@ -67,7 +67,7 @@ MatchingStats::add(const MatchingStats &rhs) _docsRanked += rhs._docsRanked; _docsReRanked += rhs._docsReRanked; _softDoomed += rhs.softDoomed(); - _leftAtDoom.add(rhs._leftAtDoom); + _doomOvertime.add(rhs._doomOvertime); _queryCollateralTime.add(rhs._queryCollateralTime); diff --git a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h index 76064cb5a3b..d440ca809f0 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h +++ b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h @@ -62,7 +62,7 @@ public: size_t _docsRanked; size_t _docsReRanked; size_t _softDoomed; - Avg _leftAtDoom; + Avg _doomOvertime; Avg _active_time; Avg _wait_time; public: @@ -72,7 +72,7 @@ public: _docsRanked(0), _docsReRanked(0), _softDoomed(0), - _leftAtDoom(), + _doomOvertime(), _active_time(), _wait_time() { } @@ -86,8 +86,8 @@ public: size_t docsReRanked() const { return _docsReRanked; } Partition &softDoomed(bool v) { _softDoomed += v ? 1 : 0; return *this; } size_t softDoomed() const { return _softDoomed; } - Partition & timeLeftAtDoom(fastos::TimeStamp leftAtDoom) { _leftAtDoom.set(leftAtDoom.sec()); return *this; } - fastos::TimeStamp timeLeftAtDoom() const { return fastos::TimeStamp::fromSec(_leftAtDoom.min()); } + Partition & doomOvertime(fastos::TimeStamp overtime) { _doomOvertime.set(overtime.sec()); return *this; } + fastos::TimeStamp doomOvertime() const { return fastos::TimeStamp::fromSec(_doomOvertime.max()); } Partition &active_time(double time_s) { _active_time.set(time_s); return *this; } double active_time_avg() const { return _active_time.avg(); } @@ -106,7 +106,7 @@ public: _docsRanked += rhs._docsRanked; _docsReRanked += rhs._docsReRanked; _softDoomed += rhs._softDoomed; - _leftAtDoom.add(rhs._leftAtDoom); + _doomOvertime.add(rhs._doomOvertime); _active_time.add(rhs._active_time); _wait_time.add(rhs._wait_time); @@ -122,7 +122,7 @@ private: size_t _docsRanked; size_t _docsReRanked; size_t _softDoomed; - Avg _leftAtDoom; + Avg _doomOvertime; double _softDoomFactor; Avg _queryCollateralTime; Avg _queryLatency; @@ -160,8 +160,8 @@ public: MatchingStats &softDoomed(size_t value) { _softDoomed = value; return *this; } size_t softDoomed() const { return _softDoomed; } - MatchingStats & timeLeftAtDoom(fastos::TimeStamp leftAtDoom) { _leftAtDoom.set(leftAtDoom.sec()); return *this; } - fastos::TimeStamp timeLeftAtDoom() const { return fastos::TimeStamp::fromSec(_leftAtDoom.min()); } + MatchingStats & doomOvertime(fastos::TimeStamp overtime) { _doomOvertime.set(overtime.sec()); return *this; } + fastos::TimeStamp doomOvertime() const { return fastos::TimeStamp::fromSec(_doomOvertime.max()); } MatchingStats &softDoomFactor(double value) { _softDoomFactor = value; return *this; } double softDoomFactor() const { return _softDoomFactor; } |