We have an application gathering counter statistics and we would like the values to reset after executing the iisreset
command and that's all.
Microsoft says Application_Start
is:
Called when the first resource (such as a page) in an ASP.NET application is requested. The Application_Start method is called only one time during the life cycle of an application. You can use this method to perform startup tasks such as loading data into the cache and initializing static values.
This is how we're currently doing it:
protected void Application_Start(object sender, EventArgs e)
{
_counters.Get<AutoCounter>("TAS:RequestCount").Reset();
_counters.Get<AutoCounter>("TAS:RequestTime").Reset();
_counters.Get<AutoCounter>("TAS:TimeBetweenErrors").Reset();
_counters.Get<AutoCounter>("TAS:ErrorCount").Reset();
}
However, these are resetting at unexpected intervals. What determines when the application domain's life-cycle ends and this method is called on the next request?