Skip to content

Commit

Permalink
Merge branch 'development' into comms-peer-manager-signed-peers
Browse files Browse the repository at this point in the history
* development:
  test: removed stress test log target (tari-project#3631)
  • Loading branch information
sdbondi committed Dec 1, 2021
2 parents 21e7d37 + 6e46957 commit be25448
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 149 deletions.
5 changes: 0 additions & 5 deletions applications/launchpad/docker_rig/log4rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,3 @@ loggers:
appenders:
- other
additive: false
stress_test:
level: info
appenders:
- other
additive: false
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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))
})?;

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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);
},
}

Expand Down Expand Up @@ -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!(
Expand All @@ -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!(
Expand All @@ -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)
}
},
Expand All @@ -761,23 +728,13 @@ 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) => {
warn!(
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)
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
},
};
Expand Down
24 changes: 0 additions & 24 deletions base_layer/wallet/src/transaction_service/tasks/wait_on_dial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -46,35 +45,19 @@ 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() {
warn!(
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,
Expand All @@ -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
}
Expand Down
23 changes: 0 additions & 23 deletions common/logging/log4rs_debug_sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
5 changes: 0 additions & 5 deletions common/logging/log4rs_sample_base_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 0 additions & 22 deletions integration_tests/log4rs/base_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit be25448

Please sign in to comment.