(b *testing.B)
| 42 | } |
| 43 | |
| 44 | func BenchmarkMsgPipelineGlobalChecks(b *testing.B) { |
| 45 | testWithCount := func(checksCount int) { |
| 46 | b.Run(strconv.Itoa(checksCount), func(b *testing.B) { |
| 47 | checks := make([]module.Check, 0, checksCount) |
| 48 | for i := 0; i < checksCount; i++ { |
| 49 | checks = append(checks, &testutils.Check{InstName: "check_" + strconv.Itoa(i)}) |
| 50 | } |
| 51 | |
| 52 | target := testutils.Target{InstName: "test_target", DiscardMessages: true} |
| 53 | d := MsgPipeline{msgpipelineCfg: msgpipelineCfg{ |
| 54 | globalChecks: checks, |
| 55 | perSource: map[string]sourceBlock{}, |
| 56 | defaultSource: sourceBlock{ |
| 57 | perRcpt: map[string]*rcptBlock{}, |
| 58 | defaultRcpt: &rcptBlock{ |
| 59 | targets: []module.DeliveryTarget{&target}, |
| 60 | }, |
| 61 | }, |
| 62 | }} |
| 63 | |
| 64 | testutils.BenchDelivery(b, &d, "sender@example.org", []string{"rcpt-X@example.org"}) |
| 65 | }) |
| 66 | } |
| 67 | |
| 68 | testWithCount(5) |
| 69 | testWithCount(10) |
| 70 | testWithCount(15) |
| 71 | } |
| 72 | |
| 73 | func BenchmarkMsgPipelineTargets(b *testing.B) { |
| 74 | testWithCount := func(targetCount int) { |
nothing calls this directly
no test coverage detected