diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-03-05 14:03:39 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-03-05 14:03:39 +0000 |
commit | 774a725b9d525e6e6be35ed4651d6c0b8d2358c4 (patch) | |
tree | f6c125002527309d6c49e84e5121e288da7e8f75 /searchlib | |
parent | 4869f87c3e5e175f118a68ed24c73c1ccbb72771 (diff) |
Control traceLevel
Diffstat (limited to 'searchlib')
4 files changed, 36 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/engine/packetconverter.cpp b/searchlib/src/vespa/searchlib/engine/packetconverter.cpp index 8a55af4cfb7..d87d9888aae 100644 --- a/searchlib/src/vespa/searchlib/engine/packetconverter.cpp +++ b/searchlib/src/vespa/searchlib/engine/packetconverter.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "packetconverter.h" +#include <vespa/searchlib/fef/indexproperties.h> + #include <vespa/log/log.h> LOG_SETUP(".engine.packetconverter"); @@ -74,6 +76,7 @@ PacketConverter::toSearchRequest(const QUERYX &packet, SearchRequest &request) request.location = packet._location; request.stackItems = packet._numStackItems; request.stackDump.assign( packet._stackDump.begin(), packet._stackDump.end()); + request.setTraceLevel(search::fef::indexproperties::trace::Level::lookup(request.propertiesMap.modelOverrides())); } void diff --git a/searchlib/src/vespa/searchlib/engine/propertiesmap.cpp b/searchlib/src/vespa/searchlib/engine/propertiesmap.cpp index b09813c0258..4726a3b9c27 100644 --- a/searchlib/src/vespa/searchlib/engine/propertiesmap.cpp +++ b/searchlib/src/vespa/searchlib/engine/propertiesmap.cpp @@ -11,7 +11,7 @@ PropertiesMap::PropertiesMap() : _propertiesMap() { } -PropertiesMap::~PropertiesMap() { } +PropertiesMap::~PropertiesMap() = default; fef::Properties & PropertiesMap::lookupCreate(vespalib::stringref name) diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp index 5cd6c479d24..fd73ce5a0f0 100644 --- a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp +++ b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp @@ -388,6 +388,24 @@ DiversityCutoffStrategy::lookup(const Properties &props, const vespalib::string return lookupString(props, NAME, defaultValue); } +} + +namespace trace { + +const vespalib::string Level::NAME("tracelevel"); +const uint32_t Level::DEFAULT_VALUE(0); + +uint32_t +Level::lookup(const Properties &props) +{ + return lookup(props, DEFAULT_VALUE); +} + +uint32_t +Level::lookup(const Properties &props, uint32_t defaultValue) +{ + return lookupUint32(props, NAME, defaultValue); +} } diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.h b/searchlib/src/vespa/searchlib/fef/indexproperties.h index 8b78e347a90..23efe514d68 100644 --- a/searchlib/src/vespa/searchlib/fef/indexproperties.h +++ b/searchlib/src/vespa/searchlib/fef/indexproperties.h @@ -310,6 +310,20 @@ namespace matchphase { } // namespace matchphase +namespace trace { + + /** + * Property for the heap size used in the hit collector. + **/ + struct Level { + static const vespalib::string NAME; + static const uint32_t DEFAULT_VALUE; + static uint32_t lookup(const Properties &props); + static uint32_t lookup(const Properties &props, uint32_t defaultValue); + }; + +} + namespace hitcollector { |