From 3c9893d606b2dc0a0749be4b580b2f0bb3573244 Mon Sep 17 00:00:00 2001 From: Aaditya Sondhi <20070511+aadityasondhi@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:08:49 -0400 Subject: [PATCH] ingest: fix ingestion metric for flushableIngest When we were previously ingesting as a flushable, we were not incrementing the `metrics.Ingest.Count` metric. --- ingest.go | 1 + testdata/event_listener | 2 +- testdata/metrics | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ingest.go b/ingest.go index 9d4b243403..d4204ae191 100644 --- a/ingest.go +++ b/ingest.go @@ -1408,6 +1408,7 @@ func (d *DB) handleIngestAsFlushable( } } + d.mu.versions.metrics.Ingest.Count++ currMem := d.mu.mem.mutable // NB: Placing ingested sstables above the current memtables // requires rotating of the existing memtables/WAL. There is diff --git a/testdata/event_listener b/testdata/event_listener index c75a551133..e9a5b1998d 100644 --- a/testdata/event_listener +++ b/testdata/event_listener @@ -334,7 +334,7 @@ Secondary cache: 0 entries (0B) hit rate: 0.0% Snapshots: 0 earliest seq num: 0 Table iters: 0 Filter utility: 0.0% -Ingestions: 1 as flushable: 1 (1.2KB in 2 tables) +Ingestions: 2 as flushable: 1 (1.2KB in 2 tables) sstables ---- diff --git a/testdata/metrics b/testdata/metrics index 27a33e5690..2d8eb543ad 100644 --- a/testdata/metrics +++ b/testdata/metrics @@ -484,7 +484,7 @@ Secondary cache: 0 entries (0B) hit rate: 0.0% Snapshots: 0 earliest seq num: 0 Table iters: 0 Filter utility: 0.0% -Ingestions: 0 as flushable: 2 (1.8KB in 3 tables) +Ingestions: 2 as flushable: 2 (1.8KB in 3 tables) Iter category stats: b, latency: {BlockBytes:44 BlockBytesInCache:0 BlockReadDuration:10ms} c, non-latency: {BlockBytes:44 BlockBytesInCache:44 BlockReadDuration:0s} @@ -546,7 +546,7 @@ Secondary cache: 0 entries (0B) hit rate: 0.0% Snapshots: 0 earliest seq num: 0 Table iters: 0 Filter utility: 0.0% -Ingestions: 0 as flushable: 2 (1.8KB in 3 tables) +Ingestions: 2 as flushable: 2 (1.8KB in 3 tables) Iter category stats: b, latency: {BlockBytes:44 BlockBytesInCache:0 BlockReadDuration:10ms} c, non-latency: {BlockBytes:44 BlockBytesInCache:44 BlockReadDuration:0s} @@ -622,7 +622,7 @@ Secondary cache: 0 entries (0B) hit rate: 0.0% Snapshots: 0 earliest seq num: 0 Table iters: 0 Filter utility: 0.0% -Ingestions: 1 as flushable: 2 (1.8KB in 3 tables) +Ingestions: 3 as flushable: 2 (1.8KB in 3 tables) Iter category stats: b, latency: {BlockBytes:44 BlockBytesInCache:0 BlockReadDuration:10ms} c, non-latency: {BlockBytes:44 BlockBytesInCache:44 BlockReadDuration:0s} @@ -723,7 +723,7 @@ Secondary cache: 0 entries (0B) hit rate: 0.0% Snapshots: 0 earliest seq num: 0 Table iters: 0 Filter utility: 0.0% -Ingestions: 2 as flushable: 2 (1.8KB in 3 tables) +Ingestions: 4 as flushable: 2 (1.8KB in 3 tables) Iter category stats: b, latency: {BlockBytes:44 BlockBytesInCache:0 BlockReadDuration:10ms} c, non-latency: {BlockBytes:44 BlockBytesInCache:44 BlockReadDuration:0s}