summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2020-03-24 14:35:52 +0000
committerGeir Storli <geirst@verizonmedia.com>2020-03-24 14:35:52 +0000
commit86f42102e74045fefe744c9bff0e31ff878b99a8 (patch)
tree3b2aa6ce04fffe756acc0c4613a680e5ea574aeb /searchcore
parent4f29479b720958cba7e40e1142b379962f55c2e8 (diff)
Expose information from tensor attribute and hnsw index in state explorer for attribute.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp15
1 files changed, 11 insertions, 4 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 ad49c12a556..495fc5d63b3 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp
@@ -5,6 +5,8 @@
#include <vespa/searchlib/attribute/multi_value_mapping.h>
#include <vespa/searchlib/attribute/attributevector.h>
#include <vespa/searchlib/attribute/ipostinglistattributebase.h>
+#include <vespa/searchlib/util/state_explorer_utils.h>
+#include <vespa/searchlib/tensor/i_tensor_attribute.h>
#include <vespa/vespalib/data/slime/cursor.h>
using search::attribute::Status;
@@ -67,10 +69,7 @@ convertAddressSpaceUsageToSlime(const AddressSpaceUsage &usage, Cursor &object)
void
convertMemoryUsageToSlime(const MemoryUsage &usage, Cursor &object)
{
- object.setLong("allocated", usage.allocatedBytes());
- object.setLong("used", usage.usedBytes());
- object.setLong("dead", usage.deadBytes());
- object.setLong("onHold", usage.allocatedBytesOnHold());
+ search::StateExplorerUtils::memory_usage_to_slime(usage, object);
}
void
@@ -119,6 +118,9 @@ AttributeVectorExplorer::get_state(const vespalib::slime::Inserter &inserter, bo
convertStatusToSlime(status, object.setObject("status"));
convertGenerationToSlime(attr, object.setObject("generation"));
convertAddressSpaceUsageToSlime(attr.getAddressSpaceUsage(), object.setObject("addressSpaceUsage"));
+ // TODO: Consider making enum store, multivalue mapping, posting list attribute and tensor attribute
+ // explorable as children of this state explorer, and let them expose even more detailed information.
+ // In this case we must ensure that ExclusiveAttributeReadAccessor::Guard is held also when exploring children.
const IEnumStore *enumStore = attr.getEnumStoreBase();
if (enumStore) {
convertEnumStoreToSlime(*enumStore, object.setObject("enumStore"));
@@ -131,6 +133,11 @@ AttributeVectorExplorer::get_state(const vespalib::slime::Inserter &inserter, bo
if (postingBase) {
convertPostingBaseToSlime(*postingBase, object.setObject("postingList"));
}
+ const auto* tensor_attr = attr.asTensorAttribute();
+ if (tensor_attr) {
+ ObjectInserter tensor_inserter(object, "tensor");
+ tensor_attr->get_state(tensor_inserter);
+ }
convertChangeVectorToSlime(attr, object.setObject("changeVector"));
object.setLong("committedDocIdLimit", attr.getCommittedDocIdLimit());
object.setLong("createSerialNum", attr.getCreateSerialNum());