diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-09-19 13:31:58 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-09-19 13:31:58 +0000 |
commit | 1d1263c544d49c2816b6ab54ee1c2a5b989004e7 (patch) | |
tree | 0aa1f44eec2a68cf30c697fd27b29fb79643f597 /searchcore | |
parent | d825bb328c94e138ea87301282c85cc4edb5e585 (diff) |
Expose posting list memory usage in attribute vector explorer.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp index a90b60fea4e..25ab7e27387 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp @@ -4,6 +4,7 @@ #include <vespa/searchlib/attribute/enumstorebase.h> #include <vespa/searchlib/attribute/multi_value_mapping.h> #include <vespa/searchlib/attribute/attributevector.h> +#include <vespa/searchlib/attribute/ipostinglistattributebase.h> #include <vespa/vespalib/data/slime/cursor.h> using search::attribute::Status; @@ -13,6 +14,7 @@ using search::AttributeVector; using search::EnumStoreBase; using search::MemoryUsage; using search::attribute::MultiValueMappingBase; +using search::attribute::IPostingListAttributeBase; using namespace vespalib::slime; namespace proton { @@ -87,7 +89,6 @@ convertMultiValueToSlime(const MultiValueMappingBase &multiValue, Cursor &object convertMemoryUsageToSlime(multiValue.getMemoryUsage(), object.setObject("memoryUsage")); } - void convertChangeVectorToSlime(const AttributeVector &v, Cursor &object) { @@ -95,6 +96,12 @@ convertChangeVectorToSlime(const AttributeVector &v, Cursor &object) convertMemoryUsageToSlime(usage, object); } +void +convertPostingBaseToSlime(const IPostingListAttributeBase &postingBase, Cursor &object) +{ + convertMemoryUsageToSlime(postingBase.getMemoryUsage(), object.setObject("memoryUsage")); +} + } AttributeVectorExplorer::AttributeVectorExplorer(ExclusiveAttributeReadAccessor::UP attribute) @@ -121,6 +128,10 @@ AttributeVectorExplorer::get_state(const vespalib::slime::Inserter &inserter, bo if (multiValue) { convertMultiValueToSlime(*multiValue, object.setObject("multiValue")); } + const IPostingListAttributeBase *postingBase = attr.getIPostingListAttributeBase(); + if (postingBase) { + convertPostingBaseToSlime(*postingBase, object.setObject("postingList")); + } convertChangeVectorToSlime(attr, object.setObject("changeVector")); object.setLong("committedDocIdLimit", attr.getCommittedDocIdLimit()); object.setLong("createSerialNum", attr.getCreateSerialNum()); |