chaliasos
chaliasos

Reputation: 9783

PerformanceCounterType for average time

I have created some Load Tests to an HTTP server which consist of simple Unit Tests. Each unit test sends an http request to the server. Now I want to keep some extra information about each load test run so I created customs performance counters.

For example, I have a counter for the timeouts. Every time a timeout occur I increment the counter which is of type NumberOfItems32, so at the end of the Load Test I can see the total timeouts number.

My problem is that I want to create a counter that will keep the average response time to the http calls. Which PerformanceCounterType should I use and how?

EDIT
I thought that the AverageTimer32 would be the right one to use but the MSDN description is:

Counters of this type display a ratio of the total elapsed time of the sample interval to the number of processes or operations completed during that time

I don't want this. At each unit test run I calculate the response time so I thing that with the appropriate counter only the following code should work:

responseTimeCounter.IncrementBy(responseTime);

Upvotes: 1

Views: 1021

Answers (1)

Jakub Konecki
Jakub Konecki

Reputation: 46008

Go for NumberOfItems32 counter as you want to capture a number.

Upvotes: 1

Related Questions