Skip to content
Closed
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
101 changes: 100 additions & 1 deletion Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ statistical = "1.0.0"
strum = "0.25.0"
strum_macros = "0.25.2"
syn = "2.0.39"
sysinfo = "0.37.1"
tar = "0.4.38"
tempfile = "3.7.0"
test-case = "3.2.1"
test-log = "0.2.14"
Expand Down
1 change: 1 addition & 0 deletions crates/apollo_network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ serde = { workspace = true, features = ["derive"] }
starknet_api.workspace = true
strum.workspace = true
strum_macros.workspace = true
sysinfo.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["full", "sync"] }
tokio-retry.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use futures::future::join_all;
use futures::StreamExt;
use libp2p::gossipsub::{Sha256Topic, Topic};
use libp2p::Multiaddr;
use metrics::{counter, gauge};
// use metrics::{counter, gauge};
use metrics_exporter_prometheus::PrometheusBuilder;
use tokio::time::Duration;
use tracing::{info, trace, Level};
Expand All @@ -30,6 +30,7 @@ use tracing::{info, trace, Level};
mod converters_test;

mod converters;
pub mod metrics;
mod utils;

lazy_static::lazy_static! {
Expand Down Expand Up @@ -94,7 +95,7 @@ async fn send_stress_test_messages(
message.metadata.message_index = i;
broadcast_topic_client.broadcast_message(message.clone()).await.unwrap();
trace!("Sent message {i}: {:?}", message);
counter!("sent_messages").increment(1);
// counter!("sent_messages").increment(1);
tokio::time::sleep(duration).await;
}
}
Expand All @@ -112,24 +113,25 @@ fn receive_stress_test_message(
Err(_) => panic!("Got a negative duration, the clocks are not synced!"),
};

let delay_seconds = duration.as_secs_f64();
let delay_micros = duration.as_micros().try_into().unwrap();
let _delay_seconds = duration.as_secs_f64();
// let delay_micros = duration.as_micros().try_into().unwrap();

// TODO(AndrewL): Concentrate all string metrics to constants in a different file
counter!("message_received").increment(1);
counter!(format!("message_received_from_{}", received_message.metadata.sender_id)).increment(1);
// counter!("message_received").increment(1);
// counter!(format!("message_received_from_{}",
// received_message.metadata.sender_id)).increment(1);

// TODO(AndrewL): This should be a historgram
gauge!("message_received_delay_seconds").set(delay_seconds);
gauge!(format!("message_received_delay_seconds_from_{}", received_message.metadata.sender_id))
.set(delay_seconds);

counter!("message_received_delay_micros_sum").increment(delay_micros);
counter!(format!(
"message_received_delay_micros_sum_from_{}",
received_message.metadata.sender_id
))
.increment(delay_micros);
// gauge!("message_received_delay_seconds").set(delay_seconds);
// gauge!(format!("message_received_delay_seconds_from_{}",
// received_message.metadata.sender_id)) .set(delay_seconds);

// counter!("message_received_delay_micros_sum").increment(delay_micros);
// counter!(format!(
// "message_received_delay_micros_sum_from_{}",
// received_message.metadata.sender_id
// ))
// .increment(delay_micros);
// TODO(AndrewL): Figure out what to log here
}

Expand Down
Loading
Loading