/// <summary> /// Stop Listening to the given BenchmarkSystem /// </summary> /// <param name="bs">The BenchmarkSystem to stop listening to</param> public void Unsubscribe(BenchmarkSystem bs) { bs.JobSubmitted -= OnJobSubmitted; bs.JobCancelled -= OnJobCancelled; bs.JobRunning -= OnJobRunning; bs.JobTerminated -= OnJobTerminated; bs.JobFailed -= OnJobFailed; }
public static BenchmarkSystem GetBenchmarkSystem() { if (bs == null) { bs = new BenchmarkSystem(); } return bs; }
private static void CreateRandomJobs(BenchmarkSystem bs) { while (true) { Job job = CreateRandomJob(); bs.Submit(job); Random rnd = new Random(); //Sleep between 0 and 5 seconds Thread.Sleep((int)(rnd.NextDouble() * 500)); } }