Skip to content

Commit

Permalink
ingest: fix ingestion metric for flushableIngest
Browse files Browse the repository at this point in the history
When we were previously ingesting as a flushable, we were not
incrementing the `metrics.Ingest.Count` metric.
  • Loading branch information
aadityasondhi committed Mar 21, 2024
1 parent 8a097e8 commit 3c9893d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testdata/event_listener
Original file line number Diff line number Diff line change
Expand Up @@ -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
----
Expand Down
8 changes: 4 additions & 4 deletions testdata/metrics
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 3c9893d

Please sign in to comment.