Exemple #1
0
        public static ActionResult InstallPerformanceCounters(Session session)
        {
            session.Log("Installing NSB performance counters.");

            try
            {
                CaptureOut(() =>
                {
                    if (PerformanceCounterSetup.SetupCounters(true))
                    {
                        session.Log("NSB performance counters installed.");
                    }
                    else
                    {
                        session.Log("NSB performance counters already installed.");
                    }
                }, session);

                return(ActionResult.Success);
            }
            catch (Exception)
            {
                return(ActionResult.Failure);
            }
        }
Exemple #2
0
        public void Install(WindowsIdentity identity)
        {
            Console.WriteLine("Starting installation of PerformanceCounters ");

            PerformanceCounterSetup.SetupCounters(true);

            Console.WriteLine("Installation of PerformanceCounters successful.");
        }
 public void DoAllCountersExist_returns_true_when_all_exist()
 {
     PerformanceCounterSetup.SetupCounters();
     PerformanceCounter.CloseSharedResources();
     Assert.IsTrue(PerformanceCounterSetup.CheckCounters());
 }