mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-19 20:31:15 +00:00
Tweak logging around connections opening and messages coming in
This commit is contained in:
@@ -224,8 +224,6 @@ impl InnerLoop {
|
|||||||
|
|
||||||
/// Handle messages coming from shards.
|
/// Handle messages coming from shards.
|
||||||
fn handle_from_shard(&mut self, shard_conn_id: ConnId, msg: FromShardWebsocket) {
|
fn handle_from_shard(&mut self, shard_conn_id: ConnId, msg: FromShardWebsocket) {
|
||||||
log::debug!("Message from shard ({:?}): {:?}", shard_conn_id, msg);
|
|
||||||
|
|
||||||
match msg {
|
match msg {
|
||||||
FromShardWebsocket::Initialize { channel } => {
|
FromShardWebsocket::Initialize { channel } => {
|
||||||
self.shard_channels.insert(shard_conn_id, channel);
|
self.shard_channels.insert(shard_conn_id, channel);
|
||||||
@@ -357,7 +355,6 @@ impl InnerLoop {
|
|||||||
|
|
||||||
/// Handle messages coming from feeds.
|
/// Handle messages coming from feeds.
|
||||||
fn handle_from_feed(&mut self, feed_conn_id: ConnId, msg: FromFeedWebsocket) {
|
fn handle_from_feed(&mut self, feed_conn_id: ConnId, msg: FromFeedWebsocket) {
|
||||||
log::debug!("Message from feed ({:?}): {:?}", feed_conn_id, msg);
|
|
||||||
match msg {
|
match msg {
|
||||||
FromFeedWebsocket::Initialize { channel } => {
|
FromFeedWebsocket::Initialize { channel } => {
|
||||||
self.feed_channels.insert(feed_conn_id, channel.clone());
|
self.feed_channels.insert(feed_conn_id, channel.clone());
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ async fn start_server(opts: Opts) -> anyhow::Result<()> {
|
|||||||
(&Method::GET, "/health") => Ok(Response::new("OK".into())),
|
(&Method::GET, "/health") => Ok(Response::new("OK".into())),
|
||||||
// Subscribe to feed messages:
|
// Subscribe to feed messages:
|
||||||
(&Method::GET, "/feed") => {
|
(&Method::GET, "/feed") => {
|
||||||
|
log::info!("Opening /feed connection from {:?}", addr);
|
||||||
Ok(http_utils::upgrade_to_websocket(
|
Ok(http_utils::upgrade_to_websocket(
|
||||||
req,
|
req,
|
||||||
move |ws_send, ws_recv| async move {
|
move |ws_send, ws_recv| async move {
|
||||||
@@ -130,6 +131,7 @@ async fn start_server(opts: Opts) -> anyhow::Result<()> {
|
|||||||
Ok(http_utils::upgrade_to_websocket(
|
Ok(http_utils::upgrade_to_websocket(
|
||||||
req,
|
req,
|
||||||
move |ws_send, ws_recv| async move {
|
move |ws_send, ws_recv| async move {
|
||||||
|
log::info!("Opening /shard_submit connection from {:?}", addr);
|
||||||
let tx_to_aggregator = aggregator.subscribe_shard();
|
let tx_to_aggregator = aggregator.subscribe_shard();
|
||||||
let (mut tx_to_aggregator, mut ws_send) =
|
let (mut tx_to_aggregator, mut ws_send) =
|
||||||
handle_shard_websocket_connection(
|
handle_shard_websocket_connection(
|
||||||
@@ -399,10 +401,6 @@ let mut i: u64 = 0;
|
|||||||
if feed_id == 1 {
|
if feed_id == 1 {
|
||||||
i += 1;
|
i += 1;
|
||||||
println!("FEED #{}, msgs: {}", i, msgs.len());
|
println!("FEED #{}, msgs: {}", i, msgs.len());
|
||||||
if i > 1000 {
|
|
||||||
log::error!("TESTING: close feed");
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// End the loop when there are more than 10k messages queued up.
|
// End the loop when there are more than 10k messages queued up.
|
||||||
// This number is just picked as a fairly high limit that should account
|
// This number is just picked as a fairly high limit that should account
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ async fn start_server(opts: Opts) -> anyhow::Result<()> {
|
|||||||
Ok(http_utils::upgrade_to_websocket(
|
Ok(http_utils::upgrade_to_websocket(
|
||||||
req,
|
req,
|
||||||
move |ws_send, ws_recv| async move {
|
move |ws_send, ws_recv| async move {
|
||||||
|
log::info!("Opening /submit connection from {:?}", addr);
|
||||||
let tx_to_aggregator = aggregator.subscribe_node();
|
let tx_to_aggregator = aggregator.subscribe_node();
|
||||||
let (mut tx_to_aggregator, mut ws_send) =
|
let (mut tx_to_aggregator, mut ws_send) =
|
||||||
handle_node_websocket_connection(
|
handle_node_websocket_connection(
|
||||||
|
|||||||
Reference in New Issue
Block a user