Skip to content

Commit

Permalink
rename vars for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
anusha-ctrl committed Jul 19, 2023
1 parent c81454e commit 2fb7c3b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/simulator/txs/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ func (a issueNAgent[T]) Execute(ctx context.Context, m *metrics.Metrics) error {
if !moreTxs {
break L
}
start := time.Now()
issuanceIndividualStart := time.Now()
if err := a.worker.IssueTx(ctx, tx); err != nil {
return fmt.Errorf("failed to issue transaction %d: %w", len(txs), err)
}
issuanceTime := time.Since(start)
m.IssuanceTxTimes.Observe(issuanceTime.Seconds())
issuanceIndividualTime := time.Since(issuanceIndividualStart)
m.IssuanceTxTimes.Observe(issuanceIndividualTime.Seconds())
txs = append(txs, tx)
}
}
Expand All @@ -108,12 +108,12 @@ func (a issueNAgent[T]) Execute(ctx context.Context, m *metrics.Metrics) error {
// Wait for txs in this batch to confirm
confirmedStart := time.Now()
for i, tx := range txs {
start := time.Now()
confirmedIndividualStart := time.Now()
if err := a.worker.ConfirmTx(ctx, tx); err != nil {
return fmt.Errorf("failed to await transaction %d: %w", i, err)
}
confirmationTime := time.Since(start)
m.ConfirmationTxTimes.Observe(confirmationTime.Seconds())
confirmationIndividualTime := time.Since(confirmedIndividualStart)
m.ConfirmationTxTimes.Observe(confirmationIndividualTime.Seconds())
confirmedCount++
}
// Get the batch's confirmation time and add it to totalConfirmedTime
Expand Down

0 comments on commit 2fb7c3b

Please sign in to comment.