Example #1
0
        public SuccessRateMonitor(Type monitorType, string name, ExecutionMonitor monitor, long itemThreshold, TimeSpan timeThreshold)
            : base(monitorType, name)
        {
            _monitor = monitor;

            InitializePreviousValues();

            _itemThreshold = itemThreshold;
            _timeThreshold = timeThreshold.Ticks;
        }
Example #2
0
        public SuccessRateMonitor(Type monitorType, string name, ExecutionMonitor monitor, long itemThreshold, TimeSpan timeThreshold)
            : base(monitorType, name)
        {
            _monitor = monitor;

            InitializePreviousValues();

            _itemThreshold = itemThreshold;
            _timeThreshold = timeThreshold.Ticks;
        }
Example #3
0
        public void The_accumulator_should_propertly_keep_track_of_good_and_evil()
        {
            ExecutionMonitor monitor = new ExecutionMonitor(typeof (Counter_Specs), "Test");

            SuccessRateMonitor aggregate = new SuccessRateMonitor(typeof (Counter_Specs), "Test", monitor);

            monitor.IncrementCompleted();
            monitor.IncrementFailed();

            Assert.AreEqual(50, aggregate.SuccessRate);
        }
Example #4
0
        public void A_counter_should_increment()
        {
            ExecutionMonitor monitor = new ExecutionMonitor(typeof (Counter_Specs), "Test");

            monitor.IncrementStarted();
            monitor.IncrementCompleted();

            Assert.AreEqual(1, monitor.Started);
            Assert.AreEqual(1, monitor.Completed);
            Assert.AreEqual(0, monitor.Failed);
        }
Example #5
0
 public SuccessRateMonitor(Type monitorType, string name, ExecutionMonitor monitor)
     : this(monitorType, name, monitor, 100, 5.Seconds())
 {
 }
Example #6
0
 public SuccessRateMonitor(Type monitorType, string name, ExecutionMonitor monitor)
     : this(monitorType, name, monitor, 100, 5.Seconds())
 {
 }
 public SuccessRateMonitor(Type monitorType, string name, ExecutionMonitor monitor)
     : this(monitorType, name, monitor, 100, TimeSpan.FromSeconds(5))
 {
 }