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