Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use performance counter in self host web application

I would like to stress test my Web Api self host application. This application is hosted on a Azure Worker Role.

I know how to get the performance counter from my Worker Role to my storage (for analytics) but because my web api are self hosted using Microsoft.Owin.Host.HttpListener,I don't know if there is some existing perf counters on which I can plug.

I've tried several counters perfmon :

  • AspNet Application
  • Web Service (this only allow me to select Web Application defined in IIS)

When I select the Process, I don't have the interesting counter like req/sec etc...

Is there a way to activate some counters for a Self Hosted Owin Application ?

only using configuration that I don't made? using an other self host? using additional components and modify my code? (adding attributes ..., I've seen something like that https://github.com/aliostad/PerfIt )

Thanks a lot.

like image 914
Jeremie Devillard Avatar asked May 01 '14 22:05

Jeremie Devillard


People also ask

What is the use of performance counter?

Performance counters are bits of code that monitor, count, or measure events in software, which allow us to see patterns from a high-level view. They are registered with the operating system during installation of the software, allowing anyone with the proper permissions to view them.

How do I turn on my performance counter?

In the navigation pane, expand Monitoring Tools, and then choose Performance Monitor. In the console pane toolbar, choose the Add button. In the Add Counters window, in the Select counters from computer drop-down list, choose the computer that is running Business Central Server.

Where are performance counters stored?

When you run a Data Collector Set, the data that is collected for performance counters is stored to a log file (. blg) in the location that was defined when the Data Collector Set was created. In Windows Performance Monitor, you can view log files to see a visual representation of performance counter data.


1 Answers

I see you mentioned diagnostics, these are what I used in diagnostics:

<PerformanceCounterConfiguration counterSpecifier="\Asp.net\Request Execution Time" sampleRate="PT1M" />
                <PerformanceCounterConfiguration counterSpecifier="\ASP.net\Requests Rejected" sampleRate="PT1M" />
                <PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\Current Connections" sampleRate="PT1M" />
                <PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\Connection Attempts/sec" sampleRate="PT1M" />

What I did, was go into perfmon and right clicked "add counter" on my dev machine and then typed the names of what looked intersesting to me into cmd prompt like this:

typeperf "\Web Service(_Total)\Connection Attempts/sec"

I was able to test many out to see what was useful.

hope it helps,

=Devon

like image 127
DevOpsDevon Avatar answered Oct 07 '22 16:10

DevOpsDevon