diff --git a/src/scheduler/inner_locustdb.rs b/src/scheduler/inner_locustdb.rs index 4868721f..1dfdf346 100644 --- a/src/scheduler/inner_locustdb.rs +++ b/src/scheduler/inner_locustdb.rs @@ -386,7 +386,7 @@ impl InnerLocustDB { None => log::info!("Performed wal flush in {total_time:?} (batching: {time_batching:?}, compaction: {time_compaction:?})"), Some((lock_time, write_time_partitions, write_time_meta, delete_time_wal)) => { - log::info!("Performed wal flush in {total_time:?} (batching: {time_batching:?}, compaction: {time_compaction:?}), lock: {lock_time:?}, write partitions: {write_time_partitions:?}, write meta: {write_time_meta:?}, delete wal: {delete_time_wal:?}"); + log::info!("Performed wal flush in {total_time:?} (batching: {time_batching:?}, compaction: {time_compaction:?}, lock: {lock_time:?}, write partitions: {write_time_partitions:?}, write meta: {write_time_meta:?}, delete wal: {delete_time_wal:?})"); } } } diff --git a/src/server/mod.rs b/src/server/mod.rs index f575cb9c..b2a22270 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -52,6 +52,7 @@ struct AppState { #[get("/")] async fn index(data: web::Data) -> impl Responder { let mut context = Context::new(); + let mut ts: Vec = data .db .table_stats() @@ -62,6 +63,21 @@ async fn index(data: web::Data) -> impl Responder { .collect::>(); ts.sort(); context.insert("tables", &ts); + + let perf_counter = data.db.perf_counter(); + context.insert("disk_write_bytes", &perf_counter.disk_write_bytes()); + context.insert("disk_write_new_partition_bytes", &perf_counter.disk_write_new_partition_bytes()); + context.insert("disk_write_compaction_bytes", &perf_counter.disk_write_compaction_bytes()); + context.insert("disk_write_meta_store_bytes", &perf_counter.disk_write_meta_store_bytes()); + context.insert("files_created", &perf_counter.files_created()); + context.insert("files_created_wal", &perf_counter.files_created_wal()); + context.insert("files_created_new_partition", &perf_counter.files_created_new_partition()); + context.insert("files_created_meta_store", &perf_counter.files_created_meta_store()); + context.insert("ingestion_requests", &perf_counter.ingestion_requests()); + context.insert("ingestion_bytes", &perf_counter.network_read_ingestion_bytes()); + context.insert("files_opened_partition", &perf_counter.files_opened_partition()); + context.insert("disk_read_partition_bytes", &perf_counter.disk_read_partition_bytes()); + let body = TEMPLATES.render("index.html", &context).unwrap(); HttpResponse::Ok() .content_type("text/html; charset=utf8") diff --git a/templates/index.html b/templates/index.html index 0791c1f8..0a424805 100644 --- a/templates/index.html +++ b/templates/index.html @@ -33,6 +33,20 @@

Tables

{% endfor %} +

Perf stats

+ disk_write_bytes: {{ disk_write_bytes }}
+ disk_write_new_partition_bytes: {{ disk_write_new_partition_bytes }}
+ disk_write_compaction_bytes: {{ disk_write_compaction_bytes }}
+ disk_write_meta_store_bytes: {{ disk_write_meta_store_bytes }}
+ files_created: {{ files_created }}
+ files_created_wal: {{ files_created_wal }}
+ files_created_new_partition: {{ files_created_new_partition }}
+ files_created_meta_store: {{ files_created_meta_store }}
+ ingestion_requests: {{ ingestion_requests }}
+ ingestion_bytes: {{ ingestion_bytes }}
+ files_opened_partition: {{ files_opened_partition }}
+ disk_read_partition_bytes: {{ disk_read_partition_bytes }}
+

Run query