MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / BenchmarkIsInflightTransaction

Function BenchmarkIsInflightTransaction

transaction_benchmark_test.go:341–360  ·  view source on GitHub ↗

BenchmarkIsInflightTransaction measures the inflight status check

(b *testing.B)

Source from the content-addressed store, hash-verified

339
340// BenchmarkIsInflightTransaction measures the inflight status check
341func BenchmarkIsInflightTransaction(b *testing.B) {
342 txnInflight := &model.Transaction{
343 Status: StatusInflight,
344 MetaData: map[string]interface{}{"inflight": true},
345 }
346 txnQueued := &model.Transaction{
347 Status: StatusQueued,
348 MetaData: map[string]interface{}{"inflight": true},
349 }
350 txnApplied := &model.Transaction{
351 Status: StatusApplied,
352 }
353
354 transactions := []*model.Transaction{txnInflight, txnQueued, txnApplied}
355
356 b.ResetTimer()
357 for i := 0; i < b.N; i++ {
358 _ = IsInflightTransaction(transactions[i%3])
359 }
360}
361
362// BenchmarkCreateQueueCopy measures queue copy creation for split transactions
363func BenchmarkCreateQueueCopy(b *testing.B) {

Callers

nothing calls this directly

Calls 1

IsInflightTransactionFunction · 0.85

Tested by

no test coverage detected