diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-20 14:53:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-20 14:53:43 +0100 |
commit | 3c5c6a9545b1c75b50137178c944c616809dc778 (patch) | |
tree | 572c48f639342c2a6eae479ca364619b13743741 | |
parent | 3b3ed2bb87ed4ab7d1599acf08bb6cc566a94dd6 (diff) | |
parent | 91bac5fad5769ed64afde89cbbfb8df19e9133f7 (diff) |
Merge pull request #11611 from vespa-engine/balder/add-more-setup-details-to-trace
Add more details to the trace.
7 files changed, 25 insertions, 7 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp index 05b70cfb8bf..f7fce994bd1 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp @@ -5,6 +5,7 @@ #include <vespa/searchcorespi/index/indexsearchable.h> #include <vespa/searchlib/fef/indexproperties.h> #include <vespa/searchlib/fef/ranksetup.h> +#include <vespa/searchlib/engine/trace.h> #include <vespa/searchlib/parsequery/stackdumpiterator.h> #include <vespa/searchlib/attribute/diversity.h> #include <vespa/searchlib/attribute/attribute_operation.h> @@ -150,6 +151,7 @@ MatchToolsFactory(QueryLimiter & queryLimiter, const vespalib::Doom & doom, ISearchContext & searchContext, IAttributeContext & attributeContext, + search::engine::Trace & trace, vespalib::stringref queryStack, const vespalib::string & location, const ViewResolver & viewResolver, @@ -169,22 +171,28 @@ MatchToolsFactory(QueryLimiter & queryLimiter, _diversityParams(), _valid(false) { + trace.addEvent(4, "MTF: Start"); _query.setWhiteListBlueprint(metaStore.createWhiteListBlueprint()); + trace.addEvent(5, "MTF: Build query"); _valid = _query.buildTree(queryStack, location, viewResolver, indexEnv, rankSetup.split_unpacking_iterators(), rankSetup.delay_unpacking_iterators()); if (_valid) { _query.extractTerms(_queryEnv.terms()); _query.extractLocations(_queryEnv.locations()); + trace.addEvent(5, "MTF: reserve handles"); _query.reserveHandles(_requestContext, searchContext, _mdl); _query.optimize(); + trace.addEvent(4, "MTF: Fetch Postings"); _query.fetchPostings(); _query.freeze(); + trace.addEvent(5, "MTF: prepareSharedState"); _rankSetup.prepareSharedState(_queryEnv, _queryEnv.getObjectStore()); _diversityParams = extractDiversityParams(_rankSetup, rankProperties); DegradationParams degradationParams = extractDegradationParams(_rankSetup, rankProperties); if (degradationParams.enabled()) { + trace.addEvent(5, "MTF: Build MatchPhaseLimiter"); _match_limiter = std::make_unique<MatchPhaseLimiter>(metaStore.getCommittedDocIdLimit(), searchContext.getAttributes(), _requestContext, degradationParams, _diversityParams); } @@ -192,6 +200,7 @@ MatchToolsFactory(QueryLimiter & queryLimiter, if ( ! _match_limiter) { _match_limiter = std::make_unique<NoMatchPhaseLimiter>(); } + trace.addEvent(4, "MTF: Complete"); } MatchToolsFactory::~MatchToolsFactory() = default; diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h index 5cf2919198a..43288cb18c6 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h +++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h @@ -17,6 +17,8 @@ #include <vespa/vespalib/util/doom.h> #include <vespa/vespalib/util/clock.h> +namespace search::engine { class Trace; } + namespace search::fef { class RankProgram; class RankSetup; @@ -109,6 +111,7 @@ public: const vespalib::Doom & softDoom, ISearchContext &searchContext, search::attribute::IAttributeContext &attributeContext, + search::engine::Trace & trace, vespalib::stringref queryStack, const vespalib::string &location, const ViewResolver &viewResolver, diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index 4c353a4b802..7fddad326f6 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -153,8 +153,9 @@ Matcher::create_match_tools_factory(const search::engine::Request &request, ISea _stats.softDoomFactor(), factor, hasFactorOverride, vespalib::count_ns(safeLeft)); } vespalib::Doom doom(_clock, safeDoom, request.getTimeOfDoom(), hasFactorOverride); - return std::make_unique<MatchToolsFactory>(_queryLimiter, doom, searchContext, attrContext, request.getStackRef(), - request.location, _viewResolver, metaStore, _indexEnv, *_rankSetup, + return std::make_unique<MatchToolsFactory>(_queryLimiter, doom, searchContext, attrContext, + request.trace(), request.getStackRef(), request.location, + _viewResolver, metaStore, _indexEnv, *_rankSetup, rankProperties, feature_overrides); } @@ -213,6 +214,7 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl owned_objects.feature_overrides = std::make_unique<Properties>(*feature_overrides); feature_overrides = owned_objects.feature_overrides.get(); } + MatchToolsFactory::UP mtf = create_match_tools_factory(request, searchContext, attrContext, metaStore, *feature_overrides); isDoomExplicit = mtf->getRequestContext().getDoom().isExplicitSoftDoom(); diff --git a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp index 592dc26623d..7f2ac5db768 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp +++ b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp @@ -174,9 +174,7 @@ DocumentDBReferenceResolver::DocumentDBReferenceResolver(const IDocumentDBRefere { } -DocumentDBReferenceResolver::~DocumentDBReferenceResolver() -{ -} +DocumentDBReferenceResolver::~DocumentDBReferenceResolver() = default; ImportedAttributesRepo::UP DocumentDBReferenceResolver::resolve(const IAttributeManager &newAttrMgr, diff --git a/searchcore/src/vespa/searchcore/proton/server/document_db_maintenance_config.cpp b/searchcore/src/vespa/searchcore/proton/server/document_db_maintenance_config.cpp index b967e745b1f..57ef2d1a45c 100644 --- a/searchcore/src/vespa/searchcore/proton/server/document_db_maintenance_config.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/document_db_maintenance_config.cpp @@ -125,6 +125,8 @@ DocumentDBMaintenanceConfig::DocumentDBMaintenanceConfig() { } +DocumentDBMaintenanceConfig::~DocumentDBMaintenanceConfig() = default; + DocumentDBMaintenanceConfig:: DocumentDBMaintenanceConfig(const DocumentDBPruneRemovedDocumentsConfig &pruneRemovedDocuments, const DocumentDBHeartBeatConfig &heartBeat, diff --git a/searchcore/src/vespa/searchcore/proton/server/document_db_maintenance_config.h b/searchcore/src/vespa/searchcore/proton/server/document_db_maintenance_config.h index 283d66e8295..604977aa04f 100644 --- a/searchcore/src/vespa/searchcore/proton/server/document_db_maintenance_config.h +++ b/searchcore/src/vespa/searchcore/proton/server/document_db_maintenance_config.h @@ -103,7 +103,6 @@ private: public: DocumentDBMaintenanceConfig(); - DocumentDBMaintenanceConfig(const DocumentDBPruneRemovedDocumentsConfig &pruneRemovedDocuments, const DocumentDBHeartBeatConfig &heartBeat, vespalib::duration sessionCachePruneInterval, @@ -114,6 +113,11 @@ public: const BlockableMaintenanceJobConfig &blockableJobConfig, const DocumentDBFlushConfig &flushConfig); + DocumentDBMaintenanceConfig(const DocumentDBMaintenanceConfig &) = delete; + DocumentDBMaintenanceConfig & operator = (const DocumentDBMaintenanceConfig &) = delete; + ~DocumentDBMaintenanceConfig(); + + bool operator==(const DocumentDBMaintenanceConfig &rhs) const; diff --git a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp index bc1ade979e6..49ae5209aa0 100644 --- a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp +++ b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp @@ -33,7 +33,7 @@ ImportedSearchContext::ImportedSearchContext( const IAttributeVector &target_attribute) : _imported_attribute(imported_attribute), _queryTerm(term->getTerm()), - _useSearchCache(_imported_attribute.getSearchCache().get() != nullptr), + _useSearchCache(_imported_attribute.getSearchCache()), _searchCacheLookup((_useSearchCache ? _imported_attribute.getSearchCache()->find(_queryTerm) : std::shared_ptr<BitVectorSearchCache::Entry>())), _dmsReadGuard((_useSearchCache && !_searchCacheLookup) ? imported_attribute.getDocumentMetaStore()->getReadGuard() : |