예제 #1
0
    /// <summary>
    /// Clear counters.
    /// </summary>
    protected void ClearCounters(object sender = null, EventArgs args = null)
    {
        if (StopProcessing)
        {
            return;
        }

        try
        {
            // Reset values of health monitoring counters
            HealthMonitoringManager.ResetCounters();
            // Clear application counters
            HealthMonitoringLogHelper.ClearApplicationCounters();

            // Log event
            EventLogProvider.LogEvent(EventType.INFORMATION, "System", "CLEARCOUNTERS", GetString("Administration-System.CountersCleared"));

            string url = URLHelper.UpdateParameterInUrl(RequestContext.CurrentURL, "lastaction", "CounterCleared");
            URLHelper.Redirect(url);
        }
        catch (Exception ex)
        {
            // ThreadAbortException is thrown when response is ended (redirect)
            if (!(ex is ThreadAbortException))
            {
                LogAndShowError("System", "CLEARCOUNTERS", ex);
            }
        }
    }
예제 #2
0
    /// <summary>
    /// Clear counters.
    /// </summary>
    protected void btnClearCounters_Click(object sender, EventArgs e)
    {
        if (StopProcessing)
        {
            return;
        }

        // Reset values of health monitoring counters
        HealthMonitoringManager.ResetCounters();
        // Clear application counters
        HealthMonitoringLogHelper.ClearApplicationCounters();

        // Log event
        EventLogProvider eventLog = new EventLogProvider();

        eventLog.LogEvent(EventLogProvider.EVENT_TYPE_INFORMATION, DateTime.Now, "System", "CLEARCOUNTERS", null, GetString("Administration-System.CountersCleared"));

        string url = URLHelper.UpdateParameterInUrl(URLRewriter.CurrentURL, "lastaction", "CounterCleared");

        URLHelper.Redirect(url);
    }