aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/tests/persistence/common
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2021-01-13 11:01:39 +0100
committerTor Egge <Tor.Egge@broadpark.no>2021-01-15 15:17:53 +0100
commite6f30bdbe67a994339d201ce57b2942e3bd5eb78 (patch)
tree8ca1df13c26267038af447fd4f0ff1328e0a31b0 /storage/src/tests/persistence/common
parent1463162fc4b86877df3314c82e76f03a769d2532 (diff)
Add interface for resource usage listener to spi.
Propagate resource usage to service layer.
Diffstat (limited to 'storage/src/tests/persistence/common')
-rw-r--r--storage/src/tests/persistence/common/persistenceproviderwrapper.cpp7
-rw-r--r--storage/src/tests/persistence/common/persistenceproviderwrapper.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/storage/src/tests/persistence/common/persistenceproviderwrapper.cpp b/storage/src/tests/persistence/common/persistenceproviderwrapper.cpp
index 02c92fc1650..bbde377fdec 100644
--- a/storage/src/tests/persistence/common/persistenceproviderwrapper.cpp
+++ b/storage/src/tests/persistence/common/persistenceproviderwrapper.cpp
@@ -3,6 +3,7 @@
#include "persistenceproviderwrapper.h"
#include <vespa/document/fieldvalue/document.h>
#include <vespa/document/update/documentupdate.h>
+#include <vespa/vespalib/util/idestructorcallback.h>
#include <sstream>
#define LOG_SPI(ops) \
@@ -202,6 +203,12 @@ PersistenceProviderWrapper::join(const spi::Bucket& source1,
return _spi.join(source1, source2, target, context);
}
+std::unique_ptr<vespalib::IDestructorCallback>
+PersistenceProviderWrapper::register_resource_usage_listener(spi::IResourceUsageListener& listener)
+{
+ return _spi.register_resource_usage_listener(listener);
+}
+
spi::Result
PersistenceProviderWrapper::removeEntry(const spi::Bucket& bucket,
spi::Timestamp timestamp,
diff --git a/storage/src/tests/persistence/common/persistenceproviderwrapper.h b/storage/src/tests/persistence/common/persistenceproviderwrapper.h
index 4061343c8da..cc26b251e67 100644
--- a/storage/src/tests/persistence/common/persistenceproviderwrapper.h
+++ b/storage/src/tests/persistence/common/persistenceproviderwrapper.h
@@ -111,6 +111,7 @@ public:
spi::Result join(const spi::Bucket& source1, const spi::Bucket& source2,
const spi::Bucket& target, spi::Context&) override;
spi::Result removeEntry(const spi::Bucket&, spi::Timestamp, spi::Context&) override;
+ std::unique_ptr<vespalib::IDestructorCallback> register_resource_usage_listener(spi::IResourceUsageListener& listener) override;
};
} // storage