Пример #1
0
 /// <summary>
 ///  terminate the population of performance counters
 /// </summary>
 public static void Terminate()
 {
     try
     {
         if (_instance != null)
         {
             lock (_syncRoot)
             {
                 if (_instance != null)
                 {
                         _instance.Stop();
                         _instance = null;
                 }
             }
         }
     }
     catch (Exception excp)
     {
         _instance = null;
         LogFactory.LogException(excp, "Babalu perfmon counters termination failed");
     }
 }
Пример #2
0
 /// <summary>
 /// Initialize the performance counter objects and thread for the Babalu rProxy
 /// </summary>
 public static void Initialize()
 {
     try
     {
         LogFactory.LogInformation("Babalu Counters initializing");
         if (BabaluConfigurationFactory.Instance.EnablePerfmon)
         {
             if (_instance == null)
             {
                 lock (_syncRoot)
                 {
                     if (_instance == null)
                     {
                         _instance = new BabaluCounters();
                         _instance.Start();
                     }
                 }
             }
         }
     }
     catch (Exception excp)
     {
         _instance = null;
         LogFactory.LogException(excp, "Babalu perfmon counters initialization failed");
     }
 }