protected override void ProcessRecord()
 {
     if (ShouldProcess(Environment.MachineName))
     {
         PerformanceCounterSetup.SetupCounters();
     }
 }
        protected override void ProcessRecord()
        {
            var countersAreGood = PerformanceCounterSetup.CheckCounters();

            WriteVerbose(countersAreGood
                             ? "NServiceBus Performance Counters are setup and ready for use with NServiceBus."
                             : "NServiceBus Performance Counters are not properly configured.");

            WriteObject(countersAreGood);
        }
        protected override void ProcessRecord()
        {
            var countersAreGood = new PerformanceCounterSetup(Host).CheckCounters();

            var status = countersAreGood
                ? "NServiceBus Performance Counters are setup and ready for use with NServiceBus."
                : "NServiceBus Performance Counters are not properly configured.";

            WriteObject(new InstallationResult { Installed = countersAreGood, Message = status });
            
        }
        protected override void ProcessRecord()
        {
            var countersAreGood = new PerformanceCounterSetup(Host).CheckCounters();

            var status = countersAreGood
                ? "NServiceBus Performance Counters are setup and ready for use with NServiceBus."
                : "NServiceBus Performance Counters are not properly configured.";

            WriteObject(new InstallationResult {
                Installed = countersAreGood, Message = status
            });
        }
 protected override void ProcessRecord()
 {
     var performanceCounterSetup = new PerformanceCounterSetup(Host);
     if (performanceCounterSetup.DoesCategoryExist())
     {
         performanceCounterSetup.DeleteCategory();
     }
     else
     {
         WriteWarning("NServiceBus Performance Counters were not installed");
     }
 }
        protected override void ProcessRecord()
        {
            var performanceCounterSetup = new PerformanceCounterSetup(Host);

            if (performanceCounterSetup.DoesCategoryExist())
            {
                performanceCounterSetup.DeleteCategory();
            }
            else
            {
                WriteWarning("NServiceBus Performance Counters were not installed");
            }
        }
 void ForceCreate()
 {
     var setup = new PerformanceCounterSetup(Host);
     try
     {
        setup.DeleteCategory();
     }
     catch (Exception exception)
     {
         var errorRecord = new ErrorRecord(exception, "FailedToDeleteCategory", ErrorCategory.NotSpecified, null);
         ThrowTerminatingError(errorRecord);
     }
     setup.SetupCounters();
 }
        void ForceCreate()
        {
            var setup = new PerformanceCounterSetup(Host);

            try
            {
                setup.DeleteCategory();
            }
            catch (Exception exception)
            {
                var errorRecord = new ErrorRecord(exception, "FailedToDeleteCategory", ErrorCategory.NotSpecified, null);
                ThrowTerminatingError(errorRecord);
            }
            setup.SetupCounters();
        }
Example #9
0
 void ForceCreate()
 {
     try
     {
         Host.UI.WriteLine("Deleting counters");
         PerformanceCounterSetup.DeleteCategory();
     }
     catch (Exception exception)
     {
         var errorRecord = new ErrorRecord(exception, "FailedToDeleteCategory", ErrorCategory.NotSpecified, null);
         ThrowTerminatingError(errorRecord);
     }
     Host.UI.WriteLine("Creating counters");
     PerformanceCounterSetup.SetupCounters();
 }
        void Create()
        {
            var setup = new PerformanceCounterSetup(Host);
            var allCountersExist = setup.CheckCounters();
            if (allCountersExist)
            {
                return;
            }

            if (setup.DoesCategoryExist())
            {
                var exception = new Exception("Existing category is not configured correctly. Use the -Force option to delete and re-create");
                var errorRecord = new ErrorRecord(exception, "FailedToCreateCategory", ErrorCategory.NotSpecified, null);
                ThrowTerminatingError(errorRecord);
            }
            setup.SetupCounters();
        }
        void Create()
        {
            var setup            = new PerformanceCounterSetup(Host);
            var allCountersExist = setup.CheckCounters();

            if (allCountersExist)
            {
                return;
            }

            if (setup.DoesCategoryExist())
            {
                var exception   = new Exception("Existing category is not configured correctly. Use the -Force option to delete and re-create");
                var errorRecord = new ErrorRecord(exception, "FailedToCreateCategory", ErrorCategory.NotSpecified, null);
                ThrowTerminatingError(errorRecord);
            }
            setup.SetupCounters();
        }
Example #12
0
        void Create()
        {
            var allCountersExist = PerformanceCounterSetup.CheckCounters();

            if (allCountersExist)
            {
                Host.UI.WriteLine("Did not create counters since they already exist");
                return;
            }

            if (PerformanceCounterSetup.DoesCategoryExist())
            {
                var exception   = new Exception("Existing category is not configured correctly. Use the -Force option to delete and re-create");
                var errorRecord = new ErrorRecord(exception, "FailedToCreateCategory", ErrorCategory.NotSpecified, null);
                ThrowTerminatingError(errorRecord);
            }

            Host.UI.WriteLine("Creating counters");
            PerformanceCounterSetup.SetupCounters();
        }
Example #13
0
        protected override void Process()
        {
            bool coutersIsGood;

            if (!ShouldProcess(Environment.MachineName))
            {
                coutersIsGood = PerformanceCounterSetup.SetupCounters();

                Host.UI.WriteLine(coutersIsGood
                                          ? "Performance Counters is setup and ready for use with NServiceBus"
                                          : "Performance Counters is not properly configured");

                WriteObject(coutersIsGood);
                return;
            }

            coutersIsGood = PerformanceCounterSetup.SetupCounters(true);

            WriteObject(coutersIsGood);
        }