mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-04 06:13:09 +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())
|
let workload = transaction::Workload::with_rate(self.rate.get())
|
||||||
.expect("transaction rate must be non-zero")
|
.expect("transaction rate must be non-zero")
|
||||||
.with_user_limit(self.users);
|
.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 = self.builder.with_workload(workload);
|
||||||
self.builder
|
self.builder
|
||||||
}
|
}
|
||||||
@ -204,6 +209,12 @@ impl<Caps> DataAvailabilityFlowBuilder<Caps> {
|
|||||||
pub fn apply(mut self) -> CoreScenarioBuilder<Caps> {
|
pub fn apply(mut self) -> CoreScenarioBuilder<Caps> {
|
||||||
let count = (self.channel_rate.get() * self.blob_rate.get()) as usize;
|
let count = (self.channel_rate.get() * self.blob_rate.get()) as usize;
|
||||||
let workload = da::Workload::with_channel_count(count.max(1));
|
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 = self.builder.with_workload(workload);
|
||||||
self.builder
|
self.builder
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,9 +72,11 @@ impl ScenarioWorkload for Workload {
|
|||||||
let mut receiver = ctx.block_feed().subscribe();
|
let mut receiver = ctx.block_feed().subscribe();
|
||||||
|
|
||||||
for channel_id in self.plan().iter().copied() {
|
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?;
|
run_channel_flow(ctx, &mut receiver, channel_id).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tracing::info!("DA workload completed all channel flows");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -84,11 +86,14 @@ async fn run_channel_flow(
|
|||||||
receiver: &mut broadcast::Receiver<Arc<BlockRecord>>,
|
receiver: &mut broadcast::Receiver<Arc<BlockRecord>>,
|
||||||
channel_id: ChannelId,
|
channel_id: ChannelId,
|
||||||
) -> Result<(), DynError> {
|
) -> Result<(), DynError> {
|
||||||
|
tracing::debug!(channel_id = ?channel_id, "DA: submitting inscription tx");
|
||||||
let tx = Arc::new(tx::create_inscription_transaction_with_id(channel_id));
|
let tx = Arc::new(tx::create_inscription_transaction_with_id(channel_id));
|
||||||
submit_transaction_via_cluster(ctx, Arc::clone(&tx)).await?;
|
submit_transaction_via_cluster(ctx, Arc::clone(&tx)).await?;
|
||||||
|
|
||||||
let inscription_id = wait_for_inscription(receiver, channel_id).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?;
|
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?;
|
wait_for_blob(receiver, channel_id, blob_id).await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,6 +51,7 @@ impl ScenarioWorkload for Workload {
|
|||||||
descriptors: &GeneratedTopology,
|
descriptors: &GeneratedTopology,
|
||||||
_run_metrics: &RunMetrics,
|
_run_metrics: &RunMetrics,
|
||||||
) -> Result<(), DynError> {
|
) -> Result<(), DynError> {
|
||||||
|
tracing::info!("initializing transaction workload");
|
||||||
let wallet_accounts = descriptors.config().wallet().accounts.clone();
|
let wallet_accounts = descriptors.config().wallet().accounts.clone();
|
||||||
if wallet_accounts.is_empty() {
|
if wallet_accounts.is_empty() {
|
||||||
return Err("transaction workload requires seeded accounts".into());
|
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;
|
self.accounts = accounts;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn start(&self, ctx: &RunContext) -> Result<(), DynError> {
|
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
|
Submission::new(self, ctx)?.execute().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -158,6 +170,12 @@ impl<'a> Submission<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn execute(mut self) -> Result<(), DynError> {
|
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() {
|
while let Some(input) = self.plan.pop_front() {
|
||||||
submit_wallet_transaction(self.ctx, &input).await?;
|
submit_wallet_transaction(self.ctx, &input).await?;
|
||||||
|
|
||||||
@ -165,6 +183,7 @@ impl<'a> Submission<'a> {
|
|||||||
sleep(self.interval).await;
|
sleep(self.interval).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tracing::info!("transaction submissions finished");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user