Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/apollo_network_benchmark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ clap = { workspace = true, features = ["derive", "env"] }
lazy_static.workspace = true
metrics-exporter-prometheus.workspace = true
tokio = { workspace = true, features = ["full", "sync"] }
tokio-metrics = { workspace = true, features = ["metrics-rs-integration", "rt"] }
tracing.workspace = true
tracing-subscriber.workspace = true

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//! Runs a node that stress tests the p2p communication of the network.
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};
use std::time::Duration;

use clap::Parser;
use metrics_exporter_prometheus::PrometheusBuilder;
use tokio_metrics::RuntimeMetricsReporterBuilder;
use tracing::Level;

#[cfg(test)]
Expand Down Expand Up @@ -39,5 +41,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

builder.install().expect("Failed to install prometheus recorder/exporter");

// Start the tokio runtime metrics reporter to automatically collect and export runtime metrics
tokio::spawn(
RuntimeMetricsReporterBuilder::default()
.with_interval(Duration::from_secs(1))
.describe_and_run(),
);

Ok(())
}
Loading