BenchmarkIsInflightTransaction measures the inflight status check
(b *testing.B)
| 339 | |
| 340 | // BenchmarkIsInflightTransaction measures the inflight status check |
| 341 | func 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 |
| 363 | func BenchmarkCreateQueueCopy(b *testing.B) { |
nothing calls this directly
no test coverage detected