Improve metrics hooks setup (fixes #12672) (#12684)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Nils
2024-11-21 18:03:15 +01:00
committed by GitHub
parent 2093d2bd9a
commit f8d683e80e
6 changed files with 99 additions and 50 deletions

View File

@@ -206,7 +206,6 @@ const fn describe_io_stats() {}
mod tests {
use super::*;
use reqwest::Client;
use reth_provider::{test_utils::create_test_provider_factory, StaticFileProviderFactory};
use reth_tasks::TaskManager;
use socket2::{Domain, Socket, Type};
use std::net::{SocketAddr, TcpListener};
@@ -236,8 +235,7 @@ mod tests {
let tasks = TaskManager::current();
let executor = tasks.executor();
let factory = create_test_provider_factory();
let hooks = Hooks::new(factory.db_ref().clone(), factory.static_file_provider());
let hooks = Hooks::builder().build();
let listen_addr = get_random_available_addr();
let config =
@@ -252,7 +250,7 @@ mod tests {
// Check the response body
let body = response.text().await.unwrap();
assert!(body.contains("reth_db_table_size"));
assert!(body.contains("reth_jemalloc_metadata"));
assert!(body.contains("reth_process_cpu_seconds_total"));
assert!(body.contains("reth_process_start_time_seconds"));
}
}