Skip to content

Commit

Permalink
Moving WAL memory usage into in flight data so we can get a break down
Browse files Browse the repository at this point in the history
per label.
  • Loading branch information
fulmicoton committed Mar 14, 2024
1 parent 9383993 commit d1de0c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
18 changes: 10 additions & 8 deletions quickwit/quickwit-common/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,13 @@ impl Default for MemoryMetrics {

#[derive(Clone)]
pub struct InFlightDataGauges {
pub doc_processor_mailbox: IntGauge,
pub index_writer: IntGauge,
pub indexer_mailbox: IntGauge,
pub ingest_router: IntGauge,
pub rest_server: IntGauge,
pub ingest_router: IntGauge,
pub wal: IntGauge,
pub sources: InFlightDataSourceGauges,
pub doc_processor_mailbox: IntGauge,
pub indexer_mailbox: IntGauge,
pub index_writer: IntGauge,
}

impl Default for InFlightDataGauges {
Expand All @@ -270,12 +271,13 @@ impl Default for InFlightDataGauges {
["component"],
);
Self {
doc_processor_mailbox: in_flight_gauge_vec.with_label_values(["doc_processor_mailbox"]),
index_writer: in_flight_gauge_vec.with_label_values(["index_writer"]),
indexer_mailbox: in_flight_gauge_vec.with_label_values(["indexer_mailbox"]),
ingest_router: in_flight_gauge_vec.with_label_values(["ingest_router"]),
rest_server: in_flight_gauge_vec.with_label_values(["rest_server"]),
ingest_router: in_flight_gauge_vec.with_label_values(["ingest_router"]),
wal: in_flight_gauge_vec.with_label_values(["wal"]),
sources: InFlightDataSourceGauges::new(&in_flight_gauge_vec),
doc_processor_mailbox: in_flight_gauge_vec.with_label_values(["doc_processor_mailbox"]),
indexer_mailbox: in_flight_gauge_vec.with_label_values(["indexer_mailbox"]),
index_writer: in_flight_gauge_vec.with_label_values(["index_writer"]),
}
}
}
Expand Down
11 changes: 2 additions & 9 deletions quickwit/quickwit-ingest/src/ingest_v2/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ pub(super) struct IngestV2Metrics {
pub wal_acquire_lock_requests_in_flight: IntGaugeVec<2>,
pub wal_acquire_lock_request_duration_secs: HistogramVec<2>,
pub wal_disk_used_bytes: IntGauge,
pub wal_memory_allocated_bytes: IntGauge,
pub wal_memory_used_bytes: IntGauge,
}

Expand Down Expand Up @@ -77,12 +76,6 @@ impl Default for IngestV2Metrics {
"ingest",
&[],
),
wal_memory_allocated_bytes: new_gauge(
"wal_memory_allocated_bytes",
"WAL memory allocated in bytes.",
"ingest",
&[],
),
wal_memory_used_bytes: new_gauge(
"wal_memory_used_bytes",
"WAL memory used in bytes.",
Expand All @@ -97,8 +90,8 @@ pub(super) fn report_wal_usage(wal_usage: ResourceUsage) {
INGEST_V2_METRICS
.wal_disk_used_bytes
.set(wal_usage.disk_used_bytes as i64);
INGEST_V2_METRICS
.wal_memory_allocated_bytes
quickwit_common::metrics::MEMORY_METRICS.in_flight_data
.wal
.set(wal_usage.memory_allocated_bytes as i64);
INGEST_V2_METRICS
.wal_memory_used_bytes
Expand Down

0 comments on commit d1de0c0

Please sign in to comment.