/// <summary> /// Cancel a job in the benchmarksystem /// </summary> /// <param name="job">The job to cancel</param> public void Cancel(Job job) { //Notify subscribers if (JobCancelled != null) { JobCancelled(job); } scheduler.RemoveJob(job); }
//Adds a specific job to the correct queue public void AddJob(Job job) { job.State = JobState.Queued; job.TimeStamp = DateTime.Now; if(job.ExpectedRuntime < 30) { shortQueue.Enqueue(job); } else if(30 <= job.ExpectedRuntime && job.ExpectedRuntime <= 120){ longQueue.Enqueue(job); } else{ veryLongQueue.Enqueue(job); } }
//Remove a job from a specified queue public void RemoveJob(Job job) { job.State = JobState.Cancelled; }
public void OnJobTerminated(Job job) { Console.WriteLine(string.Format("Job terminated: {0}", job)); }
public void OnJobSubmitted(Job job) { Console.WriteLine(string.Format("Job submitted: {0}", job)); }
public void OnJobRunning(Job job) { Console.WriteLine(string.Format("Job running: {0}", job)); }
public void OnJobFailed(Job job) { Console.WriteLine(string.Format("Job failed: {0}", job)); }
public void OnJobCancelled(Job job) { Console.WriteLine(string.Format("Job cancelled: {0}", job)); }
/// <summary> /// Submit a job to the benchmarksystem /// </summary> /// <param name="job">The job to submit</param> public void Submit(Job job) { //Notify subscribers if (JobSubmitted != null) { JobSubmitted(job); } scheduler.AddJob(job); }