summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2021-11-26 15:23:39 +0100
committerTor Egge <Tor.Egge@online.no>2021-11-26 15:26:52 +0100
commitd5d8301d1c3a73d9471829fc335cb4f270812f99 (patch)
treedf3bce488b3d9d25b7456b6d4b8b9b02e057cd04 /searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
parent1142475e6db77b0e073b0d2b9774bb672cd8feaf (diff)
Update document db feeding metrics.
Diffstat (limited to 'searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp')
-rw-r--r--searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
index bffedfd8dab..f76b7d03d08 100644
--- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
@@ -747,6 +747,20 @@ TEST_F("require that put with different document type repo is ok", FeedHandlerFi
EXPECT_EQUAL(1, f.tls_writer.store_count);
}
+TEST_F("require that feed stats are updated", FeedHandlerFixture)
+{
+ DocumentContext doc_context("id:ns:searchdocument::foo", *f.schema.builder);
+ auto op =std::make_unique<PutOperation>(doc_context.bucketId, Timestamp(10), std::move(doc_context.doc));
+ FeedTokenContext token_context;
+ f.handler.performOperation(std::move(token_context.token), std::move(op));
+ f.syncMaster(); // wait for initateCommit
+ f.syncMaster(); // wait for onCommitDone
+ auto stats = f.handler.get_stats(false);
+ EXPECT_EQUAL(1u, stats.get_commits());
+ EXPECT_EQUAL(1u, stats.get_operations());
+ EXPECT_LESS(0.0, stats.get_total_latency());
+}
+
using namespace document;
TEST_F("require that update with a fieldpath update will be rejected", SchemaContext) {