Run Benchmark Method run only once BenchmarkDotNet

Viewed 44

I have a method which posts to external web api

    [Benchmark]
    public async Task SendData()
    {
        var Messages = new List<Messages>() {Data.SampleMessage)};
        
        var service= _host.Services.GetService<ISendMessages>()!;
        var response = await service.SendMesages(Messages);

    }

and have this count setup as follows: IterationCount=1, WarmupCount = 0, LaunchCount = 0 ,InvocationCount=1, UnrollFactor=1

what i want is run this method just once but i can't since that external api is called twice and when i send 5 messages 10 messages are posted. Please tell me why this is happening.Thanks

0 Answers
Related