aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2018-09-24 15:05:36 +0000
committergjoranv <gv@oath.com>2019-01-21 15:09:22 +0100
commit94cbaa1e5dff6dcb2a8588b24e5e9a31cb4b796e (patch)
treecf055b9c4c50765268e94420d640f04d33d66bce /searchcore
parentabdd74bab2a9c834e6b13bd88270896e2f59af1f (diff)
Remove all legacy proton metrics (that were deprecated on Vespa 6).
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp10
-rw-r--r--searchcore/src/tests/proton/metrics/metrics_engine/metrics_engine_test.cpp34
-rw-r--r--searchcore/src/tests/proton/server/CMakeLists.txt8
-rw-r--r--searchcore/src/tests/proton/server/legacy_attribute_metrics_test.cpp55
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt4
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/attribute_metrics_collection.h11
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.cpp8
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.h7
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/legacy_attribute_metrics.cpp76
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/legacy_attribute_metrics.h47
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/legacy_documentdb_metrics.cpp181
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/legacy_documentdb_metrics.h138
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/legacy_proton_metrics.cpp48
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/legacy_proton_metrics.h43
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/legacy_sessionmanager_metrics.cpp29
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/legacy_sessionmanager_metrics.h29
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.cpp111
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/metricswireservice.h13
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp84
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp16
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp10
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp12
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp2
27 files changed, 51 insertions, 950 deletions
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index 45c9ae71bc9..a2782437043 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -9,7 +9,6 @@
#include <vespa/searchcore/proton/metrics/attribute_metrics.h>
#include <vespa/searchcore/proton/metrics/attribute_metrics_collection.h>
#include <vespa/searchcore/proton/metrics/documentdb_metrics_collection.h>
-#include <vespa/searchcore/proton/metrics/legacy_attribute_metrics.h>
#include <vespa/searchcore/proton/metrics/metricswireservice.h>
#include <vespa/searchcore/proton/reference/i_document_db_reference_resolver.h>
#include <vespa/searchcore/proton/reprocessing/i_reprocessing_task.h>
@@ -108,7 +107,7 @@ struct MyMetricsWireService : public DummyWireService
{
std::set<vespalib::string> _attributes;
MyMetricsWireService() : _attributes() {}
- virtual void addAttribute(const AttributeMetricsCollection &, LegacyAttributeMetrics *, const std::string &name) override {
+ virtual void addAttribute(const AttributeMetricsCollection &, const std::string &name) override {
_attributes.insert(name);
}
};
@@ -182,7 +181,6 @@ struct MyFastAccessContext
{
MyStoreOnlyContext _storeOnlyCtx;
AttributeMetrics _attributeMetrics;
- LegacyAttributeMetrics _legacyAttributeMetrics;
AttributeMetricsCollection _attributeMetricsCollection;
MyMetricsWireService _wireService;
FastAccessContext _ctx;
@@ -203,10 +201,10 @@ MyFastAccessContext::MyFastAccessContext(IThreadingService &writeService, Thread
std::shared_ptr<BucketDBOwner> bucketDB,
IBucketDBHandlerInitializer & bucketDBHandlerInitializer)
: _storeOnlyCtx(writeService, summaryExecutor, bucketDB, bucketDBHandlerInitializer),
- _attributeMetrics(NULL), _legacyAttributeMetrics(NULL),
- _attributeMetricsCollection(_attributeMetrics, _legacyAttributeMetrics),
+ _attributeMetrics(NULL),
+ _attributeMetricsCollection(_attributeMetrics),
_wireService(),
- _ctx(_storeOnlyCtx._ctx, _attributeMetricsCollection, NULL, _wireService)
+ _ctx(_storeOnlyCtx._ctx, _attributeMetricsCollection, _wireService)
{}
MyFastAccessContext::~MyFastAccessContext() = default;
diff --git a/searchcore/src/tests/proton/metrics/metrics_engine/metrics_engine_test.cpp b/searchcore/src/tests/proton/metrics/metrics_engine/metrics_engine_test.cpp
index e10fd41ffed..d3cd3f0d92e 100644
--- a/searchcore/src/tests/proton/metrics/metrics_engine/metrics_engine_test.cpp
+++ b/searchcore/src/tests/proton/metrics/metrics_engine/metrics_engine_test.cpp
@@ -1,5 +1,4 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-// Unit tests for metrics_engine.
#include <vespa/metrics/metricset.h>
#include <vespa/searchcore/proton/metrics/attribute_metrics_collection.h>
@@ -23,56 +22,31 @@ struct AttributeMetricsFixture {
MetricsEngine engine;
DummyMetricSet parent;
AttributeMetrics metrics;
- LegacyAttributeMetrics legacyMetrics;
- LegacyAttributeMetrics totalLegacyMetrics;
AttributeMetricsFixture()
: engine(),
parent("parent"),
- metrics(&parent),
- legacyMetrics(nullptr),
- totalLegacyMetrics(nullptr)
+ metrics(&parent)
{}
void addAttribute(const vespalib::string &attrName) {
- engine.addAttribute(AttributeMetricsCollection(metrics, legacyMetrics), &totalLegacyMetrics, attrName);
+ engine.addAttribute(AttributeMetricsCollection(metrics), attrName);
}
void removeAttribute(const vespalib::string &attrName) {
- engine.removeAttribute(AttributeMetricsCollection(metrics, legacyMetrics), &totalLegacyMetrics, attrName);
+ engine.removeAttribute(AttributeMetricsCollection(metrics), attrName);
}
void cleanAttributes() {
- engine.cleanAttributes(AttributeMetricsCollection(metrics, legacyMetrics), &totalLegacyMetrics);
+ engine.cleanAttributes(AttributeMetricsCollection(metrics));
}
void assertRegisteredMetrics(size_t expNumMetrics) const {
EXPECT_EQUAL(expNumMetrics, parent.getRegisteredMetrics().size());
- EXPECT_EQUAL(expNumMetrics, legacyMetrics.list.getRegisteredMetrics().size());
- EXPECT_EQUAL(expNumMetrics, totalLegacyMetrics.list.getRegisteredMetrics().size());
}
void assertMetricsExists(const vespalib::string &attrName) {
EXPECT_TRUE(metrics.get(attrName) != nullptr);
- EXPECT_TRUE(legacyMetrics.list.get(attrName) != nullptr);
- EXPECT_TRUE(totalLegacyMetrics.list.get(attrName) != nullptr);
}
void assertMetricsNotExists(const vespalib::string &attrName) {
EXPECT_TRUE(metrics.get(attrName) == nullptr);
- EXPECT_TRUE(legacyMetrics.list.get(attrName) == nullptr);
- EXPECT_TRUE(totalLegacyMetrics.list.get(attrName) == nullptr);
}
};
-TEST("require that the metric proton.diskusage is the sum of the documentDB diskusage metrics")
-{
- MetricsEngine metrics_engine;
-
- DocumentDBMetricsCollection metrics1("type1", 1);
- DocumentDBMetricsCollection metrics2("type2", 1);
- metrics1.getLegacyMetrics().index.diskUsage.addValue(100);
- metrics2.getLegacyMetrics().index.diskUsage.addValue(1000);
-
- metrics_engine.addDocumentDBMetrics(metrics1);
- metrics_engine.addDocumentDBMetrics(metrics2);
-
- EXPECT_EQUAL(1100, metrics_engine.legacyRoot().diskUsage.getLongValue("value"));
-}
-
TEST_F("require that attribute metrics can be added", AttributeMetricsFixture)
{
TEST_DO(f.assertRegisteredMetrics(0));
diff --git a/searchcore/src/tests/proton/server/CMakeLists.txt b/searchcore/src/tests/proton/server/CMakeLists.txt
index 31f67bdd0ac..51595daf407 100644
--- a/searchcore/src/tests/proton/server/CMakeLists.txt
+++ b/searchcore/src/tests/proton/server/CMakeLists.txt
@@ -1,12 +1,4 @@
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_legacy_attribute_metrics_test_app TEST
- SOURCES
- legacy_attribute_metrics_test.cpp
- DEPENDS
- searchcore_server
- searchcore_proton_metrics
-)
-vespa_add_test(NAME searchcore_legacy_attribute_metrics_test_app COMMAND searchcore_legacy_attribute_metrics_test_app)
vespa_add_executable(searchcore_documentretriever_test_app TEST
SOURCES
documentretriever_test.cpp
diff --git a/searchcore/src/tests/proton/server/legacy_attribute_metrics_test.cpp b/searchcore/src/tests/proton/server/legacy_attribute_metrics_test.cpp
deleted file mode 100644
index bf68deafb96..00000000000
--- a/searchcore/src/tests/proton/server/legacy_attribute_metrics_test.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP("attribute_metrics_test");
-#include <vespa/vespalib/testkit/testapp.h>
-
-#include <vespa/searchcore/proton/metrics/legacy_attribute_metrics.h>
-
-using namespace proton;
-
-class Test : public vespalib::TestApp
-{
-public:
- int Main() override;
-};
-
-int
-Test::Main()
-{
- TEST_INIT("attribute_metrics_test");
- {
- LegacyAttributeMetrics attrMetrics(0);
- EXPECT_EQUAL(0u, attrMetrics.list.release().size());
- {
- LegacyAttributeMetrics::List::Entry *e1 = attrMetrics.list.add("foo");
- LegacyAttributeMetrics::List::Entry *e2 = attrMetrics.list.add("bar");
- LegacyAttributeMetrics::List::Entry *e3 = attrMetrics.list.add("foo");
- EXPECT_TRUE(e1 != nullptr);
- EXPECT_TRUE(e2 != nullptr);
- EXPECT_TRUE(e3 == nullptr);
- }
- {
- const LegacyAttributeMetrics &constMetrics = attrMetrics;
- LegacyAttributeMetrics::List::Entry *e1 = constMetrics.list.get("foo");
- LegacyAttributeMetrics::List::Entry *e2 = constMetrics.list.get("bar");
- LegacyAttributeMetrics::List::Entry *e3 = constMetrics.list.get("baz");
- EXPECT_TRUE(e1 != nullptr);
- EXPECT_TRUE(e2 != nullptr);
- EXPECT_TRUE(e3 == nullptr);
- }
- EXPECT_EQUAL(2u, attrMetrics.list.release().size());
- {
- const LegacyAttributeMetrics &constMetrics = attrMetrics;
- LegacyAttributeMetrics::List::Entry *e1 = constMetrics.list.get("foo");
- LegacyAttributeMetrics::List::Entry *e2 = constMetrics.list.get("bar");
- LegacyAttributeMetrics::List::Entry *e3 = constMetrics.list.get("baz");
- EXPECT_TRUE(e1 == nullptr);
- EXPECT_TRUE(e2 == nullptr);
- EXPECT_TRUE(e3 == nullptr);
- }
- EXPECT_EQUAL(0u, attrMetrics.list.release().size());
- }
- TEST_DONE();
-}
-
-TEST_APPHOOK(Test);
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt
index 6e01bae1866..9f9640a4a06 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt
+++ b/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt
@@ -13,10 +13,6 @@ vespa_add_library(searchcore_proton_metrics STATIC
job_tracker.cpp
job_tracked_flush_target.cpp
job_tracked_flush_task.cpp
- legacy_attribute_metrics.cpp
- legacy_documentdb_metrics.cpp
- legacy_proton_metrics.cpp
- legacy_sessionmanager_metrics.cpp
memory_usage_metrics.cpp
metrics_engine.cpp
resource_usage_metrics.cpp
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/attribute_metrics_collection.h b/searchcore/src/vespa/searchcore/proton/metrics/attribute_metrics_collection.h
index 52a49688b64..1a0fc333213 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/attribute_metrics_collection.h
+++ b/searchcore/src/vespa/searchcore/proton/metrics/attribute_metrics_collection.h
@@ -4,7 +4,6 @@
namespace proton {
class AttributeMetrics;
-class LegacyAttributeMetrics;
/**
* A collection of references to all the metrics for a set of attributes.
@@ -13,18 +12,14 @@ class AttributeMetricsCollection
{
private:
AttributeMetrics &_metrics;
- LegacyAttributeMetrics &_legacyMetrics;
public:
- AttributeMetricsCollection(AttributeMetrics &metrics,
- LegacyAttributeMetrics &legacyMetrics)
- : _metrics(metrics),
- _legacyMetrics(legacyMetrics)
+ AttributeMetricsCollection(AttributeMetrics &metrics)
+ : _metrics(metrics)
{
}
AttributeMetrics &getMetrics() const { return _metrics; }
- LegacyAttributeMetrics &getLegacyMetrics() const { return _legacyMetrics; }
};
-} // namespace proton
+}
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.cpp b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.cpp
index 80a1508614b..a936530a346 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.cpp
+++ b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.cpp
@@ -5,11 +5,11 @@
namespace proton {
DocumentDBMetricsCollection::DocumentDBMetricsCollection(const vespalib::string &docTypeName, size_t maxNumThreads)
- : _metrics(docTypeName, maxNumThreads),
- _taggedMetrics(docTypeName)
+ : _taggedMetrics(docTypeName),
+ _maxNumThreads(maxNumThreads)
{}
-DocumentDBMetricsCollection::~DocumentDBMetricsCollection() {}
+DocumentDBMetricsCollection::~DocumentDBMetricsCollection() = default;
-} // namespace proton
+}
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.h b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.h
index 8fa15dffc9d..536007f5dfa 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.h
+++ b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.h
@@ -2,7 +2,6 @@
#pragma once
#include "documentdb_tagged_metrics.h"
-#include "legacy_documentdb_metrics.h"
namespace proton {
@@ -12,15 +11,15 @@ namespace proton {
class DocumentDBMetricsCollection
{
private:
- LegacyDocumentDBMetrics _metrics;
DocumentDBTaggedMetrics _taggedMetrics;
+ size_t _maxNumThreads;
public:
DocumentDBMetricsCollection(const vespalib::string &docTypeName, size_t maxNumThreads);
~DocumentDBMetricsCollection();
- LegacyDocumentDBMetrics &getLegacyMetrics() { return _metrics; }
DocumentDBTaggedMetrics &getTaggedMetrics() { return _taggedMetrics; }
+ size_t maxNumThreads() const { return _maxNumThreads; }
};
-} // namespace proton
+}
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/legacy_attribute_metrics.cpp b/searchcore/src/vespa/searchcore/proton/metrics/legacy_attribute_metrics.cpp
deleted file mode 100644
index 7d182e5ccc5..00000000000
--- a/searchcore/src/vespa/searchcore/proton/metrics/legacy_attribute_metrics.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include "legacy_attribute_metrics.h"
-
-namespace proton {
-
-LegacyAttributeMetrics::List::Entry::Entry(const std::string &name)
- : metrics::MetricSet(name, {}, "Attribute vector metrics", 0),
- memoryUsage("memoryusage", {}, "Memory usage", this),
- bitVectors("bitvectors", {}, "Number of bitvectors", this)
-{
-}
-
-LegacyAttributeMetrics::List::Entry *
-LegacyAttributeMetrics::List::add(const std::string &name)
-{
- if (metrics.find(name) != metrics.end()) {
- return nullptr;
- }
- auto &pos = metrics[name];
- pos = std::make_unique<Entry>(name);
- return pos.get();
-}
-
-LegacyAttributeMetrics::List::Entry *
-LegacyAttributeMetrics::List::get(const std::string &name) const
-{
- const auto pos = metrics.find(name);
- if (pos == metrics.end()) {
- return nullptr;
- }
- return pos->second.get();
-}
-
-LegacyAttributeMetrics::List::Entry::UP
-LegacyAttributeMetrics::List::remove(const std::string &name)
-{
- auto pos = metrics.find(name);
- if (pos == metrics.end()) {
- return Entry::UP();
- }
- Entry::UP retval = std::move(pos->second);
- metrics.erase(name);
- return retval;
-}
-
-std::vector<LegacyAttributeMetrics::List::Entry::UP>
-LegacyAttributeMetrics::List::release()
-{
- std::vector<Entry::UP> entries;
- for (auto &pos: metrics) {
- entries.push_back(std::move(pos.second));
- }
- metrics.clear();
- return entries;
-}
-
-LegacyAttributeMetrics::List::List(metrics::MetricSet *parent)
- : metrics::MetricSet("list", {}, "Metrics per attribute vector", parent),
- metrics()
-{
-}
-
-LegacyAttributeMetrics::List::~List() = default;
-
-LegacyAttributeMetrics::LegacyAttributeMetrics(metrics::MetricSet *parent)
- : metrics::MetricSet("attributes", {}, "Attribute metrics", parent),
- list(this),
- memoryUsage("memoryusage", {}, "Memory usage for attributes", this),
- bitVectors("bitvectors", {}, "Number of bitvectors for attributes", this)
-{
-}
-
-LegacyAttributeMetrics::~LegacyAttributeMetrics() = default;
-
-} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/legacy_attribute_metrics.h b/searchcore/src/vespa/searchcore/proton/metrics/legacy_attribute_metrics.h
deleted file mode 100644
index 073acabf614..00000000000
--- a/searchcore/src/vespa/searchcore/proton/metrics/legacy_attribute_metrics.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#pragma once
-
-#include <vespa/metrics/metricset.h>
-#include <vespa/metrics/valuemetric.h>
-#include <map>
-
-namespace proton {
-
-struct LegacyAttributeMetrics : metrics::MetricSet {
-
- // The metric set also owns the actual metrics for individual
- // attribute vectors. Another way to do this would be to let the
- // attribute vectors own their own metrics, but this would
- // generate more dependencies and reduce locality of code changes.
-
- struct List : metrics::MetricSet {
- struct Entry : metrics::MetricSet {
- using UP = std::unique_ptr<Entry>;
- metrics::LongValueMetric memoryUsage;
- metrics::LongValueMetric bitVectors;
- Entry(const std::string &name);
- };
- Entry *add(const std::string &name);
- Entry *get(const std::string &name) const;
- Entry::UP remove(const std::string &name);
- std::vector<Entry::UP> release();
-
- // per attribute metrics will be wired in here (by the metrics engine)
- List(metrics::MetricSet *parent);
- ~List() override;
-
- private:
- std::map<std::string, Entry::UP> metrics;
- };
-
- List list;
- metrics::LongValueMetric memoryUsage;
- metrics::LongValueMetric bitVectors;
-
- LegacyAttributeMetrics(metrics::MetricSet *parent);
- ~LegacyAttributeMetrics();
-};
-
-} // namespace proton
-
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/legacy_documentdb_metrics.cpp b/searchcore/src/vespa/searchcore/proton/metrics/legacy_documentdb_metrics.cpp
deleted file mode 100644
index d4180c4ec5f..00000000000
--- a/searchcore/src/vespa/searchcore/proton/metrics/legacy_documentdb_metrics.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include "legacy_documentdb_metrics.h"
-#include <vespa/vespalib/util/stringfmt.h>
-#include <vespa/vespalib/util/exceptions.h>
-
-using vespalib::asciistream;
-using vespalib::make_string;
-using metrics::MetricSet;
-
-namespace proton {
-
-using matching::MatchingStats;
-
-LegacyDocumentDBMetrics::IndexMetrics::IndexMetrics(MetricSet *parent)
- : MetricSet("index", {}, "Index metrics", parent),
- memoryUsage("memoryusage", {}, "Memory usage for memory indexes", this),
- docsInMemory("docsinmemory", {}, "Number of documents in memory", this),
- diskUsage("diskusage", {}, "Disk usage for disk indexes", this)
-{ }
-
-LegacyDocumentDBMetrics::IndexMetrics::~IndexMetrics() {}
-
-LegacyDocumentDBMetrics::DocstoreMetrics::DocstoreMetrics(MetricSet *parent)
- : MetricSet("docstore", {}, "Document store metrics", parent),
- memoryUsage("memoryusage", {}, "Memory usage for docstore", this),
- cacheLookups("cachelookups", {}, "Number of lookups in summary cache", this),
- cacheHitRate("cachehitrate", {}, "Rate of cache hits in summary cache", this),
- cacheElements("cacheelements", {}, "Number of elements in summary cache", this),
- cacheMemoryUsed("cachememoryused", {}, "Memory used by summary cache", this)
-{ }
-
-LegacyDocumentDBMetrics::DocstoreMetrics::~DocstoreMetrics() {}
-
-void
-LegacyDocumentDBMetrics::MatchingMetrics::update(const MatchingStats &stats)
-{
- docsMatched.inc(stats.docsMatched());
- docsRanked.inc(stats.docsRanked());
- docsReRanked.inc(stats.docsReRanked());
- softDoomFactor.set(stats.softDoomFactor());
- queries.inc(stats.queries());
- queryCollateralTime.addValueBatch(stats.queryCollateralTimeAvg(), stats.queryCollateralTimeCount(),
- stats.queryCollateralTimeMin(), stats.queryCollateralTimeMax());
- queryLatency.addValueBatch(stats.queryLatencyAvg(), stats.queryLatencyCount(),
- stats.queryLatencyMin(), stats.queryLatencyMax());
-}
-
-LegacyDocumentDBMetrics::MatchingMetrics::MatchingMetrics(MetricSet *parent)
- : MetricSet("matching", {}, "Matching metrics", parent),
- docsMatched("docsmatched", {}, "Number of documents matched", this),
- docsRanked("docsranked", {}, "Number of documents ranked (first phase)", this),
- docsReRanked("docsreranked", {}, "Number of documents re-ranked (second phase)", this),
- queries("queries", {}, "Number of queries executed", this),
- softDoomFactor("softdoomfactor", {}, "Factor used to compute soft-timeout", this),
- queryCollateralTime("querycollateraltime", {}, "Average time spent setting up and tearing down queries", this),
- queryLatency("querylatency", {}, "Average latency when matching a query", this)
-{ }
-
-LegacyDocumentDBMetrics::MatchingMetrics::~MatchingMetrics() {}
-
-LegacyDocumentDBMetrics::MatchingMetrics::RankProfileMetrics::RankProfileMetrics(
- const std::string &name, size_t numDocIdPartitions, MetricSet *parent)
- : MetricSet(name, {}, "Rank profile metrics", parent),
- queries("queries", {}, "Number of queries executed", this),
- limited_queries("limitedqueries", {}, "Number of queries limited in match phase", this),
- matchTime("match_time", {}, "Average time for matching a query", this),
- groupingTime("grouping_time", {}, "Average time spent on grouping", this),
- rerankTime("rerank_time", {}, "Average time spent on 2nd phase ranking", this)
-{
- for (size_t i=0; i < numDocIdPartitions; i++) {
- vespalib::string s(make_string("docid_part%02ld", i));
- partitions.push_back(DocIdPartition::UP(new DocIdPartition(s, this)));
- }
-}
-
-LegacyDocumentDBMetrics::MatchingMetrics::RankProfileMetrics::~RankProfileMetrics() {}
-
-LegacyDocumentDBMetrics::MatchingMetrics::RankProfileMetrics::DocIdPartition::DocIdPartition(const std::string &name, MetricSet *parent) :
- MetricSet(name, {}, "DocId Partition profile metrics", parent),
- docsMatched("docsmatched", {}, "Number of documents matched", this),
- docsRanked("docsranked", {}, "Number of documents ranked (first phase)", this),
- docsReRanked("docsreranked", {}, "Number of documents re-ranked (second phase)", this),
- active_time("activetime", {}, "Time spent doing actual work", this),
- wait_time("waittime", {}, "Time spent waiting for other external threads and resources", this)
-{ }
-
-LegacyDocumentDBMetrics::MatchingMetrics::RankProfileMetrics::DocIdPartition::~DocIdPartition() {}
-
-void
-LegacyDocumentDBMetrics::MatchingMetrics::RankProfileMetrics::DocIdPartition::update(const MatchingStats::Partition &stats)
-{
- docsMatched.inc(stats.docsMatched());
- docsRanked.inc(stats.docsRanked());
- docsReRanked.inc(stats.docsReRanked());
- active_time.addValueBatch(stats.active_time_avg(), stats.active_time_count(),
- stats.active_time_min(), stats.active_time_max());
- wait_time.addValueBatch(stats.wait_time_avg(), stats.wait_time_count(),
- stats.wait_time_min(), stats.wait_time_max());
-}
-
-void
-LegacyDocumentDBMetrics::MatchingMetrics::RankProfileMetrics::update(const MatchingStats &stats)
-{
- queries.inc(stats.queries());
- limited_queries.inc(stats.limited_queries());
- matchTime.addValueBatch(stats.matchTimeAvg(), stats.matchTimeCount(),
- stats.matchTimeMin(), stats.matchTimeMax());
- groupingTime.addValueBatch(stats.groupingTimeAvg(), stats.groupingTimeCount(),
- stats.groupingTimeMin(), stats.groupingTimeMax());
- rerankTime.addValueBatch(stats.rerankTimeAvg(), stats.rerankTimeCount(),
- stats.rerankTimeMin(), stats.rerankTimeMax());
- if (stats.getNumPartitions() > 0) {
- if (stats.getNumPartitions() <= partitions.size()) {
- for (size_t i(0), m(stats.getNumPartitions()); i < m; i++) {
- DocIdPartition & partition(*partitions[i]);
- const MatchingStats::Partition & s(stats.getPartition(i));
- partition.update(s);
- }
- } else {
- vespalib::string msg(make_string("Num partitions used '%ld' is larger than number of partitions '%ld' configured.",
- stats.getNumPartitions(), partitions.size()));
- throw vespalib::IllegalStateException(msg, VESPA_STRLOC);
- }
- }
-}
-
-LegacyDocumentDBMetrics::SubDBMetrics::DocumentMetaStoreMetrics::DocumentMetaStoreMetrics(MetricSet *parent)
- : MetricSet("docmetastore", {}, "Document meta store metrics", parent),
- lidLimit("lidlimit", {}, "The size of the allocated lid space", this),
- usedLids("usedlids", {}, "The number of lids used", this),
- lowestFreeLid("lowestfreelid", {}, "The lowest free lid", this),
- highestUsedLid("highestusedlid", {}, "The highest used lid", this),
- lidBloatFactor("lidbloatfactor", {}, "The bloat factor of this lid space, indicating the total amount of holes in the allocated lid space "
- "((lidlimit - usedlids) / lidlimit)", this),
- lidFragmentationFactor("lid_fragmentation_factor", {},
- "The fragmentation factor of this lid space, indicating the amount of holes in the currently used part of the lid space "
- "((highestusedlid - usedlids) / highestusedlid)", this)
-{
-}
-
-LegacyDocumentDBMetrics::SubDBMetrics::DocumentMetaStoreMetrics::~DocumentMetaStoreMetrics() {}
-
-LegacyDocumentDBMetrics::SubDBMetrics::SubDBMetrics(const vespalib::string &name, MetricSet *parent)
- : MetricSet(name, {}, "Sub database metrics", parent),
- attributes(this),
- docMetaStore(this)
-{ }
-
-LegacyDocumentDBMetrics::SubDBMetrics::~SubDBMetrics() {}
-
-LegacyDocumentDBMetrics::LegacyDocumentDBMetrics(const std::string &docTypeName, size_t maxNumThreads)
- : MetricSet(make_string("%s", docTypeName.c_str()), {}, "Document DB Metrics", 0),
- index(this),
- attributes(this),
- docstore(this),
- matching(this),
- executor("executor", this),
- indexExecutor("indexexecutor", this),
- summaryExecutor("summaryexecutor", this),
- sessionManager(this),
- ready("ready", this),
- notReady("notready", this),
- removed("removed", this),
- memoryUsage("memoryusage", {}, "Memory usage for this Document DB", this),
- numDocs("numdocs", {}, "Number of ready/indexed documents in this Document DB (aka number of documents in the 'ready' sub db)", this),
- numActiveDocs("numactivedocs", {}, "Number of active/searchable documents in this Document DB (aka number of active/searchable documents in the 'ready' sub db)", this),
- numIndexedDocs("numindexeddocs", {}, "Number of ready/indexed documents in this Document DB (aka number of documents in the 'ready' sub db)", this),
- numStoredDocs("numstoreddocs", {}, "Total number of documents stored in this Document DB (aka number of documents in the 'ready' and 'notready' sub dbs)", this),
- numRemovedDocs("numremoveddocs", {}, "Number of removed documents in this Document DB (aka number of documents in the 'removed' sub db)", this),
- numBadConfigs("numBadConfigs", {}, "Number of bad configs for this Document DB", this),
- _maxNumThreads(maxNumThreads)
-{
- memoryUsage.addMetricToSum(index.memoryUsage);
- memoryUsage.addMetricToSum(attributes.memoryUsage);
- memoryUsage.addMetricToSum(docstore.memoryUsage);
-}
-
-LegacyDocumentDBMetrics::~LegacyDocumentDBMetrics() { }
-
-} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/legacy_documentdb_metrics.h b/searchcore/src/vespa/searchcore/proton/metrics/legacy_documentdb_metrics.h
deleted file mode 100644
index c61d371ae0b..00000000000
--- a/searchcore/src/vespa/searchcore/proton/metrics/legacy_documentdb_metrics.h
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#pragma once
-
-#include "executor_metrics.h"
-#include "legacy_attribute_metrics.h"
-#include "legacy_sessionmanager_metrics.h"
-#include <vespa/metrics/summetric.h>
-#include <vespa/searchcore/proton/matching/matching_stats.h>
-
-namespace proton {
-
-/**
- * Metric set for all legacy metrics reported for a document db.
- *
- * All these metrics have the document type name as part of the metric name,
- * which is not flexible for setting up default metric graph dashboards.
- *
- * TODO: Remove on Vespa 7
- *
- * @deprecated Use DocumentDBTaggedMetrics for all new metrics.
- */
-struct LegacyDocumentDBMetrics : metrics::MetricSet
-{
- struct IndexMetrics : metrics::MetricSet {
- metrics::LongValueMetric memoryUsage;
- metrics::LongValueMetric docsInMemory;
- metrics::LongValueMetric diskUsage;
-
- IndexMetrics(metrics::MetricSet *parent);
- ~IndexMetrics();
- };
-
- struct DocstoreMetrics : metrics::MetricSet {
- metrics::LongValueMetric memoryUsage;
- metrics::LongCountMetric cacheLookups;
- metrics::LongAverageMetric cacheHitRate;
- metrics::LongValueMetric cacheElements;
- metrics::LongValueMetric cacheMemoryUsed;
-
- DocstoreMetrics(metrics::MetricSet *parent);
- ~DocstoreMetrics();
- };
-
- struct MatchingMetrics : metrics::MetricSet {
- metrics::LongCountMetric docsMatched;
- metrics::LongCountMetric docsRanked;
- metrics::LongCountMetric docsReRanked;
- metrics::LongCountMetric queries;
- metrics::DoubleValueMetric softDoomFactor;
- metrics::DoubleAverageMetric queryCollateralTime;
- metrics::DoubleAverageMetric queryLatency;
-
- struct RankProfileMetrics : metrics::MetricSet {
- struct DocIdPartition : metrics::MetricSet {
- metrics::LongCountMetric docsMatched;
- metrics::LongCountMetric docsRanked;
- metrics::LongCountMetric docsReRanked;
- metrics::DoubleAverageMetric active_time;
- metrics::DoubleAverageMetric wait_time;
-
- using UP = std::unique_ptr<DocIdPartition>;
- DocIdPartition(const std::string &name, metrics::MetricSet *parent);
- ~DocIdPartition();
- void update(const matching::MatchingStats::Partition &stats);
- };
- using DocIdPartitions = std::vector<DocIdPartition::UP>;
- using UP = std::unique_ptr<RankProfileMetrics>;
-
- metrics::LongCountMetric queries;
- metrics::LongCountMetric limited_queries;
- metrics::DoubleAverageMetric matchTime;
- metrics::DoubleAverageMetric groupingTime;
- metrics::DoubleAverageMetric rerankTime;
- DocIdPartitions partitions;
-
- RankProfileMetrics(const std::string &name,
- size_t numDocIdPartitions,
- metrics::MetricSet *parent);
- ~RankProfileMetrics();
- void update(const matching::MatchingStats &stats);
-
- };
- using RankProfileMap = std::map<std::string, RankProfileMetrics::UP>;
- RankProfileMap rank_profiles;
-
- void update(const matching::MatchingStats &stats);
- MatchingMetrics(metrics::MetricSet *parent);
- ~MatchingMetrics();
- };
-
- struct SubDBMetrics : metrics::MetricSet
- {
- struct DocumentMetaStoreMetrics : metrics::MetricSet
- {
- metrics::LongValueMetric lidLimit;
- metrics::LongValueMetric usedLids;
- metrics::LongValueMetric lowestFreeLid;
- metrics::LongValueMetric highestUsedLid;
- metrics::DoubleValueMetric lidBloatFactor;
- metrics::DoubleValueMetric lidFragmentationFactor;
-
- DocumentMetaStoreMetrics(metrics::MetricSet *parent);
- ~DocumentMetaStoreMetrics();
- };
-
- LegacyAttributeMetrics attributes;
- DocumentMetaStoreMetrics docMetaStore;
- SubDBMetrics(const vespalib::string &name, metrics::MetricSet *parent);
- ~SubDBMetrics();
- };
-
- IndexMetrics index;
- LegacyAttributeMetrics attributes;
- DocstoreMetrics docstore;
- MatchingMetrics matching;
- ExecutorMetrics executor;
- ExecutorMetrics indexExecutor;
- ExecutorMetrics summaryExecutor;
- LegacySessionManagerMetrics sessionManager;
- SubDBMetrics ready;
- SubDBMetrics notReady;
- SubDBMetrics removed;
- metrics::SumMetric<metrics::LongValueMetric> memoryUsage;
- metrics::LongValueMetric numDocs;
- metrics::LongValueMetric numActiveDocs;
- metrics::LongValueMetric numIndexedDocs;
- metrics::LongValueMetric numStoredDocs;
- metrics::LongValueMetric numRemovedDocs;
- metrics::LongValueMetric numBadConfigs;
- size_t _maxNumThreads;
-
- LegacyDocumentDBMetrics(const std::string &docTypeName, size_t maxNumThreads);
- ~LegacyDocumentDBMetrics();
-};
-
-} // namespace proton
-
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/legacy_proton_metrics.cpp b/searchcore/src/vespa/searchcore/proton/metrics/legacy_proton_metrics.cpp
deleted file mode 100644
index 5c0285967e9..00000000000
--- a/searchcore/src/vespa/searchcore/proton/metrics/legacy_proton_metrics.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include "legacy_proton_metrics.h"
-
-namespace proton {
-
-LegacyProtonMetrics::DocumentTypeMetrics::DocumentTypeMetrics(metrics::MetricSet *parent)
- : metrics::MetricSet("doctypes", {}, "Metrics per document type", parent)
-{
-}
-
-LegacyProtonMetrics::DocumentTypeMetrics::~DocumentTypeMetrics() { }
-
-LegacyProtonMetrics::LegacyProtonMetrics()
- : metrics::MetricSet("proton", {}, "Search engine metrics", 0),
- docTypes(this),
- executor("executor", this),
- flushExecutor("flushexecutor", this),
- matchExecutor("matchexecutor", this),
- summaryExecutor("summaryexecutor", this),
- memoryUsage("memoryusage", {{"logdefault"}}, "Total tracked memory usage", this),
- diskUsage("diskusage", {{"logdefault"}}, "Total tracked disk usage for disk indexes", this),
- docsInMemory("docsinmemory", {{"logdefault"}}, "Total Number of documents in memory", this),
- numDocs("numdocs", {{"logdefault"}}, "Total number of ready/indexed documents among all document dbs (equal as numindexeddocs)", this),
- numActiveDocs("numactivedocs", {{"logdefault"}},
- "Total number of active/searchable documents among all document dbs", this),
- numIndexedDocs("numindexeddocs", {{"logdefault"}},
- "Total number of ready/indexed documents among all document dbs (equal as numdocs)", this),
- numStoredDocs("numstoreddocs", {{"logdefault"}},
- "Total number of stored documents among all document dbs", this),
- numRemovedDocs("numremoveddocs", {{"logdefault"}},
- "Total number of removed documents among all document dbs", this)
-{
- // supply start value to support sum without any document types
- metrics::LongValueMetric start("start", {}, "", 0);
- memoryUsage.setStartValue(start);
- diskUsage.setStartValue(start);
- docsInMemory.setStartValue(start);
- numDocs.setStartValue(start);
- numActiveDocs.setStartValue(start);
- numIndexedDocs.setStartValue(start);
- numStoredDocs.setStartValue(start);
- numRemovedDocs.setStartValue(start);
-}
-
-LegacyProtonMetrics::~LegacyProtonMetrics() {}
-
-} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/legacy_proton_metrics.h b/searchcore/src/vespa/searchcore/proton/metrics/legacy_proton_metrics.h
deleted file mode 100644
index 03b73761ce5..00000000000
--- a/searchcore/src/vespa/searchcore/proton/metrics/legacy_proton_metrics.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#pragma once
-
-#include <vespa/metrics/metrics.h>
-#include "executor_metrics.h"
-
-namespace proton {
-
-/**
- * Metric set for all legacy metrics reported by proton.
- *
- * @deprecated Use ContentProtonMetrics for all new metrics.
- */
-struct LegacyProtonMetrics : metrics::MetricSet
-{
- struct DocumentTypeMetrics : metrics::MetricSet {
- // documentdb metrics will be wired in here (by the metrics engine)
- DocumentTypeMetrics(metrics::MetricSet *parent);
- ~DocumentTypeMetrics();
- };
-
- DocumentTypeMetrics docTypes;
- ExecutorMetrics executor;
- ExecutorMetrics flushExecutor;
- ExecutorMetrics matchExecutor;
- ExecutorMetrics summaryExecutor;
- metrics::SumMetric<metrics::LongValueMetric> memoryUsage;
- metrics::SumMetric<metrics::LongValueMetric> diskUsage;
- metrics::SumMetric<metrics::LongValueMetric> docsInMemory;
- metrics::SumMetric<metrics::LongValueMetric> numDocs;
- metrics::SumMetric<metrics::LongValueMetric> numActiveDocs;
- metrics::SumMetric<metrics::LongValueMetric> numIndexedDocs;
- metrics::SumMetric<metrics::LongValueMetric> numStoredDocs;
- metrics::SumMetric<metrics::LongValueMetric> numRemovedDocs;
- // transport metrics will be wired in here
-
- LegacyProtonMetrics();
- ~LegacyProtonMetrics();
-};
-
-} // namespace proton
-
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/legacy_sessionmanager_metrics.cpp b/searchcore/src/vespa/searchcore/proton/metrics/legacy_sessionmanager_metrics.cpp
deleted file mode 100644
index 6d780739848..00000000000
--- a/searchcore/src/vespa/searchcore/proton/metrics/legacy_sessionmanager_metrics.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include "legacy_sessionmanager_metrics.h"
-
-namespace proton {
-
-LegacySessionManagerMetrics::LegacySessionManagerMetrics(metrics::MetricSet *parent)
- : metrics::MetricSet("sessionmanager", {}, "Grouping session manager metrics", parent),
- numInsert("numinsert", {}, "Number of inserted sessions", this),
- numPick("numpick", {}, "Number if picked sessions", this),
- numDropped("numdropped", {}, "Number of dropped cached sessions", this),
- numCached("numcached", {}, "Number of currently cached sessions", this),
- numTimedout("numtimedout", {}, "Number of timed out sessions", this)
-{
-}
-
-LegacySessionManagerMetrics::~LegacySessionManagerMetrics() = default;
-
-void
-LegacySessionManagerMetrics::update(const proton::matching::SessionManager::Stats &stats)
-{
- numInsert.inc(stats.numInsert);
- numPick.inc(stats.numPick);
- numDropped.inc(stats.numDropped);
- numCached.set(stats.numCached);
- numTimedout.inc(stats.numTimedout);
-}
-
-}
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/legacy_sessionmanager_metrics.h b/searchcore/src/vespa/searchcore/proton/metrics/legacy_sessionmanager_metrics.h
deleted file mode 100644
index 3e8e3f54c02..00000000000
--- a/searchcore/src/vespa/searchcore/proton/metrics/legacy_sessionmanager_metrics.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#pragma once
-
-#include <vespa/metrics/countmetric.h>
-#include <vespa/metrics/metricset.h>
-#include <vespa/metrics/valuemetric.h>
-#include <vespa/searchcore/proton/matching/sessionmanager.h>
-
-namespace proton {
-
-/**
- * Legacy metrics for session manager cache.
- * TODO: Remove on Vespa 7
- */
-struct LegacySessionManagerMetrics : metrics::MetricSet
-{
- metrics::LongCountMetric numInsert;
- metrics::LongCountMetric numPick;
- metrics::LongCountMetric numDropped;
- metrics::LongValueMetric numCached;
- metrics::LongCountMetric numTimedout;
-
- void update(const proton::matching::SessionManager::Stats &stats);
- LegacySessionManagerMetrics(metrics::MetricSet *parent);
- ~LegacySessionManagerMetrics();
-};
-
-}
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.cpp b/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.cpp
index 3073b5df3c9..a9fdbf90b43 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.cpp
+++ b/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.cpp
@@ -13,7 +13,6 @@ namespace proton {
MetricsEngine::MetricsEngine()
: _root(),
- _legacyRoot(),
_manager(std::make_unique<metrics::MetricManager>()),
_metrics_producer(*_manager)
{ }
@@ -26,7 +25,6 @@ MetricsEngine::start(const config::ConfigUri &)
{
metrics::MetricLockGuard guard(_manager->getMetricLock());
_manager->registerMetric(guard, _root);
- _manager->registerMetric(guard, _legacyRoot);
}
// Storage doesnt snapshot unset metrics to save memory. Currently
@@ -56,62 +54,20 @@ void
MetricsEngine::addExternalMetrics(metrics::Metric &child)
{
metrics::MetricLockGuard guard(_manager->getMetricLock());
- _legacyRoot.registerMetric(child);
+ _root.registerMetric(child);
}
void
MetricsEngine::removeExternalMetrics(metrics::Metric &child)
{
metrics::MetricLockGuard guard(_manager->getMetricLock());
- _legacyRoot.unregisterMetric(child);
-}
-
-namespace {
-
-void
-addLegacyDocumentDBMetrics(LegacyProtonMetrics &legacyRoot,
- LegacyDocumentDBMetrics &metrics)
-{
- legacyRoot.docTypes.registerMetric(metrics);
- // cannot use sum of sum due to metric clone issues
- legacyRoot.memoryUsage.addMetricToSum(metrics.index.memoryUsage);
- legacyRoot.memoryUsage.addMetricToSum(metrics.attributes.memoryUsage);
- legacyRoot.memoryUsage.addMetricToSum(metrics.docstore.memoryUsage);
- legacyRoot.diskUsage.addMetricToSum(metrics.index.diskUsage);
- legacyRoot.docsInMemory.addMetricToSum(metrics.index.docsInMemory);
- legacyRoot.numDocs.addMetricToSum(metrics.numDocs);
- legacyRoot.numActiveDocs.addMetricToSum(metrics.numActiveDocs);
- legacyRoot.numIndexedDocs.addMetricToSum(metrics.numIndexedDocs);
- legacyRoot.numStoredDocs.addMetricToSum(metrics.numStoredDocs);
- legacyRoot.numRemovedDocs.addMetricToSum(metrics.numRemovedDocs);
-}
-
-void
-removeLegacyDocumentDBMetrics(LegacyProtonMetrics &legacyRoot,
- LegacyDocumentDBMetrics &metrics)
-{
- legacyRoot.docTypes.unregisterMetric(metrics);
- // cannot use sum of sum due to metric clone issues
- legacyRoot.memoryUsage.removeMetricFromSum(metrics.index.memoryUsage);
- legacyRoot.memoryUsage.removeMetricFromSum(metrics.attributes.memoryUsage);
- legacyRoot.memoryUsage.removeMetricFromSum(metrics.docstore.memoryUsage);
- legacyRoot.diskUsage.removeMetricFromSum(metrics.index.diskUsage);
- legacyRoot.docsInMemory.removeMetricFromSum(metrics.index.docsInMemory);
- legacyRoot.numDocs.removeMetricFromSum(metrics.numDocs);
- legacyRoot.numActiveDocs.removeMetricFromSum(metrics.numActiveDocs);
- legacyRoot.numIndexedDocs.removeMetricFromSum(metrics.numIndexedDocs);
- legacyRoot.numStoredDocs.removeMetricFromSum(metrics.numStoredDocs);
- legacyRoot.numRemovedDocs.removeMetricFromSum(metrics.numRemovedDocs);
-}
-
+ _root.unregisterMetric(child);
}
void
MetricsEngine::addDocumentDBMetrics(DocumentDBMetricsCollection &child)
{
metrics::MetricLockGuard guard(_manager->getMetricLock());
- addLegacyDocumentDBMetrics(_legacyRoot, child.getLegacyMetrics());
-
_root.registerMetric(child.getTaggedMetrics());
}
@@ -119,51 +75,12 @@ void
MetricsEngine::removeDocumentDBMetrics(DocumentDBMetricsCollection &child)
{
metrics::MetricLockGuard guard(_manager->getMetricLock());
- removeLegacyDocumentDBMetrics(_legacyRoot, child.getLegacyMetrics());
-
_root.unregisterMetric(child.getTaggedMetrics());
}
namespace {
void
-doAddAttribute(LegacyAttributeMetrics &attributes,
- const std::string &name)
-{
- LegacyAttributeMetrics::List::Entry *entry = attributes.list.add(name);
- if (entry != nullptr) {
- LOG(debug, "doAddAttribute(): name='%s', attributes=%p",
- name.c_str(), (void*)&attributes);
- attributes.list.registerMetric(*entry);
- } else {
- LOG(warning, "multiple attributes have the same name: '%s'", name.c_str());
- }
-}
-
-void
-doRemoveAttribute(LegacyAttributeMetrics &attributes,
- const std::string &name)
-{
- LegacyAttributeMetrics::List::Entry::UP entry = attributes.list.remove(name);
- if (entry.get() != 0) {
- LOG(debug, "doRemoveAttribute(): name='%s', attributes=%p",
- name.c_str(), (void*)&attributes);
- attributes.list.unregisterMetric(*entry);
- } else {
- LOG(debug, "Could not remove attribute with name '%s', not found", name.c_str());
- }
-}
-
-void
-doCleanAttributes(LegacyAttributeMetrics &attributes)
-{
- std::vector<LegacyAttributeMetrics::List::Entry::UP> entries = attributes.list.release();
- for (size_t i = 0; i < entries.size(); ++i) {
- attributes.list.unregisterMetric(*entries[i]);
- }
-}
-
-void
doAddAttribute(AttributeMetrics &attributes, const std::string &attrName)
{
auto entry = attributes.add(attrName);
@@ -198,40 +115,25 @@ doCleanAttributes(AttributeMetrics &attributes)
void
MetricsEngine::addAttribute(const AttributeMetricsCollection &subAttributes,
- LegacyAttributeMetrics *totalAttributes,
const std::string &name)
{
metrics::MetricLockGuard guard(_manager->getMetricLock());
doAddAttribute(subAttributes.getMetrics(), name);
- doAddAttribute(subAttributes.getLegacyMetrics(), name);
- if (totalAttributes != NULL) {
- doAddAttribute(*totalAttributes, name);
- }
}
void
MetricsEngine::removeAttribute(const AttributeMetricsCollection &subAttributes,
- LegacyAttributeMetrics *totalAttributes,
const std::string &name)
{
metrics::MetricLockGuard guard(_manager->getMetricLock());
doRemoveAttribute(subAttributes.getMetrics(), name);
- doRemoveAttribute(subAttributes.getLegacyMetrics(), name);
- if (totalAttributes != NULL) {
- doRemoveAttribute(*totalAttributes, name);
- }
}
void
-MetricsEngine::cleanAttributes(const AttributeMetricsCollection &subAttributes,
- LegacyAttributeMetrics *totalAttributes)
+MetricsEngine::cleanAttributes(const AttributeMetricsCollection &subAttributes)
{
metrics::MetricLockGuard guard(_manager->getMetricLock());
doCleanAttributes(subAttributes.getMetrics());
- doCleanAttributes(subAttributes.getLegacyMetrics());
- if (totalAttributes != NULL) {
- doCleanAttributes(*totalAttributes);
- }
}
namespace {
@@ -263,18 +165,17 @@ cleanRankProfilesIn(MatchingMetricsType &matchingMetrics)
}
void
-MetricsEngine::addRankProfile(DocumentDBMetricsCollection &owner, const std::string &name, size_t numDocIdPartitions) {
+MetricsEngine::addRankProfile(DocumentDBMetricsCollection &owner, const std::string &name, size_t numDocIdPartitions)
+{
metrics::MetricLockGuard guard(_manager->getMetricLock());
- size_t adjustedNumDocIdPartitions = std::min(numDocIdPartitions, owner.getLegacyMetrics()._maxNumThreads);
+ size_t adjustedNumDocIdPartitions = std::min(numDocIdPartitions, owner.maxNumThreads());
addRankProfileTo(owner.getTaggedMetrics().matching, name, adjustedNumDocIdPartitions);
- addRankProfileTo(owner.getLegacyMetrics().matching, name, adjustedNumDocIdPartitions);
}
void
MetricsEngine::cleanRankProfiles(DocumentDBMetricsCollection &owner) {
metrics::MetricLockGuard guard(_manager->getMetricLock());
cleanRankProfilesIn(owner.getTaggedMetrics().matching);
- cleanRankProfilesIn(owner.getLegacyMetrics().matching);
}
void
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.h b/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.h
index 44be43c11b3..ec42e0c56c7 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.h
+++ b/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.h
@@ -3,7 +3,6 @@
#pragma once
#include "content_proton_metrics.h"
-#include "legacy_proton_metrics.h"
#include "metricswireservice.h"
#include <vespa/metrics/state_api_adapter.h>
@@ -23,7 +22,6 @@ class MetricsEngine : public MetricsWireService
{
private:
ContentProtonMetrics _root;
- LegacyProtonMetrics _legacyRoot;
std::unique_ptr<metrics::MetricManager> _manager;
metrics::StateApiAdapter _metrics_producer;
@@ -33,7 +31,6 @@ public:
MetricsEngine();
virtual ~MetricsEngine();
ContentProtonMetrics &root() { return _root; }
- LegacyProtonMetrics &legacyRoot() { return _legacyRoot; }
void start(const config::ConfigUri & configUri);
void addMetricsHook(metrics::UpdateHook &hook);
void removeMetricsHook(metrics::UpdateHook &hook);
@@ -42,13 +39,10 @@ public:
void addDocumentDBMetrics(DocumentDBMetricsCollection &child);
void removeDocumentDBMetrics(DocumentDBMetricsCollection &child);
void addAttribute(const AttributeMetricsCollection &subAttributes,
- LegacyAttributeMetrics *totalAttributes,
const std::string &name) override;
void removeAttribute(const AttributeMetricsCollection &subAttributes,
- LegacyAttributeMetrics *totalAttributes,
const std::string &name) override;
- void cleanAttributes(const AttributeMetricsCollection &subAttributes,
- LegacyAttributeMetrics *totalAttributes) override;
+ void cleanAttributes(const AttributeMetricsCollection &subAttributes) override;
void addRankProfile(DocumentDBMetricsCollection &owner, const std::string &name, size_t numDocIdPartitions) override;
void cleanRankProfiles(DocumentDBMetricsCollection &owner) override;
void stop();
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/metricswireservice.h b/searchcore/src/vespa/searchcore/proton/metrics/metricswireservice.h
index faa172544f7..ca3b2e7bdbc 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/metricswireservice.h
+++ b/searchcore/src/vespa/searchcore/proton/metrics/metricswireservice.h
@@ -11,13 +11,10 @@ class LegacyAttributeMetrics;
struct MetricsWireService {
virtual void addAttribute(const AttributeMetricsCollection &subAttributes,
- LegacyAttributeMetrics *totalAttributes,
const std::string &name) = 0;
virtual void removeAttribute(const AttributeMetricsCollection &subAttributes,
- LegacyAttributeMetrics *totalAttributes,
const std::string &name) = 0;
- virtual void cleanAttributes(const AttributeMetricsCollection &subAttributes,
- LegacyAttributeMetrics *totalAttributes) = 0;
+ virtual void cleanAttributes(const AttributeMetricsCollection &subAttributes) = 0;
virtual void addRankProfile(DocumentDBMetricsCollection &owner,
const std::string &name,
size_t numDocIdPartitions) = 0;
@@ -26,12 +23,12 @@ struct MetricsWireService {
};
struct DummyWireService : public MetricsWireService {
- virtual void addAttribute(const AttributeMetricsCollection &, LegacyAttributeMetrics *, const std::string &) override {}
- virtual void removeAttribute(const AttributeMetricsCollection &, LegacyAttributeMetrics *, const std::string &) override {}
- virtual void cleanAttributes(const AttributeMetricsCollection &, LegacyAttributeMetrics *) override {}
+ virtual void addAttribute(const AttributeMetricsCollection &, const std::string &) override {}
+ virtual void removeAttribute(const AttributeMetricsCollection &, const std::string &) override {}
+ virtual void cleanAttributes(const AttributeMetricsCollection &) override {}
virtual void addRankProfile(DocumentDBMetricsCollection &, const std::string &, size_t) override {}
virtual void cleanRankProfiles(DocumentDBMetricsCollection &) override {}
};
-} // namespace proton
+}
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
index 0f6f4fdda11..4540a864eac 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
@@ -548,11 +548,10 @@ DocumentDB::close()
// The attributes in the ready sub db is also the total set of attributes.
DocumentDBTaggedMetrics &metrics = getMetricsCollection().getTaggedMetrics();
- LegacyDocumentDBMetrics &legacyMetrics = getMetricsCollection().getLegacyMetrics();
- AttributeMetricsCollection ready(metrics.ready.attributes, legacyMetrics.ready.attributes);
- AttributeMetricsCollection notReady(metrics.notReady.attributes, legacyMetrics.notReady.attributes);
- _metricsWireService.cleanAttributes(ready, &legacyMetrics.attributes);
- _metricsWireService.cleanAttributes(notReady, nullptr);
+ AttributeMetricsCollection ready(metrics.ready.attributes);
+ AttributeMetricsCollection notReady(metrics.notReady.attributes);
+ _metricsWireService.cleanAttributes(ready);
+ _metricsWireService.cleanAttributes(notReady);
_writeService.sync();
masterExecute([this] () { closeSubDBs(); } );
_writeService.sync();
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp
index 71baabd9d6f..88220f7aaf0 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp
@@ -77,11 +77,6 @@ updateIndexMetrics(DocumentDBMetricsCollection &metrics, const search::Searchabl
updateDiskUsageMetric(indexMetrics.diskUsage, stats.sizeOnDisk(), totalStats);
updateMemoryUsageMetrics(indexMetrics.memoryUsage, stats.memoryUsage(), totalStats);
indexMetrics.docsInMemory.set(stats.docsInMemory());
-
- LegacyDocumentDBMetrics::IndexMetrics &legacyIndexMetrics = metrics.getLegacyMetrics().index;
- legacyIndexMetrics.memoryUsage.set(stats.memoryUsage().allocatedBytes());
- legacyIndexMetrics.docsInMemory.set(stats.docsInMemory());
- legacyIndexMetrics.diskUsage.set(stats.sizeOnDisk());
}
struct TempAttributeMetric
@@ -153,22 +148,6 @@ fillTempAttributeMetrics(TempAttributeMetrics &totalMetrics,
}
void
-updateLegacyAttributeMetrics(LegacyAttributeMetrics &metrics, const TempAttributeMetrics &tmpMetrics)
-{
- for (const auto &attr : tmpMetrics.attrs) {
- LegacyAttributeMetrics::List::Entry *entry = metrics.list.get(attr.first);
- if (entry) {
- entry->memoryUsage.set(attr.second.memoryUsage.allocatedBytes());
- entry->bitVectors.set(attr.second.bitVectors);
- } else {
- LOG(debug, "Could not update metrics for attribute: '%s'", attr.first.c_str());
- }
- }
- metrics.memoryUsage.set(tmpMetrics.total.memoryUsage.allocatedBytes());
- metrics.bitVectors.set(tmpMetrics.total.bitVectors);
-}
-
-void
updateAttributeMetrics(AttributeMetrics &metrics, const TempAttributeMetrics &tmpMetrics)
{
for (const auto &attr : tmpMetrics.attrs) {
@@ -187,38 +166,22 @@ updateAttributeMetrics(DocumentDBMetricsCollection &metrics, const DocumentSubDB
TempAttributeMetrics notReadyMetrics;
fillTempAttributeMetrics(totalMetrics, readyMetrics, notReadyMetrics, subDbs);
- updateLegacyAttributeMetrics(metrics.getLegacyMetrics().attributes, totalMetrics);
- updateLegacyAttributeMetrics(metrics.getLegacyMetrics().ready.attributes, readyMetrics);
- updateLegacyAttributeMetrics(metrics.getLegacyMetrics().notReady.attributes, notReadyMetrics);
-
updateAttributeMetrics(metrics.getTaggedMetrics().ready.attributes, readyMetrics);
updateAttributeMetrics(metrics.getTaggedMetrics().notReady.attributes, notReadyMetrics);
updateMemoryUsageMetrics(metrics.getTaggedMetrics().attribute.totalMemoryUsage, totalMetrics.total.memoryUsage, totalStats);
}
void
-updateLegacyRankProfileMetrics(LegacyDocumentDBMetrics::MatchingMetrics &matchingMetrics,
- const vespalib::string &rankProfileName,
- const MatchingStats &stats)
-{
- auto itr = matchingMetrics.rank_profiles.find(rankProfileName);
- assert(itr != matchingMetrics.rank_profiles.end());
- itr->second->update(stats);
-}
-
-void
updateMatchingMetrics(DocumentDBMetricsCollection &metrics, const IDocumentSubDB &ready)
{
MatchingStats totalStats;
for (const auto &rankProfile : metrics.getTaggedMetrics().matching.rank_profiles) {
MatchingStats matchingStats = ready.getMatcherStats(rankProfile.first);
rankProfile.second->update(matchingStats);
- updateLegacyRankProfileMetrics(metrics.getLegacyMetrics().matching, rankProfile.first, matchingStats);
totalStats.add(matchingStats);
}
metrics.getTaggedMetrics().matching.update(totalStats);
- metrics.getLegacyMetrics().matching.update(totalStats);
}
void
@@ -229,7 +192,6 @@ updateSessionCacheMetrics(DocumentDBMetricsCollection &metrics, proton::matching
auto groupingStats = sessionManager.getGroupingStats();
metrics.getTaggedMetrics().sessionCache.grouping.update(groupingStats);
- metrics.getLegacyMetrics().sessionManager.update(groupingStats);
}
void
@@ -246,13 +208,6 @@ updateDocumentsMetrics(DocumentDBMetricsCollection &metrics, const DocumentSubDB
docsMetrics.ready.set(ready);
docsMetrics.total.set(total);
docsMetrics.removed.set(removed);
-
- auto &legacyMetrics = metrics.getLegacyMetrics();
- legacyMetrics.numDocs.set(ready);
- legacyMetrics.numActiveDocs.set(active);
- legacyMetrics.numIndexedDocs.set(ready);
- legacyMetrics.numStoredDocs.set(total);
- legacyMetrics.numRemovedDocs.set(removed);
}
void
@@ -283,28 +238,6 @@ updateCountMetric(uint64_t currVal, uint64_t lastVal, metrics::LongCountMetric &
}
void
-updateLegacyDocstoreMetrics(LegacyDocumentDBMetrics::DocstoreMetrics &metrics,
- const DocumentSubDBCollection &sub_dbs,
- CacheStats &lastCacheStats)
-{
- size_t memoryUsage = 0;
- CacheStats cache_stats;
- for (const auto subDb : sub_dbs) {
- const ISummaryManager::SP &summaryMgr = subDb->getSummaryManager();
- if (summaryMgr) {
- cache_stats += summaryMgr->getBackingStore().getCacheStats();
- memoryUsage += summaryMgr->getBackingStore().memoryUsed();
- }
- }
- metrics.memoryUsage.set(memoryUsage);
- updateCountMetric(cache_stats.lookups(), lastCacheStats.lookups(), metrics.cacheLookups);
- updateDocumentStoreCacheHitRate(cache_stats, lastCacheStats, metrics.cacheHitRate);
- metrics.cacheElements.set(cache_stats.elements);
- metrics.cacheMemoryUsed.set(cache_stats.memory_used);
- lastCacheStats = cache_stats;
-}
-
-void
updateDocumentStoreMetrics(DocumentDBTaggedMetrics::SubDBMetrics::DocumentStoreMetrics &metrics,
const IDocumentSubDB *subDb,
CacheStats &lastCacheStats,
@@ -357,7 +290,6 @@ DocumentDBMetricsUpdater::updateMetrics(DocumentDBMetricsCollection &metrics)
{
TotalStats totalStats;
ExecutorThreadingServiceStats threadingServiceStats = _writeService.getStats();
- updateLegacyMetrics(metrics.getLegacyMetrics(), threadingServiceStats);
updateIndexMetrics(metrics, _subDBs.getReadySubDB()->getSearchableStats(), totalStats);
updateAttributeMetrics(metrics, _subDBs, totalStats);
updateMatchingMetrics(metrics, *_subDBs.getReadySubDB());
@@ -371,22 +303,6 @@ DocumentDBMetricsUpdater::updateMetrics(DocumentDBMetricsCollection &metrics)
}
void
-DocumentDBMetricsUpdater::updateLegacyMetrics(LegacyDocumentDBMetrics &metrics, const ExecutorThreadingServiceStats &threadingServiceStats)
-{
- metrics.executor.update(threadingServiceStats.getMasterExecutorStats());
- metrics.summaryExecutor.update(threadingServiceStats.getSummaryExecutorStats());
- metrics.indexExecutor.update(threadingServiceStats.getIndexExecutorStats());
- updateLegacyDocstoreMetrics(metrics.docstore, _subDBs, _lastDocStoreCacheStats.total);
-
- DocumentMetaStoreReadGuards dmss(_subDBs);
- updateLidSpaceMetrics(metrics.ready.docMetaStore, dmss.readydms->get());
- updateLidSpaceMetrics(metrics.notReady.docMetaStore, dmss.notreadydms->get());
- updateLidSpaceMetrics(metrics.removed.docMetaStore, dmss.remdms->get());
-
- metrics.numBadConfigs.set(_state.getDelayedConfig() ? 1u : 0u);
-}
-
-void
DocumentDBMetricsUpdater::updateAttributeResourceUsageMetrics(DocumentDBTaggedMetrics::AttributeMetrics &metrics)
{
AttributeUsageStats attributeUsageStats = _writeFilter.getAttributeUsageStats();
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.h b/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.h
index e0042207060..2cf9e97e190 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.h
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.h
@@ -24,11 +24,10 @@ class DocumentDBMetricsUpdater {
public:
struct DocumentStoreCacheStats {
- search::CacheStats total;
search::CacheStats readySubDb;
search::CacheStats notReadySubDb;
search::CacheStats removedSubDb;
- DocumentStoreCacheStats() : total(), readySubDb(), notReadySubDb(), removedSubDb() {}
+ DocumentStoreCacheStats() : readySubDb(), notReadySubDb(), removedSubDb() {}
};
private:
@@ -41,7 +40,6 @@ private:
// Last updated document store cache statistics. Necessary due to metrics implementation is upside down.
DocumentStoreCacheStats _lastDocStoreCacheStats;
- void updateLegacyMetrics(LegacyDocumentDBMetrics &metrics, const ExecutorThreadingServiceStats &threadingServiceStats);
void updateMiscMetrics(DocumentDBTaggedMetrics &metrics, const ExecutorThreadingServiceStats &threadingServiceStats);
void updateAttributeResourceUsageMetrics(DocumentDBTaggedMetrics::AttributeMetrics &metrics);
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
index 78f49599322..037abf4a85d 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
@@ -76,13 +76,11 @@ DocumentSubDBCollection::DocumentSubDBCollection(
cfg.getNumSearchThreads()),
SearchableDocSubDB::Context(FastAccessDocSubDB::Context
(context,
- AttributeMetricsCollection(metrics.getTaggedMetrics().ready.attributes,
- metrics.getLegacyMetrics().ready.attributes),
- &metrics.getLegacyMetrics().attributes,
- metricsWireService),
- queryLimiter,
- clock,
- warmupExecutor)));
+ AttributeMetricsCollection(metrics.getTaggedMetrics().ready.attributes),
+ metricsWireService),
+ queryLimiter,
+ clock,
+ warmupExecutor)));
_subDBs.push_back
(new StoreOnlyDocSubDB(StoreOnlyDocSubDB::Config(docTypeName,
"1.removed",
@@ -105,9 +103,7 @@ DocumentSubDBCollection::DocumentSubDBCollection(
true,
true),
FastAccessDocSubDB::Context(context,
- AttributeMetricsCollection(metrics.getTaggedMetrics().notReady.attributes,
- metrics.getLegacyMetrics().notReady.attributes),
- nullptr,
+ AttributeMetricsCollection(metrics.getTaggedMetrics().notReady.attributes),
metricsWireService)));
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp
index bf83c889f27..531873fcd19 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp
@@ -13,7 +13,7 @@
#include <vespa/searchcore/proton/attribute/attribute_populator.h>
#include <vespa/searchcore/proton/attribute/filter_attribute_manager.h>
#include <vespa/searchcore/proton/attribute/sequential_attributes_initializer.h>
-#include <vespa/searchcore/proton/metrics/legacy_documentdb_metrics.h>
+#include <vespa/searchcore/proton/matching/sessionmanager.h>
#include <vespa/searchcore/proton/reprocessing/attribute_reprocessing_initializer.h>
#include <vespa/searchcore/proton/reprocessing/document_reprocessing_handler.h>
#include <vespa/searchcore/proton/reprocessing/reprocess_documents_task.h>
@@ -94,8 +94,7 @@ FastAccessDocSubDB::setupAttributeManager(AttributeManager::SP attrMgrResult)
attrMgrResult->getAttributeListAll(list);
for (const auto &attr : list) {
const AttributeVector &v = *attr;
- _metricsWireService.addAttribute(_subAttributeMetrics, _totalAttributeMetrics,
- v.getName());
+ _metricsWireService.addAttribute(_subAttributeMetrics, v.getName());
}
}
_initAttrMgr = attrMgrResult;
@@ -175,11 +174,11 @@ FastAccessDocSubDB::reconfigureAttributeMetrics(const proton::IAttributeManager
}
for (const auto &attrName : toAdd) {
LOG(debug, "reconfigureAttributeMetrics(): addAttribute='%s'", attrName.c_str());
- _metricsWireService.addAttribute(_subAttributeMetrics, _totalAttributeMetrics, attrName);
+ _metricsWireService.addAttribute(_subAttributeMetrics, attrName);
}
for (const auto &attrName : toRemove) {
LOG(debug, "reconfigureAttributeMetrics(): removeAttribute='%s'", attrName.c_str());
- _metricsWireService.removeAttribute(_subAttributeMetrics, _totalAttributeMetrics, attrName);
+ _metricsWireService.removeAttribute(_subAttributeMetrics, attrName);
}
}
@@ -203,7 +202,6 @@ FastAccessDocSubDB::FastAccessDocSubDB(const Config &cfg, const Context &ctx)
_initAttrMgr(),
_fastAccessFeedView(),
_subAttributeMetrics(ctx._subAttributeMetrics),
- _totalAttributeMetrics(ctx._totalAttributeMetrics),
_addMetrics(cfg._addMetrics),
_metricsWireService(ctx._metricsWireService),
_docIdLimit(0)
diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h
index 7c7ee3fab56..461d1c3d18a 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h
@@ -46,15 +46,12 @@ public:
{
const StoreOnlyDocSubDB::Context _storeOnlyCtx;
const AttributeMetricsCollection &_subAttributeMetrics;
- LegacyAttributeMetrics *_totalAttributeMetrics;
MetricsWireService &_metricsWireService;
Context(const StoreOnlyDocSubDB::Context &storeOnlyCtx,
const AttributeMetricsCollection &subAttributeMetrics,
- LegacyAttributeMetrics *totalAttributeMetrics,
MetricsWireService &metricsWireService)
: _storeOnlyCtx(storeOnlyCtx),
_subAttributeMetrics(subAttributeMetrics),
- _totalAttributeMetrics(totalAttributeMetrics),
_metricsWireService(metricsWireService)
{ }
};
@@ -68,7 +65,6 @@ private:
AttributeManager::SP _initAttrMgr;
Configurer::FeedViewVarHolder _fastAccessFeedView;
AttributeMetricsCollection _subAttributeMetrics;
- LegacyAttributeMetrics *_totalAttributeMetrics;
std::shared_ptr<initializer::InitializerTask>
createAttributeManagerInitializer(const DocumentDBConfig &configSnapshot,
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
index cf40050537d..f29fa3b7f6c 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
@@ -659,11 +659,10 @@ int countOpenFiles()
}
void
-updateExecutorMetrics(ExecutorMetrics &metrics, ExecutorMetrics &legacyMetrics,
+updateExecutorMetrics(ExecutorMetrics &metrics,
const vespalib::ThreadStackExecutor::Stats &stats)
{
metrics.update(stats);
- legacyMetrics.update(stats);
}
}
@@ -690,16 +689,15 @@ Proton::updateMetrics(const vespalib::MonitorGuard &)
}
{
ContentProtonMetrics::ProtonExecutorMetrics &metrics = _metricsEngine->root().executor;
- LegacyProtonMetrics &legacyMetrics = _metricsEngine->legacyRoot();
- updateExecutorMetrics(metrics.proton, legacyMetrics.executor, _executor.getStats());
+ updateExecutorMetrics(metrics.proton, _executor.getStats());
if (_flushEngine) {
- updateExecutorMetrics(metrics.flush, legacyMetrics.flushExecutor, _flushEngine->getExecutorStats());
+ updateExecutorMetrics(metrics.flush, _flushEngine->getExecutorStats());
}
if (_matchEngine) {
- updateExecutorMetrics(metrics.match, legacyMetrics.matchExecutor, _matchEngine->getExecutorStats());
+ updateExecutorMetrics(metrics.match, _matchEngine->getExecutorStats());
}
if (_summaryEngine) {
- updateExecutorMetrics(metrics.docsum, legacyMetrics.summaryExecutor, _summaryEngine->getExecutorStats());
+ updateExecutorMetrics(metrics.docsum, _summaryEngine->getExecutorStats());
}
if (_sharedExecutor) {
metrics.shared.update(_sharedExecutor->getStats());
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
index 91394e429a4..c0c9b961ac8 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
@@ -10,7 +10,7 @@
#include <vespa/searchcore/proton/flushengine/threadedflushtarget.h>
#include <vespa/searchcore/proton/index/index_manager_initializer.h>
#include <vespa/searchcore/proton/index/index_writer.h>
-#include <vespa/searchcore/proton/metrics/legacy_documentdb_metrics.h>
+#include <vespa/searchcore/proton/matching/sessionmanager.h>
#include <vespa/searchcore/proton/reference/document_db_reference.h>
#include <vespa/searchcore/proton/reference/gid_to_lid_change_handler.h>
#include <vespa/searchcorespi/plugin/iindexmanagerfactory.h>