/// <summary> /// Diagnose a list of jobs. /// </summary> /// <param name="jobs">Jobs to diagnose.</param> /// <param name="config">Cluster configuration.</param> /// <param name="manager">Communicatino manager.</param> public static List <DiagnosisLog> DiagnoseJobs(IEnumerable <DryadLinqJobSummary> jobs, ClusterConfiguration config, CommManager manager) { var dryadLinqJobSummaries = jobs as DryadLinqJobSummary[] ?? jobs.ToArray(); int jobCount = dryadLinqJobSummaries.Count(); List <DiagnosisLog> result = new List <DiagnosisLog>(); int done = 0; foreach (DryadLinqJobSummary summary in dryadLinqJobSummaries) { if (summary == null) { continue; } manager.Token.ThrowIfCancellationRequested(); JobFailureDiagnosis diagnosis = JobFailureDiagnosis.CreateJobFailureDiagnosis(config, summary, manager); manager.Status("Diagnosing " + summary.ShortName(), StatusKind.LongOp); DiagnosisLog log = diagnosis.Diagnose(); result.Add(log); done++; manager.Progress(done * 100 / jobCount); } manager.Status("Diagnosis complete", StatusKind.OK); return(result); }
/// <summary> /// Diagnose a vertex. /// </summary> /// <returns>The log of the diagnostic.</returns> public DiagnosisLog Diagnose() { DiagnosisLog log = new DiagnosisLog(this.Job, this.Summary); log.AddMessage(new DiagnosisMessage(DiagnosisMessage.Importance.Final, "Diagnostic for " + this.VertexName, "Vertex state is " + this.Vertex.State)); this.Diagnose(log); this.Manager.Status("Vertex diagnosis complete", StatusKind.OK); return(log); }
/// <summary> /// Create a form to show the diagnosis result. /// </summary> /// <param name="job">Job diagnosed; may be null.</param> /// <param name="log">Diagnosis log.</param> /// <param name="summary">Job summary.</param> public DiagnosisResult(DryadLinqJobInfo job, DryadLinqJobSummary summary, DiagnosisLog log) { this.InitializeComponent(); this.job = job; if (this.job == null) this.button_job.Enabled = false; // ReSharper disable once DoNotCallOverridableMethodsInConstructor this.Text = "Diagnosis results for " + summary.Name + " " + summary.Date; this.textBox_job.Text = "Job being diangosed: " + summary.AsIdentifyingString(); foreach (string s in log.Message()) { this.textBox_message.AppendText(s); this.textBox_message.AppendText(Environment.NewLine); } }
/// <summary> /// Create a form to show the diagnosis result. /// </summary> /// <param name="job">Job diagnosed; may be null.</param> /// <param name="log">Diagnosis log.</param> /// <param name="summary">Job summary.</param> public DiagnosisResult(DryadLinqJobInfo job, DryadLinqJobSummary summary, DiagnosisLog log) { this.InitializeComponent(); this.job = job; if (this.job == null) { this.button_job.Enabled = false; } // ReSharper disable once DoNotCallOverridableMethodsInConstructor this.Text = "Diagnosis results for " + summary.Name + " " + summary.Date; this.textBox_job.Text = "Job being diangosed: " + summary.AsIdentifyingString(); foreach (string s in log.Message()) { this.textBox_message.AppendText(s); this.textBox_message.AppendText(Environment.NewLine); } }
/// <summary> /// Diagnose a vertex. /// </summary> /// <returns>The log of the diagnostic.</returns> public DiagnosisLog Diagnose() { DiagnosisLog log = new DiagnosisLog(this.Job, this.Summary); log.AddMessage(new DiagnosisMessage(DiagnosisMessage.Importance.Final, "Diagnostic for " + this.VertexName, "Vertex state is " + this.Vertex.State)); this.Diagnose(log); this.Manager.Status("Vertex diagnosis complete", StatusKind.OK); return log; }
/// <summary> /// The main function of the diagnosis. /// </summary> /// <param name="log">Log where explanation is written.</param> /// <returns>The decision of the diagnosis.</returns> public virtual Decision Diagnose(DiagnosisLog log) { throw new InvalidOperationException("Must override this function"); }
/// <summary> /// Display the result of the diagnosis for the user. /// </summary> /// <param name="log">Log of the diagnosis.</param> private void DisplayDiagnosis(DiagnosisLog log) { DiagnosisResult result = new DiagnosisResult(this.Job, this.Job.Summary, log); result.Show(); }