mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-02 13:23:13 +00:00
Add workload logging
This commit is contained in:
parent
f60580b29a
commit
f31aa99c0e
@ -143,6 +143,11 @@ impl<Caps> TransactionFlowBuilder<Caps> {
|
||||
let workload = transaction::Workload::with_rate(self.rate.get())
|
||||
.expect("transaction rate must be non-zero")
|
||||
.with_user_limit(self.users);
|
||||
tracing::info!(
|
||||
rate = self.rate.get(),
|
||||
users = self.users.map(|u| u.get()),
|
||||
"attaching transaction workload"
|
||||
);
|
||||
self.builder = self.builder.with_workload(workload);
|
||||
self.builder
|
||||
}
|
||||
@ -204,6 +209,12 @@ impl<Caps> DataAvailabilityFlowBuilder<Caps> {
|
||||
pub fn apply(mut self) -> CoreScenarioBuilder<Caps> {
|
||||
let count = (self.channel_rate.get() * self.blob_rate.get()) as usize;
|
||||
let workload = da::Workload::with_channel_count(count.max(1));
|
||||
tracing::info!(
|
||||
channel_rate = self.channel_rate.get(),
|
||||
blob_rate = self.blob_rate.get(),
|
||||
channels = count.max(1),
|
||||
"attaching data-availability workload"
|
||||
);
|
||||
self.builder = self.builder.with_workload(workload);
|
||||
self.builder
|
||||
}
|
||||
|
||||
@ -72,9 +72,11 @@ impl ScenarioWorkload for Workload {
|
||||
let mut receiver = ctx.block_feed().subscribe();
|
||||
|
||||
for channel_id in self.plan().iter().copied() {
|
||||
tracing::info!(channel_id = ?channel_id, "DA workload starting channel flow");
|
||||
run_channel_flow(ctx, &mut receiver, channel_id).await?;
|
||||
}
|
||||
|
||||
tracing::info!("DA workload completed all channel flows");
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@ -84,11 +86,14 @@ async fn run_channel_flow(
|
||||
receiver: &mut broadcast::Receiver<Arc<BlockRecord>>,
|
||||
channel_id: ChannelId,
|
||||
) -> Result<(), DynError> {
|
||||
tracing::debug!(channel_id = ?channel_id, "DA: submitting inscription tx");
|
||||
let tx = Arc::new(tx::create_inscription_transaction_with_id(channel_id));
|
||||
submit_transaction_via_cluster(ctx, Arc::clone(&tx)).await?;
|
||||
|
||||
let inscription_id = wait_for_inscription(receiver, channel_id).await?;
|
||||
tracing::debug!(channel_id = ?channel_id, inscription_id = ?inscription_id, "DA: inscription observed");
|
||||
let blob_id = publish_blob(ctx, channel_id, inscription_id).await?;
|
||||
tracing::debug!(channel_id = ?channel_id, blob_id = ?blob_id, "DA: blob published");
|
||||
wait_for_blob(receiver, channel_id, blob_id).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -51,6 +51,7 @@ impl ScenarioWorkload for Workload {
|
||||
descriptors: &GeneratedTopology,
|
||||
_run_metrics: &RunMetrics,
|
||||
) -> Result<(), DynError> {
|
||||
tracing::info!("initializing transaction workload");
|
||||
let wallet_accounts = descriptors.config().wallet().accounts.clone();
|
||||
if wallet_accounts.is_empty() {
|
||||
return Err("transaction workload requires seeded accounts".into());
|
||||
@ -81,11 +82,22 @@ impl ScenarioWorkload for Workload {
|
||||
);
|
||||
}
|
||||
|
||||
tracing::info!(
|
||||
available_accounts = accounts.len(),
|
||||
user_limit = self.user_limit.map(|u| u.get()),
|
||||
"transaction workload accounts prepared"
|
||||
);
|
||||
|
||||
self.accounts = accounts;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn start(&self, ctx: &RunContext) -> Result<(), DynError> {
|
||||
tracing::info!(
|
||||
txs_per_block = self.txs_per_block.get(),
|
||||
users = self.user_limit.map(|u| u.get()),
|
||||
"starting transaction workload submission"
|
||||
);
|
||||
Submission::new(self, ctx)?.execute().await
|
||||
}
|
||||
}
|
||||
@ -158,6 +170,12 @@ impl<'a> Submission<'a> {
|
||||
}
|
||||
|
||||
async fn execute(mut self) -> Result<(), DynError> {
|
||||
let total = self.plan.len();
|
||||
tracing::info!(
|
||||
total,
|
||||
interval_ms = self.interval.as_millis(),
|
||||
"begin transaction submissions"
|
||||
);
|
||||
while let Some(input) = self.plan.pop_front() {
|
||||
submit_wallet_transaction(self.ctx, &input).await?;
|
||||
|
||||
@ -165,6 +183,7 @@ impl<'a> Submission<'a> {
|
||||
sleep(self.interval).await;
|
||||
}
|
||||
}
|
||||
tracing::info!("transaction submissions finished");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user