diff options
author | Jon Bratseth <jonbratseth@yahoo.com> | 2018-02-07 13:55:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-07 13:55:26 +0100 |
commit | 4edbbfb6c3e9be923137b7ea9cf039bf7a19c8a4 (patch) | |
tree | 2aa84005557c96f48a40323827750f194598a30c /searchcore | |
parent | 521be18377a117c5d02c1dd104017457c375f25b (diff) | |
parent | 553575a45c8697b247036c5a4a6b2e9e9fb862ee (diff) |
Merge pull request #4949 from vespa-engine/balder/cleanup-softtimeout
Balder/cleanup softtimeout
Diffstat (limited to 'searchcore')
12 files changed, 90 insertions, 71 deletions
diff --git a/searchcore/src/tests/proton/matching/matching_stats_test.cpp b/searchcore/src/tests/proton/matching/matching_stats_test.cpp index 46cba2d59c4..b94026e689c 100644 --- a/searchcore/src/tests/proton/matching/matching_stats_test.cpp +++ b/searchcore/src/tests/proton/matching/matching_stats_test.cpp @@ -1,13 +1,16 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -LOG_SETUP("matching_stats_test"); + #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/searchcore/proton/matching/matching_stats.h> +#include <vespa/log/log.h> +LOG_SETUP("matching_stats_test"); + using namespace proton::matching; TEST("requireThatDocCountsAddUp") { MatchingStats stats; + EXPECT_EQUAL(0u, stats.docsCovered()); EXPECT_EQUAL(0u, stats.docsMatched()); EXPECT_EQUAL(0u, stats.docsRanked()); EXPECT_EQUAL(0u, stats.docsReRanked()); @@ -15,6 +18,7 @@ TEST("requireThatDocCountsAddUp") { EXPECT_EQUAL(0u, stats.limited_queries()); { MatchingStats rhs; + EXPECT_EQUAL(&rhs.docsCovered(10000), &rhs); EXPECT_EQUAL(&rhs.docsMatched(1000), &rhs); EXPECT_EQUAL(&rhs.docsRanked(100), &rhs); EXPECT_EQUAL(&rhs.docsReRanked(10), &rhs); @@ -22,13 +26,15 @@ TEST("requireThatDocCountsAddUp") { EXPECT_EQUAL(&rhs.limited_queries(1), &rhs); EXPECT_EQUAL(&stats.add(rhs), &stats); } + EXPECT_EQUAL(10000u, stats.docsCovered()); EXPECT_EQUAL(1000u, stats.docsMatched()); EXPECT_EQUAL(100u, stats.docsRanked()); EXPECT_EQUAL(10u, stats.docsReRanked()); EXPECT_EQUAL(2u, stats.queries()); EXPECT_EQUAL(1u, stats.limited_queries()); - EXPECT_EQUAL(&stats.add(MatchingStats().docsMatched(1000).docsRanked(100) + EXPECT_EQUAL(&stats.add(MatchingStats().docsCovered(10000).docsMatched(1000).docsRanked(100) .docsReRanked(10).queries(2).limited_queries(1)), &stats); + EXPECT_EQUAL(20000u, stats.docsCovered()); EXPECT_EQUAL(2000u, stats.docsMatched()); EXPECT_EQUAL(200u, stats.docsRanked()); EXPECT_EQUAL(20u, stats.docsReRanked()); @@ -84,12 +90,14 @@ TEST("requireThatAverageTimesAreRecorded") { TEST("requireThatPartitionsAreAddedCorrectly") { MatchingStats all1; + EXPECT_EQUAL(0u, all1.docsCovered()); EXPECT_EQUAL(0u, all1.docsMatched()); EXPECT_EQUAL(0u, all1.getNumPartitions()); MatchingStats::Partition subPart; - subPart.docsMatched(3).docsRanked(2).docsReRanked(1) + subPart.docsCovered(7).docsMatched(3).docsRanked(2).docsReRanked(1) .active_time(1.0).wait_time(0.5); + EXPECT_EQUAL(7u, subPart.docsCovered()); EXPECT_EQUAL(3u, subPart.docsMatched()); EXPECT_EQUAL(2u, subPart.docsRanked()); EXPECT_EQUAL(1u, subPart.docsReRanked()); @@ -99,10 +107,12 @@ TEST("requireThatPartitionsAreAddedCorrectly") { EXPECT_EQUAL(1u, subPart.wait_time_count()); all1.merge_partition(subPart, 0); + EXPECT_EQUAL(7u, all1.docsCovered()); EXPECT_EQUAL(3u, all1.docsMatched()); EXPECT_EQUAL(2u, all1.docsRanked()); EXPECT_EQUAL(1u, all1.docsReRanked()); EXPECT_EQUAL(1u, all1.getNumPartitions()); + EXPECT_EQUAL(7u, all1.getPartition(0).docsCovered()); EXPECT_EQUAL(3u, all1.getPartition(0).docsMatched()); EXPECT_EQUAL(2u, all1.getPartition(0).docsRanked()); EXPECT_EQUAL(1u, all1.getPartition(0).docsReRanked()); @@ -112,6 +122,7 @@ TEST("requireThatPartitionsAreAddedCorrectly") { EXPECT_EQUAL(1u, all1.getPartition(0).wait_time_count()); all1.merge_partition(subPart, 1); + EXPECT_EQUAL(14u, all1.docsCovered()); EXPECT_EQUAL(6u, all1.docsMatched()); EXPECT_EQUAL(4u, all1.docsRanked()); EXPECT_EQUAL(2u, all1.docsReRanked()); @@ -125,6 +136,7 @@ TEST("requireThatPartitionsAreAddedCorrectly") { EXPECT_EQUAL(1u, all1.getPartition(1).wait_time_count()); all1.add(all1); + EXPECT_EQUAL(28u, all1.docsCovered()); EXPECT_EQUAL(12u, all1.docsMatched()); EXPECT_EQUAL(8u, all1.docsRanked()); EXPECT_EQUAL(4u, all1.docsReRanked()); diff --git a/searchcore/src/vespa/searchcore/fdispatch/common/search.h b/searchcore/src/vespa/searchcore/fdispatch/common/search.h index 8ca63838c5f..a1a8eb9f0ba 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/common/search.h +++ b/searchcore/src/vespa/searchcore/fdispatch/common/search.h @@ -100,6 +100,8 @@ public: uint64_t _activeDocs; uint64_t _soonActiveDocs; uint32_t _degradeReason; + uint16_t _nodesQueried; + uint16_t _nodesReplied; FastS_SearchInfo() : _searchOffset(0), @@ -107,9 +109,10 @@ public: _coverageDocs(0), _activeDocs(0), _soonActiveDocs(0), - _degradeReason(0) - { - } + _degradeReason(0), + _nodesQueried(0), + _nodesReplied(0) + { } }; //---------------------------------------------------------------- diff --git a/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.cpp b/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.cpp index dd4109da5cf..824688a75f6 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.cpp @@ -56,6 +56,8 @@ SearchAdapter::createReply() r.coverage = SearchReply::Coverage(_searchInfo->_activeDocs, _searchInfo->_coverageDocs); r.coverage.setSoonActive(_searchInfo->_soonActiveDocs); r.coverage.setDegradeReason(_searchInfo->_degradeReason); + r.coverage.setNodesQueried(_searchInfo->_nodesQueried); + r.coverage.setNodesReplied(_searchInfo->_nodesReplied); FastS_hitresult *hitbuf = _queryResult->_hitbuf; r.hits.resize(hitcnt); diff --git a/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.h b/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.h index d60b39c52be..de941505fc6 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.h +++ b/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.h @@ -35,7 +35,7 @@ private: void writeLog(); void cleanup(); - virtual void Run(FastOS_ThreadInterface *, void *) override; + void Run(FastOS_ThreadInterface *, void *) override; public: SearchAdapter(FastS_AppContext *appCtx, diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/fnet_search.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/fnet_search.cpp index 85599b9e897..98642c6edf6 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/fnet_search.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/search/fnet_search.cpp @@ -884,7 +884,7 @@ FastS_FNET_Search::CheckCoverage() if ((cntNone > 0) && (cntNone != _nodes.size())) { activeDocs += cntNone * activeDocs/(_nodes.size() - cntNone); } - _util.SetCoverage(covDocs, activeDocs, soonActiveDocs, degradedReason); + _util.SetCoverage(covDocs, activeDocs, soonActiveDocs, degradedReason, _nodes.size(), _nodes.size() - cntNone); } diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/querycacheutil.h b/searchcore/src/vespa/searchcore/fdispatch/search/querycacheutil.h index 6fdca46530c..442fa3f0710 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/querycacheutil.h +++ b/searchcore/src/vespa/searchcore/fdispatch/search/querycacheutil.h @@ -80,12 +80,15 @@ public: ret = 0.0; return ret; } - void SetCoverage(uint64_t coverageDocs, uint64_t activeDocs, uint64_t soonActiveDocs, uint32_t degradeReason) + void SetCoverage(uint64_t coverageDocs, uint64_t activeDocs, uint64_t soonActiveDocs, + uint32_t degradeReason, uint16_t nodesQueried, uint16_t nodesReplied) { _searchInfo._coverageDocs = coverageDocs; _searchInfo._activeDocs = activeDocs; _searchInfo._soonActiveDocs = soonActiveDocs; _searchInfo._degradeReason = degradeReason; + _searchInfo._nodesQueried = nodesQueried; + _searchInfo._nodesReplied = nodesReplied; } void SetAlignedHitCount(uint32_t alignedHitCount) { if (alignedHitCount > _alignedMaxHits) { diff --git a/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h b/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h index 67e52cbe8ee..e6fce89e82d 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h +++ b/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h @@ -10,8 +10,7 @@ #include <algorithm> #include <vector> -namespace proton { -namespace matching { +namespace proton::matching { /** * A range of document ids representing a subset of the search space. @@ -205,5 +204,4 @@ public: DocidRange share_range(size_t, DocidRange todo) override; }; -} // namespace proton::matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp index bd6a06ac4f1..c1c4387cf41 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp @@ -140,7 +140,7 @@ MatchThread::try_share(DocidRange &docid_range, uint32_t next_docid) { } template <typename Strategy, bool do_rank, bool do_limit, bool do_share_work> -bool +uint32_t MatchThread::inner_match_loop(Context &context, MatchTools &tools, DocidRange docid_range) { SearchIterator *search = &tools.search(); @@ -164,7 +164,7 @@ MatchThread::inner_match_loop(Context &context, MatchTools &tools, DocidRange do docId = Strategy::seek_next(*search, docId + 1); } } - return (docId < docid_range.end); + return docId; } template <typename Strategy, bool do_rank, bool do_limit, bool do_share_work> @@ -172,12 +172,15 @@ void MatchThread::match_loop(MatchTools &tools, HitCollector &hits) { bool softDoomed = false; + uint32_t docsCovered = 0; Context context(matchParams.rankDropLimit, tools, hits, num_threads); for (DocidRange docid_range = scheduler.first_range(thread_id); !docid_range.empty() && ! softDoomed; docid_range = scheduler.next_range(thread_id)) { - softDoomed = inner_match_loop<Strategy, do_rank, do_limit, do_share_work>(context, tools, docid_range); + uint32_t lastCovered = inner_match_loop<Strategy, do_rank, do_limit, do_share_work>(context, tools, docid_range); + softDoomed = (lastCovered < docid_range.end); + docsCovered += std::min(lastCovered, docid_range.end) - docid_range.begin; } uint32_t matches = context.matches; if (do_limit && context.isBelowLimit()) { @@ -187,6 +190,7 @@ MatchThread::match_loop(MatchTools &tools, HitCollector &hits) estimate_match_frequency(matches, searchedSoFar); tools.match_limiter().updateDocIdSpaceEstimate(searchedSoFar, 0); } + thread_stats.docsCovered(docsCovered); thread_stats.docsMatched(matches); thread_stats.softDoomed(softDoomed); if (do_rank) { diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_thread.h b/searchcore/src/vespa/searchcore/proton/matching/match_thread.h index b08323fa099..b7ecf149001 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_thread.h +++ b/searchcore/src/vespa/searchcore/proton/matching/match_thread.h @@ -75,7 +75,7 @@ private: bool try_share(DocidRange &docid_range, uint32_t next_docid) __attribute__((noinline)); template <typename Strategy, bool do_rank, bool do_limit, bool do_share_work> - bool inner_match_loop(Context &context, MatchTools &tools, DocidRange docid_range) __attribute__((noinline)); + uint32_t inner_match_loop(Context &context, MatchTools &tools, DocidRange docid_range) __attribute__((noinline)); template <typename Strategy, bool do_rank, bool do_limit, bool do_share_work> void match_loop(MatchTools &tools, HitCollector &hits) __attribute__((noinline)); diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index bbe6f604e4e..f21293299c7 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -14,7 +14,6 @@ #include <vespa/searchlib/engine/searchreply.h> #include <vespa/searchlib/features/setup.h> #include <vespa/searchlib/fef/test/plugin/setup.h> -#include <cmath> #include <vespa/log/log.h> LOG_SETUP(".proton.matching.matcher"); @@ -92,11 +91,8 @@ bool willNotNeedRanking(const SearchRequest & request, const GroupingContext & g } // namespace proton::matching::<unnamed> FeatureSet::SP -Matcher::getFeatureSet(const DocsumRequest & req, - ISearchContext & searchCtx, - IAttributeContext & attrCtx, - SessionManager & sessionMgr, - bool summaryFeatures) +Matcher::getFeatureSet(const DocsumRequest & req, ISearchContext & searchCtx, IAttributeContext & attrCtx, + SessionManager & sessionMgr, bool summaryFeatures) { SessionId sessionId(&req.sessionId[0], req.sessionId.size()); if (!sessionId.empty()) { @@ -114,22 +110,18 @@ Matcher::getFeatureSet(const DocsumRequest & req, } StupidMetaStore metaStore; - MatchToolsFactory::UP mtf = create_match_tools_factory(req, searchCtx, attrCtx, metaStore, req.propertiesMap.featureOverrides()); + MatchToolsFactory::UP mtf = create_match_tools_factory(req, searchCtx, attrCtx, metaStore, + req.propertiesMap.featureOverrides()); if (!mtf->valid()) { - LOG(warning, "getFeatureSet(%s): query execution failed " - "(invalid query). Returning empty feature set", - (summaryFeatures ? "summary features" : "rank features")); + LOG(warning, "getFeatureSet(%s): query execution failed (invalid query). Returning empty feature set", + (summaryFeatures ? "summary features" : "rank features")); return FeatureSet::SP(new FeatureSet()); } return findFeatureSet(req, *mtf, summaryFeatures); } -Matcher::Matcher(const search::index::Schema &schema, - const Properties &props, - const vespalib::Clock &clock, - QueryLimiter &queryLimiter, - const IConstantValueRepo &constantValueRepo, - uint32_t distributionKey) +Matcher::Matcher(const search::index::Schema &schema, const Properties &props, const vespalib::Clock &clock, + QueryLimiter &queryLimiter, const IConstantValueRepo &constantValueRepo, uint32_t distributionKey) : _indexEnv(schema, props, constantValueRepo), _blueprintFactory(), _rankSetup(), @@ -163,21 +155,21 @@ using search::fef::indexproperties::softtimeout::Enabled; using search::fef::indexproperties::softtimeout::Factor; std::unique_ptr<MatchToolsFactory> -Matcher::create_match_tools_factory(const search::engine::Request &request, - ISearchContext &searchContext, - IAttributeContext &attrContext, - const search::IDocumentMetaStore &metaStore, +Matcher::create_match_tools_factory(const search::engine::Request &request, ISearchContext &searchContext, + IAttributeContext &attrContext, const search::IDocumentMetaStore &metaStore, const Properties &feature_overrides) const { const Properties & rankProperties = request.propertiesMap.rankProperties(); bool softTimeoutEnabled = Enabled::lookup(rankProperties, _rankSetup->getSoftTimeoutEnabled()); - double factor = 0.95; + double factor = softTimeoutEnabled + ? Factor::lookup(rankProperties, _stats.softDoomFactor()) + : 0.95; + int64_t safeLeft = request.getTimeLeft() * factor; + fastos::TimeStamp safeDoom(fastos::ClockSystem::now() + safeLeft); if (softTimeoutEnabled) { - factor = Factor::lookup(rankProperties, _stats.softDoomFactor()); - LOG(debug, "Enabling soft-timeout computed factor=%1.3f, used factor=%1.3f", _stats.softDoomFactor(), factor); + LOG(debug, "Soft-timeout computed factor=%1.3f, used factor=%1.3f, softTimeout=%lu softDoom=%ld hardDoom=%ld", + _stats.softDoomFactor(), factor, safeLeft, safeDoom.ns(), request.getTimeOfDoom().ns()); } - uint64_t safeLeft = request.getTimeLeft() * factor; - fastos::TimeStamp safeDoom(fastos::ClockSystem::now() + safeLeft); return std::make_unique<MatchToolsFactory>(_queryLimiter, vespalib::Doom(_clock, safeDoom), vespalib::Doom(_clock, request.getTimeOfDoom()), searchContext, attrContext, request.getStackRef(), request.location, _viewResolver, @@ -185,8 +177,7 @@ Matcher::create_match_tools_factory(const search::engine::Request &request, } SearchReply::UP -Matcher::handleGroupingSession(SessionManager &sessionMgr, - GroupingContext & groupingContext, +Matcher::handleGroupingSession(SessionManager &sessionMgr, GroupingContext & groupingContext, GroupingSession::UP groupingSession) { SearchReply::UP reply = std::make_unique<SearchReply>(); @@ -209,12 +200,9 @@ Matcher::computeNumThreadsPerSearch(Blueprint::HitEstimate hits, const Propertie } SearchReply::UP -Matcher::match(const SearchRequest &request, - vespalib::ThreadBundle &threadBundle, - ISearchContext &searchContext, - IAttributeContext &attrContext, - SessionManager &sessionMgr, - const search::IDocumentMetaStore &metaStore, +Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundle, + ISearchContext &searchContext, IAttributeContext &attrContext, + SessionManager &sessionMgr, const search::IDocumentMetaStore &metaStore, SearchSession::OwnershipBundle &&owned_objects) { fastos::StopWatch total_matching_time; @@ -279,15 +267,7 @@ Matcher::match(const SearchRequest &request, sessionMgr.insert(std::move(session)); } reply = std::move(result->_reply); - SearchReply::Coverage & coverage = reply->coverage; - if (wasLimited) { - LOG(debug, "was limited, degraded from match phase"); - coverage.degradeMatchPhase(); - } - if (my_stats.softDoomed()) { - LOG(debug, "soft doomed, degraded from timeout"); - coverage.degradeTimeout(); - } + uint32_t numActiveLids = metaStore.getNumActiveLids(); // note: this is actually totalSpace+1, since 0 is reserved uint32_t totalSpace = metaStore.getCommittedDocIdLimit(); @@ -303,10 +283,20 @@ Matcher::match(const SearchRequest &request, } size_t covered = (spaceEstimate * numActiveLids) / totalSpace; LOG(debug, "covered = %zd", covered); + + SearchReply::Coverage & coverage = reply->coverage; coverage.setActive(numActiveLids); //TODO this should be calculated with ClusterState calculator. coverage.setSoonActive(numActiveLids); coverage.setCovered(covered); + if (wasLimited) { + coverage.degradeMatchPhase(); + LOG(debug, "was limited, degraded from match phase"); + } + if (my_stats.softDoomed()) { + coverage.degradeTimeout(); + coverage.setCovered(my_stats.docsCovered()); + LOG(debug, "soft doomed, degraded from timeout covered = %lu", coverage.getCovered()); } LOG(debug, "numThreadsPerSearch = %zu. Configured = %d, estimated hits=%d, totalHits=%ld", numThreadsPerSearch, _rankSetup->getNumThreadsPerSearch(), estHits, reply->totalHitCount); } @@ -326,19 +316,15 @@ Matcher::match(const SearchRequest &request, } FeatureSet::SP -Matcher::getSummaryFeatures(const DocsumRequest & req, - ISearchContext & searchCtx, - IAttributeContext & attrCtx, - SessionManager &sessionMgr) +Matcher::getSummaryFeatures(const DocsumRequest & req, ISearchContext & searchCtx, + IAttributeContext & attrCtx, SessionManager &sessionMgr) { return getFeatureSet(req, searchCtx, attrCtx, sessionMgr, true); } FeatureSet::SP -Matcher::getRankFeatures(const DocsumRequest & req, - ISearchContext & searchCtx, - IAttributeContext & attrCtx, - SessionManager &sessionMgr) +Matcher::getRankFeatures(const DocsumRequest & req, ISearchContext & searchCtx, + IAttributeContext & attrCtx, SessionManager &sessionMgr) { return getFeatureSet(req, searchCtx, attrCtx, sessionMgr, false); } diff --git a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp index de46386d6e1..7ea417bb7d2 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp @@ -18,6 +18,7 @@ MatchingStats::Partition &get_writable_partition(std::vector<MatchingStats::Part MatchingStats::MatchingStats() : _queries(0), _limited_queries(0), + _docsCovered(0), _docsMatched(0), _docsRanked(0), _docsReRanked(0), @@ -31,13 +32,14 @@ MatchingStats::MatchingStats() _partitions() { } -MatchingStats::~MatchingStats() { } +MatchingStats::~MatchingStats() = default; MatchingStats & MatchingStats::merge_partition(const Partition &partition, size_t id) { get_writable_partition(_partitions, id) = partition; + _docsCovered += partition.docsCovered(); _docsMatched += partition.docsMatched(); _docsRanked += partition.docsRanked(); _docsReRanked += partition.docsReRanked(); @@ -51,10 +53,10 @@ MatchingStats::merge_partition(const Partition &partition, size_t id) MatchingStats & MatchingStats::add(const MatchingStats &rhs) { - _queries += rhs._queries; _limited_queries += rhs._limited_queries; + _docsCovered += rhs._docsCovered; _docsMatched += rhs._docsMatched; _docsRanked += rhs._docsRanked; _docsReRanked += rhs._docsReRanked; diff --git a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h index 99084098f6f..e4578547e60 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h +++ b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h @@ -37,6 +37,7 @@ public: * thread. **/ class Partition { + size_t _docsCovered; size_t _docsMatched; size_t _docsRanked; size_t _docsReRanked; @@ -45,13 +46,16 @@ public: Avg _wait_time; public: Partition() - : _docsMatched(0), + : _docsCovered(0), + _docsMatched(0), _docsRanked(0), _docsReRanked(0), _softDoomed(0), _active_time(), _wait_time() { } + Partition &docsCovered(size_t value) { _docsCovered = value; return *this; } + size_t docsCovered() const { return _docsCovered; } Partition &docsMatched(size_t value) { _docsMatched = value; return *this; } size_t docsMatched() const { return _docsMatched; } Partition &docsRanked(size_t value) { _docsRanked = value; return *this; } @@ -69,6 +73,7 @@ public: size_t wait_time_count() const { return _wait_time.count(); } Partition &add(const Partition &rhs) { + _docsCovered += rhs.docsCovered(); _docsMatched += rhs._docsMatched; _docsRanked += rhs._docsRanked; _docsReRanked += rhs._docsReRanked; @@ -83,6 +88,7 @@ public: private: size_t _queries; size_t _limited_queries; + size_t _docsCovered; size_t _docsMatched; size_t _docsRanked; size_t _docsReRanked; @@ -109,6 +115,9 @@ public: MatchingStats &limited_queries(size_t value) { _limited_queries = value; return *this; } size_t limited_queries() const { return _limited_queries; } + MatchingStats &docsCovered(size_t value) { _docsCovered = value; return *this; } + size_t docsCovered() const { return _docsCovered; } + MatchingStats &docsMatched(size_t value) { _docsMatched = value; return *this; } size_t docsMatched() const { return _docsMatched; } |