Skip to content

Commit 4ad0b66

Browse files
committed
MB-66329: Expose FusionNamespace for a bucket as a stat
Change-Id: I54a0c2604796c8d25151b37bd1d0d48aa5c25bb0 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/226689 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Vesko Karaganev <vesko.karaganev@couchbase.com>
1 parent 3ff4870 commit 4ad0b66

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

engines/ep/src/ep_engine.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3295,6 +3295,7 @@ void EventuallyPersistentEngine::doEngineStatsFusion(
32953295
const StatCollector& collector) {
32963296
using namespace cb::stats;
32973297

3298+
// getStats from Magma
32983299
constexpr std::array<std::string_view, 17> statNames = {
32993300
{"fusion_NumSyncs",
33003301
"fusion_NumBytesSynced",
@@ -3356,6 +3357,11 @@ void EventuallyPersistentEngine::doEngineStatsFusion(
33563357
addStat(Key::ep_fusion_file_map_mem_used, "fusion_FileMapMemUsed");
33573358
addStat(Key::ep_fusion_sync_failures, "fusion_NumSyncFailures");
33583359
addStat(Key::ep_fusion_migration_failures, "fusion_NumMigrationFailures");
3360+
3361+
// Additional Fusion Stats
3362+
collector.addStat(Key::ep_fusion_namespace,
3363+
configuration.getMagmaFusionNamespacePrefix() + "/" +
3364+
name + "/" + configuration.getUuid());
33593365
}
33603366

33613367
cb::engine_errc EventuallyPersistentEngine::doEngineStats(

statistics/stat_definitions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,13 @@
18061806
"added": "7.2.0"
18071807
},
18081808
/* Fusion Stats */
1809+
{
1810+
"key": "ep_fusion_namespace",
1811+
"unit": "none",
1812+
"prometheus": false,
1813+
"description": "The namespace corresponds to an instance of a Couchbase bucket. It is in the form '<service_prefix>/<bucket_name>/<bucket_uuid>'",
1814+
"added": "8.0.0"
1815+
},
18091816
{
18101817
"key": "ep_fusion_syncs",
18111818
"unit": "count",

tests/testapp/testapp_fusion.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,8 @@ TEST_P(FusionTest, Stat_UploaderState_KVStoreInvalid) {
447447
}
448448

449449
TEST_P(FusionTest, GetPrometheusFusionStats) {
450-
std::array<std::string_view, 17> statKeysExpected = {
450+
std::array<std::string_view, 18> statKeysExpected = {
451+
"ep_fusion_namespace",
451452
"ep_fusion_syncs",
452453
"ep_fusion_bytes_synced",
453454
"ep_fusion_logs_migrated",

0 commit comments

Comments
 (0)