Beispiel #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;
        }
Beispiel #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;
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #5
0
 public SuccessRateMonitor(Type monitorType, string name, ExecutionMonitor monitor)
     : this(monitorType, name, monitor, 100, 5.Seconds())
 {
 }
Beispiel #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))
 {
 }