From 6e46957356213205cf014c3cced47bdda8409e18 Mon Sep 17 00:00:00 2001 From: Hansie Odendaal <39146854+hansieodendaal@users.noreply.github.com> Date: Tue, 30 Nov 2021 16:30:10 +0200 Subject: [PATCH] test: removed stress test log target (#3631) Description --- Removed the temporary stress test log target that is not in use any more. Motivation and Context --- Dead code needs to be removed. How Has This Been Tested? --- Compile test --- applications/launchpad/docker_rig/log4rs.yml | 5 --- .../protocols/transaction_receive_protocol.rs | 7 --- .../protocols/transaction_send_protocol.rs | 43 ------------------- .../tasks/send_finalized_transaction.rs | 20 --------- .../transaction_service/tasks/wait_on_dial.rs | 24 ----------- common/logging/log4rs_debug_sample.yml | 23 ---------- common/logging/log4rs_sample_base_node.yml | 5 --- integration_tests/log4rs/base_node.yml | 22 ---------- 8 files changed, 149 deletions(-) diff --git a/applications/launchpad/docker_rig/log4rs.yml b/applications/launchpad/docker_rig/log4rs.yml index 8546b05f01..6549a22a57 100644 --- a/applications/launchpad/docker_rig/log4rs.yml +++ b/applications/launchpad/docker_rig/log4rs.yml @@ -155,8 +155,3 @@ loggers: appenders: - other additive: false - stress_test: - level: info - appenders: - - other - additive: false diff --git a/base_layer/wallet/src/transaction_service/protocols/transaction_receive_protocol.rs b/base_layer/wallet/src/transaction_service/protocols/transaction_receive_protocol.rs index 1ce1e4ba9c..88244ed5be 100644 --- a/base_layer/wallet/src/transaction_service/protocols/transaction_receive_protocol.rs +++ b/base_layer/wallet/src/transaction_service/protocols/transaction_receive_protocol.rs @@ -49,7 +49,6 @@ use tari_crypto::tari_utilities::Hashable; use tokio::time::sleep; const LOG_TARGET: &str = "wallet::transaction_service::protocols::receive_protocol"; -const LOG_TARGET_STRESS: &str = "stress_test::receive_protocol"; #[derive(Debug, PartialEq)] pub enum TransactionReceiveProtocolStage { @@ -360,12 +359,6 @@ where self.id, self.source_pubkey.clone() ); - debug!( - target: LOG_TARGET_STRESS, - "Finalized Transaction with TX_ID = {} received from {}", - self.id, - self.source_pubkey.clone() - ); finalized_transaction .validate_internal_consistency( diff --git a/base_layer/wallet/src/transaction_service/protocols/transaction_send_protocol.rs b/base_layer/wallet/src/transaction_service/protocols/transaction_send_protocol.rs index 5812f2ac58..1feab3720e 100644 --- a/base_layer/wallet/src/transaction_service/protocols/transaction_send_protocol.rs +++ b/base_layer/wallet/src/transaction_service/protocols/transaction_send_protocol.rs @@ -67,7 +67,6 @@ use tokio::{ }; const LOG_TARGET: &str = "wallet::transaction_service::protocols::send_protocol"; -const LOG_TARGET_STRESS: &str = "stress_test::send_protocol"; #[derive(Debug, PartialEq)] pub enum TransactionSendProtocolStage { @@ -473,10 +472,6 @@ where target: LOG_TARGET, "Transaction (TxId: {}) could not be finalized. Failure error: {:?}", self.id, e, ); - debug!( - target: LOG_TARGET_STRESS, - "Transaction (TxId: {}) could not be finalized. Failure error: {:?}", self.id, e, - ); TransactionServiceProtocolError::new(self.id, TransactionServiceError::from(e)) })?; @@ -508,10 +503,6 @@ where target: LOG_TARGET, "Transaction Recipient Reply for TX_ID = {} received", tx_id, ); - debug!( - target: LOG_TARGET_STRESS, - "Transaction Recipient Reply for TX_ID = {} received", tx_id, - ); send_finalized_transaction_message( tx_id, @@ -628,10 +619,6 @@ where target: LOG_TARGET, "Transaction Send Direct for TxID {} failed: {}", self.id, err ); - debug!( - target: LOG_TARGET_STRESS, - "Transaction Send Direct for TxID {} failed: {}", self.id, err - ); store_and_forward_send_result = self.send_transaction_store_and_forward(msg.clone()).await?; }, SendMessageResponse::PendingDiscovery(rx) => { @@ -671,7 +658,6 @@ where }, Err(e) => { warn!(target: LOG_TARGET, "Direct Transaction Send failed: {:?}", e); - debug!(target: LOG_TARGET_STRESS, "Direct Transaction Send failed: {:?}", e); }, } @@ -716,13 +702,6 @@ where self.id, successful_sends[0], ); - debug!( - target: LOG_TARGET_STRESS, - "Transaction (TxId: {}) Send to Neighbours for Store and Forward successful with Message \ - Tags: {:?}", - self.id, - successful_sends[0], - ); Ok(true) } else if !failed_sends.is_empty() { warn!( @@ -731,12 +710,6 @@ where messages were sent", self.id ); - debug!( - target: LOG_TARGET_STRESS, - "Transaction Send to Neighbours for Store and Forward for TX_ID: {} was unsuccessful and no \ - messages were sent", - self.id - ); Ok(false) } else { warn!( @@ -745,12 +718,6 @@ where unsuccessful. Some message might still be sent.", self.id ); - debug!( - target: LOG_TARGET_STRESS, - "Transaction Send to Neighbours for Store and Forward for TX_ID: {} timed out and was \ - unsuccessful. Some message might still be sent.", - self.id - ); Ok(false) } }, @@ -761,12 +728,6 @@ where messages were sent", self.id ); - debug!( - target: LOG_TARGET_STRESS, - "Transaction Send to Neighbours for Store and Forward for TX_ID: {} was unsuccessful and no \ - messages were sent", - self.id - ); Ok(false) }, Err(e) => { @@ -774,10 +735,6 @@ where target: LOG_TARGET, "Transaction Send (TxId: {}) to neighbours for Store and Forward failed: {:?}", self.id, e ); - debug!( - target: LOG_TARGET_STRESS, - "Transaction Send (TxId: {}) to neighbours for Store and Forward failed: {:?}", self.id, e - ); Ok(false) }, } diff --git a/base_layer/wallet/src/transaction_service/tasks/send_finalized_transaction.rs b/base_layer/wallet/src/transaction_service/tasks/send_finalized_transaction.rs index 8c504d460b..29f5cdd758 100644 --- a/base_layer/wallet/src/transaction_service/tasks/send_finalized_transaction.rs +++ b/base_layer/wallet/src/transaction_service/tasks/send_finalized_transaction.rs @@ -39,7 +39,6 @@ use crate::transaction_service::{ }; const LOG_TARGET: &str = "wallet::transaction_service::tasks::send_finalized_transaction"; -const LOG_TARGET_STRESS: &str = "stress_test::send_finalized_transaction"; pub async fn send_finalized_transaction_message( tx_id: TxId, @@ -142,10 +141,6 @@ pub async fn send_finalized_transaction_message_direct( target: LOG_TARGET, "Finalized Transaction Send Direct for TxID {} failed: {}", tx_id, err ); - debug!( - target: LOG_TARGET_STRESS, - "Finalized Transaction Send Direct for TxID {} failed: {}", tx_id, err - ); if transaction_routing_mechanism == TransactionRoutingMechanism::DirectAndStoreAndForward { store_and_forward_send_result = send_transaction_finalized_message_store_and_forward( tx_id, @@ -197,10 +192,6 @@ pub async fn send_finalized_transaction_message_direct( }, Err(e) => { warn!(target: LOG_TARGET, "Direct Finalized Transaction Send failed: {:?}", e); - debug!( - target: LOG_TARGET_STRESS, - "Direct Finalized Transaction Send failed: {:?}", e - ); }, } if !direct_send_result && !store_and_forward_send_result { @@ -232,23 +223,12 @@ async fn send_transaction_finalized_message_store_and_forward( tx_id, send_states.to_tags(), ); - debug!( - target: LOG_TARGET_STRESS, - "Sending Finalized Transaction (TxId: {}) to Neighbours for Store and Forward successful with Message \ - Tags: {:?}", - tx_id, - send_states.to_tags(), - ); }, Err(e) => { warn!( target: LOG_TARGET, "Sending Finalized Transaction (TxId: {}) to neighbours for Store and Forward failed: {:?}", tx_id, e ); - debug!( - target: LOG_TARGET_STRESS, - "Sending Finalized Transaction (TxId: {}) to neighbours for Store and Forward failed: {:?}", tx_id, e - ); return Ok(false); }, }; diff --git a/base_layer/wallet/src/transaction_service/tasks/wait_on_dial.rs b/base_layer/wallet/src/transaction_service/tasks/wait_on_dial.rs index 9d881701e4..fd75ce2023 100644 --- a/base_layer/wallet/src/transaction_service/tasks/wait_on_dial.rs +++ b/base_layer/wallet/src/transaction_service/tasks/wait_on_dial.rs @@ -27,7 +27,6 @@ use tari_comms::types::CommsPublicKey; use tari_comms_dht::outbound::MessageSendStates; const LOG_TARGET: &str = "wallet::transaction_service::tasks"; -const LOG_TARGET_STRESS: &str = "stress_test::transaction_service::tasks"; /// This function contains the logic to wait on a dial and send of a queued message pub async fn wait_on_dial( @@ -46,24 +45,12 @@ pub async fn wait_on_dial( destination_pubkey, send_states[0].tag, ); - debug!( - target: LOG_TARGET_STRESS, - "{} (TxId: {}) Direct Send to {} queued with Message {}", - message, - tx_id, - destination_pubkey, - send_states[0].tag, - ); let (sent, failed) = send_states.wait_n_timeout(direct_send_timeout, 1).await; if !sent.is_empty() { info!( target: LOG_TARGET, "Direct Send process for {} TX_ID: {} was successful with Message: {}", message, tx_id, sent[0] ); - debug!( - target: LOG_TARGET_STRESS, - "Direct Send process for {} TX_ID: {} was successful with Message: {}", message, tx_id, sent[0] - ); true } else { if failed.is_empty() { @@ -71,10 +58,6 @@ pub async fn wait_on_dial( target: LOG_TARGET, "Direct Send process for {} TX_ID: {} timed out", message, tx_id ); - debug!( - target: LOG_TARGET_STRESS, - "Direct Send process for {} TX_ID: {} timed out", message, tx_id - ); } else { warn!( target: LOG_TARGET, @@ -83,13 +66,6 @@ pub async fn wait_on_dial( tx_id, failed[0] ); - debug!( - target: LOG_TARGET_STRESS, - "Direct Send process for {} TX_ID: {} and Message {} was unsuccessful and no message was sent", - message, - tx_id, - failed[0] - ); } false } diff --git a/common/logging/log4rs_debug_sample.yml b/common/logging/log4rs_debug_sample.yml index b80b070b4a..7141029d52 100644 --- a/common/logging/log4rs_debug_sample.yml +++ b/common/logging/log4rs_debug_sample.yml @@ -85,23 +85,6 @@ appenders: encoder: pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] {l:5} {m}{n}" - # An appender named "stress_test" that writes to a file with a custom pattern encoder - stress_test: - kind: rolling_file - path: "log/base-node/stress_test.log" - policy: - kind: compound - trigger: - kind: size - limit: 10mb - roller: - kind: fixed_window - base: 1 - count: 10 - pattern: "log/base-node/stress_test.{}.log" - encoder: - pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] {l:5} {m}{n}" - # Set the default logging level to "warn" and attach the "stdout" appender to the root root: level: warn @@ -163,9 +146,3 @@ loggers: appenders: - mm_proxy additive: false - # Route log events sent to the "stress_test" logger to the "stress_test" appender - stress_test: - level: debug - appenders: - - stress_test - additive: false diff --git a/common/logging/log4rs_sample_base_node.yml b/common/logging/log4rs_sample_base_node.yml index dee1bc500a..6d5ebfc929 100644 --- a/common/logging/log4rs_sample_base_node.yml +++ b/common/logging/log4rs_sample_base_node.yml @@ -146,8 +146,3 @@ loggers: level: info appenders: - base_layer - # Route log events sent to the "stress_test" logger to the "base_layer" appender - stress_test: - level: info - appenders: - - base_layer diff --git a/integration_tests/log4rs/base_node.yml b/integration_tests/log4rs/base_node.yml index 4d44f9aeb3..8238ce18bf 100644 --- a/integration_tests/log4rs/base_node.yml +++ b/integration_tests/log4rs/base_node.yml @@ -73,23 +73,6 @@ appenders: encoder: pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] {l:5} {m}{n}" - # An appender named "stress_test" that writes to a file with a custom pattern encoder - stress_test: - kind: rolling_file - path: "log/base-node/stress_test.log" - policy: - kind: compound - trigger: - kind: size - limit: 10mb - roller: - kind: fixed_window - base: 1 - count: 10 - pattern: "log/base-node/stress_test.{}.log" - encoder: - pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] {l:5} {m}{n}" - # Set the default logging level to "warn" and attach the "stdout" appender to the root root: level: warn @@ -164,8 +147,3 @@ loggers: level: info appenders: - base_layer - # Route log events sent to the "stress_test" logger to the "base_layer" appender - stress_test: - level: info - appenders: - - base_layer