public SuccessRateMonitor(Type monitorType, string name, ExecutionMonitor monitor, long itemThreshold, TimeSpan timeThreshold) : base(monitorType, name) { _monitor = monitor; InitializePreviousValues(); _itemThreshold = itemThreshold; _timeThreshold = timeThreshold.Ticks; }
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); }
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); }
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)) { }