public Alerts(Job j, string linkPage) { _job = j; _linkPage = linkPage; foreach (string c in _job.Summary.Categories) { if (c != "") { alertSets.Add(c, FindAlerts(c)); } } AlertSet overall = new AlertSet(); foreach (KeyValuePair <string, AlertSet> kvp in alertSets) { if (kvp.Key != "" && kvp.Value.Messages.Count != 0) { overall.Add(kvp.Value.Level, string.Format("{0} alert{1} in <a href='" + _linkPage + "?cat={2}' style='text-decoration:none;'>{2}</a>.", kvp.Value.Count, kvp.Value.Count == 1 ? "" : "s", kvp.Key)); } } alertSets.Add("", overall); }
protected AlertSet FindAlerts(string cat) { AlertSet res = new AlertSet(); // Check for bugs != 0; This is critical. uint bugs = (cat == "") ? _job.Summary.Overall.Bugs : _job.Summary[cat].Bugs; if (bugs != 0) { res.Add(AlertLevel.Critical, string.Format("There {0} {1} bug{2}.", bugs == 1 ? "is" : "are", bugs, bugs == 1 ? "" : "s")); } // Infrastructure errors; this is just an information. uint ierrs = (cat == "") ? _job.Summary.Overall.InfrastructureErrors : _job.Summary[cat].InfrastructureErrors; if (ierrs != 0) { res.Add(AlertLevel.None, string.Format("There {0} {1} infrastructure error{2}.", ierrs == 1 ? "is" : "are", ierrs, ierrs == 1 ? "" : "s")); } // Check for errors != 0; this is just a warning. uint errors = (cat == "") ? _job.Summary.Overall.Errors : _job.Summary[cat].Errors; if (errors != 0) { res.Add(AlertLevel.Warning, string.Format("There {0} {1} error{2}.", errors == 1 ? "is" : "are", errors, errors == 1 ? "" : "s")); } // See whether something got slower. int dippers = (cat == "") ? _job.Dippers[""].Count : _job.Dippers[cat].Count; if (dippers != 0) { res.Add(AlertLevel.None, string.Format("There {0} {1} benchmark{2} that show{3} a dip in performance.", dippers == 1 ? "is" : "are", dippers, dippers == 1 ? "" : "s", dippers == 1 ? "s" : "")); } return(res); }
public Alerts(Job j, string linkPage) { _job = j; _linkPage = linkPage; foreach (string c in _job.Summary.Categories) if (c != "") alertSets.Add(c, FindAlerts(c)); AlertSet overall = new AlertSet(); foreach (KeyValuePair<string, AlertSet> kvp in alertSets) { if (kvp.Key != "" && kvp.Value.Messages.Count != 0) overall.Add(kvp.Value.Level, string.Format("{0} alert{1} in <a href='" + _linkPage + "?cat={2}' style='text-decoration:none;'>{2}</a>.", kvp.Value.Count, kvp.Value.Count == 1 ? "" : "s", kvp.Key)); } alertSets.Add("", overall); }
protected AlertSet FindAlerts(string cat) { AlertSet res = new AlertSet(); // Check for bugs != 0; This is critical. uint bugs = (cat == "") ? _job.Summary.Overall.Bugs : _job.Summary[cat].Bugs; if (bugs != 0) { res.Add(AlertLevel.Critical, string.Format("There {0} {1} bug{2}.", bugs == 1 ? "is" : "are", bugs, bugs == 1 ? "" : "s")); } // Infrastructure errors; this is just an information. uint ierrs = (cat == "") ? _job.Summary.Overall.InfrastructureErrors : _job.Summary[cat].InfrastructureErrors; if (ierrs != 0) { res.Add(AlertLevel.None, string.Format("There {0} {1} infrastructure error{2}.", ierrs == 1 ? "is" : "are", ierrs, ierrs == 1 ? "" : "s")); } // Check for errors != 0; this is just a warning. uint errors = (cat == "") ? _job.Summary.Overall.Errors : _job.Summary[cat].Errors; if (errors != 0) { res.Add(AlertLevel.Warning, string.Format("There {0} {1} error{2}.", errors == 1 ? "is" : "are", errors, errors == 1 ? "" : "s")); } // See whether something got slower. int dippers = (cat == "") ? _job.Dippers[""].Count : _job.Dippers[cat].Count; if (dippers != 0) { res.Add(AlertLevel.None, string.Format("There {0} {1} benchmark{2} that show{3} a dip in performance.", dippers == 1 ? "is" : "are", dippers, dippers == 1 ? "" : "s", dippers == 1 ? "s" : "")); } return res; }