(series, overview)
| 714 | } |
| 715 | |
| 716 | function renderReliabilityChart(series, overview) { |
| 717 | const key = series.some((point) => point.apdex !== null && point.apdex !== undefined) ? "apdex" : "successRate"; |
| 718 | const withData = series.filter((point) => point[key] !== null && point[key] !== undefined); |
| 719 | if (withData.length >= 2) { |
| 720 | elements.reliabilityChart.innerHTML = lineChart({ |
| 721 | series: withData, |
| 722 | valueKey: key, |
| 723 | label: key === "apdex" ? "Apdex" : "Success rate", |
| 724 | formatter: key === "apdex" ? formatDecimal : formatPercent, |
| 725 | min: 0, |
| 726 | max: 1, |
| 727 | }); |
| 728 | return; |
| 729 | } |
| 730 | |
| 731 | const single = key === "apdex" ? overview.apdex : overview.successRate; |
| 732 | const display = key === "apdex" ? formatDecimal(single) : formatPercent(single); |
| 733 | elements.reliabilityChart.innerHTML = emptyBlock(display === "n/a" ? "No reliability metric was exported for this run." : `Overall ${key === "apdex" ? "Apdex" : "success rate"}: ${display}`); |
| 734 | } |
| 735 | |
| 736 | function renderCompareReliability(leftRun, rightRun) { |
| 737 | const compareKey = hasValue(leftRun.overview?.apdex) && hasValue(rightRun.overview?.apdex) ? "apdex" : "successRate"; |
no test coverage detected