(b *testing.B)
| 71 | } |
| 72 | |
| 73 | func BenchmarkMsgPipelineTargets(b *testing.B) { |
| 74 | testWithCount := func(targetCount int) { |
| 75 | b.Run(strconv.Itoa(targetCount), func(b *testing.B) { |
| 76 | targets := make([]module.DeliveryTarget, 0, targetCount) |
| 77 | for i := 0; i < targetCount; i++ { |
| 78 | targets = append(targets, &testutils.Target{InstName: "target_" + strconv.Itoa(i), DiscardMessages: true}) |
| 79 | } |
| 80 | |
| 81 | d := MsgPipeline{msgpipelineCfg: msgpipelineCfg{ |
| 82 | perSource: map[string]sourceBlock{}, |
| 83 | defaultSource: sourceBlock{ |
| 84 | perRcpt: map[string]*rcptBlock{}, |
| 85 | defaultRcpt: &rcptBlock{ |
| 86 | targets: targets, |
| 87 | }, |
| 88 | }, |
| 89 | }} |
| 90 | |
| 91 | testutils.BenchDelivery(b, &d, "sender@example.org", []string{"rcpt-X@example.org"}) |
| 92 | }) |
| 93 | } |
| 94 | |
| 95 | testWithCount(5) |
| 96 | testWithCount(10) |
| 97 | testWithCount(15) |
| 98 | } |
nothing calls this directly
no test coverage detected