Skip to content

5. How to view profiling results?

teddymacn edited this page Apr 27, 2016 · 4 revisions

If you are referencing NanoProfiler.Web, the view-result UI is enabled by default, which lists the latest 100 profiling results in a wonderful tree-timeline view (simply visit ~/nanoprofiler/view in your web application).

Sample profiling result UI:

Sample Profiling UI

If you want to change number of results to be listed or if you want to disable this feature or customize filter logic, you could add code like below in your application_start event handler to change its default settings:

ProfilingSession.CircularBuffer = new CircularBuffer<ITimingSession>(200, session => false);
  • The first parameter of CircularBuffer specifies the max number of latest profiling results to be kept;
  • The second parameter is of type Func<ITimingSession, bool>, which is a delegate by which you could filter specified profiling results in the view-result page;

Alternatively, if you only want to change the buffer size, and don't want to chang the filter logic, you could also set the buffer size in the configuration element in web.config as below:

<configuration>
  <configSections>
    <section name="slf4net" type="slf4net.Configuration.SlfConfigurationSection, slf4net" />
    <section name="nanoprofiler" type="EF.Diagnostics.Profiling.Configuration.NanoProfilerConfigurationSection, NanoProfiler" />
  </configSections>
  <nanoprofiler circularBufferSize="200" />
</configuration>