Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metrics: split out /Transaction/AssembleBlock metrics #4795

Merged
merged 6 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions data/pools/transactionPool.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,10 +743,13 @@ func (pool *TransactionPool) recomputeBlockEvaluator(committedTxIds map[transact
asmStats.CommittedCount++
stats.RemovedInvalidCount++
case transactions.TxnDeadError:
asmStats.InvalidCount++
asmStats.ExpiredCount++
stats.ExpiredCount++
case transactions.MinFeeError, *ledgercore.LeaseInLedgerError:
asmStats.InvalidCount++
case *ledgercore.LeaseInLedgerError:
asmStats.LeaseErrorCount++
stats.RemovedInvalidCount++
algorandskiy marked this conversation as resolved.
Show resolved Hide resolved
case transactions.MinFeeError:
asmStats.MinFeeErrorCount++
stats.RemovedInvalidCount++
pool.log.Infof("Cannot re-add pending transaction to pool: %v", err)
default:
Expand Down
6 changes: 6 additions & 0 deletions logging/telemetryspec/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ type AssembleBlockStats struct {
StartCount int
IncludedCount int // number of transactions that are included in a block
InvalidCount int // number of transaction groups that are included in a block
MinFeeErrorCount int // number of transactions excluded because the fee is too low
ExpiredCount int // number of transactions removed because of expiration
LeaseErrorCount int // number of transactions removed because it has an already used lease
MinFee uint64
MaxFee uint64
AverageFee uint64
Expand Down Expand Up @@ -100,6 +103,9 @@ func (m AssembleBlockStats) String() string {
b.WriteString(fmt.Sprintf("StartCount:%d, ", m.StartCount))
b.WriteString(fmt.Sprintf("IncludedCount:%d, ", m.IncludedCount))
b.WriteString(fmt.Sprintf("InvalidCount:%d, ", m.InvalidCount))
b.WriteString(fmt.Sprintf("MinFeeErrorCount:%d, ", m.MinFeeErrorCount))
b.WriteString(fmt.Sprintf("ExpiredCount:%d, ", m.ExpiredCount))
b.WriteString(fmt.Sprintf("LeaseErrorCount:%d, ", m.ExpiredCount))
b.WriteString(fmt.Sprintf("MinFee:%d, ", m.MinFee))
b.WriteString(fmt.Sprintf("MaxFee:%d, ", m.MaxFee))
b.WriteString(fmt.Sprintf("AverageFee:%d, ", m.AverageFee))
Expand Down