diff options
author | Henning Baldersheim <balder@oath.com> | 2018-02-06 11:48:47 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-02-06 11:48:47 +0100 |
commit | b56c67887f04d37827959f781e0791dba0074598 (patch) | |
tree | ae40a14dfe8f94f731886d381c1210a89fab00d0 /searchcore | |
parent | 812b64530b387bbe6ddbd76512089250436f5fdb (diff) |
Compute number of covered documents if degraded by soft timeout.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/matching/matcher.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index ec6c1761829..e551bb9297c 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -281,15 +281,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(); @@ -305,10 +297,21 @@ 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) { + LOG(debug, "was limited, degraded from match phase"); + coverage.degradeMatchPhase(); + } + if (my_stats.softDoomed()) { + LOG(debug, "soft doomed, degraded from timeout"); + coverage.degradeTimeout(); + coverage.setCovered(my_stats.docsCovered()); + } LOG(debug, "numThreadsPerSearch = %zu. Configured = %d, estimated hits=%d, totalHits=%ld", numThreadsPerSearch, _rankSetup->getNumThreadsPerSearch(), estHits, reply->totalHitCount); } |