kiran iqbal
kiran iqbal

Reputation: 41

Getting Performance Results using benchmarkdotnet in ASP.net MVC

I am testing benchmark library to measure the performance of the code. I am reading up the documentation.

I am not able to figure out how to print out results of benchmarks. I have a class called user and i want to bechmark the following method.

[Benchmark]
public bool FollowerAdded(User newFollower)
{
    // code for notifying user that they have an added follower
    Notification notification = new Notification();
    return notification.NotifyUser(this, newFollower.UserName + " is now following you!");
}

In the documentation of benchmarkdot net, Use the following code to get printout of bechmarks.

var summary = BenchmarkRunner.Run<User>();

Where can we put this code to get the results in case of Asp.net MVC application to get the benchmarking results?

here is the URL of the library http://benchmarkdotnet.org/GettingStarted.htm

Upvotes: 4

Views: 1889

Answers (1)

Adrian Rus
Adrian Rus

Reputation: 359

A bit late but here it goes,

Probably you need a console application project to reference your library and run the benchmark, after running it the results will be printed on the console and the reports will be located in

summary.ResultsDirectoryPath

typically

$(TargetDir)BenchmarkDotNet.Artifacts\results\

Upvotes: 1

Related Questions