CreatePerformanceCounter() публичный статический Метод

public static CreatePerformanceCounter ( string id ) : PerformanceCounter
id string
Результат System.Diagnostics.PerformanceCounter
Пример #1
0
        /*
         *  Method:     Start
         *  Purpose:    This method encompasses the code to interrogate the
         *  application's web configuration file and start the timers needed
         *  for black box genration and reporting to occur.
         */
        public void Start()
        {
            bool exceptionOccurred = false;

            try {
                rollupExecutionTimePerformanceCounter = InstallerInfo.CreatePerformanceCounter("RollupExecution");

                millisecondsToRollupData = ServerSettings.MillisecondsToRollupData;

                if (ServerSettings.SpeciesDsn != string.Empty)
                {
                    dsn                     = ServerSettings.SpeciesDsn;
                    reportingTimer          = new Timer();
                    reportingTimer.Interval = millisecondsToRollupData;
                    reportingTimer.Elapsed += new ElapsedEventHandler(OnReportingTimerElapsed);
                    reportingTimer.Enabled  = true;
                    isStarted               = true;
                }
                else
                {
                    InstallerInfo.WriteEventLog("Report", "Can't do rollups: Couldn't find Species entry in settings section of config file.");
                }
            }
            catch (Exception e) {
                exceptionOccurred = true;
                InstallerInfo.WriteEventLog("Report", e.ToString());
            }

            if (!exceptionOccurred)
            {
                InstallerInfo.WriteEventLog("Report", "NonPageServices started. Rolling up data every " + (millisecondsToRollupData / 1000).ToString() + " seconds.", EventLogEntryType.Information);
            }
        }
Пример #2
0
 /*
  *      Method:     SpeciesService
  */
 /// <summary>
 /// This function creates the performance counters used	to display performance results.
 /// </summary>
 static SpeciesService()
 {
     try
     {
         speciesAllPerformanceCounter       = InstallerInfo.CreatePerformanceCounter("AllSpecies");
         speciesAllFailedPerformanceCounter = InstallerInfo.CreatePerformanceCounter("AllFailedSpecies");
     }
     catch (Exception e)
     {
         InstallerInfo.WriteEventLog("PerformanceCounters", "Could not create Performance Counter: " + e.ToString());
     }
 }
Пример #3
0
 /*
  *      Method:     ReportingService
  *      Purpose:    This static constructor initializes all performance
  *      counters used by this reporting service.
  */
 static ReportingService()
 {
     try
     {
         reportingAllPerformanceCounter       = InstallerInfo.CreatePerformanceCounter("AllReporting");
         reportingAllFailedPerformanceCounter = InstallerInfo.CreatePerformanceCounter("AllFailedReporting");
     }
     catch (Exception e)
     {
         InstallerInfo.WriteEventLog("PerformanceCounters", "Could not create Performance Counter: " + e.ToString());
     }
 }
Пример #4
0
 /// <summary>
 /// Instantiates performance counters for the PeerDiscoveryService.
 /// </summary>
 static PeerDiscoveryService()
 {
     try
     {
         discoveryAllPerformanceCounter                  = InstallerInfo.CreatePerformanceCounter("AllDiscovery");
         discoveryAllFailuresPerformanceCounter          = InstallerInfo.CreatePerformanceCounter("AllDiscoveryErrors");
         discoveryRegistrationPerformanceCounter         = InstallerInfo.CreatePerformanceCounter("Registration");
         discoveryRegistrationFailuresPerformanceCounter = InstallerInfo.CreatePerformanceCounter("RegistrationErrors");
     }
     catch (Exception e)
     {
         InstallerInfo.WriteEventLog("PerformanceCounters", "could not create Performance Counter: " + e.ToString());
     }
 }