MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / renderReliabilityChart

Function renderReliabilityChart

tests/loadtest/tools/dashboard/app.js:716–734  ·  view source on GitHub ↗
(series, overview)

Source from the content-addressed store, hash-verified

714}
715
716function 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
736function renderCompareReliability(leftRun, rightRun) {
737 const compareKey = hasValue(leftRun.overview?.apdex) && hasValue(rightRun.overview?.apdex) ? "apdex" : "successRate";

Callers 1

renderDashboardFunction · 0.85

Calls 4

lineChartFunction · 0.85
formatDecimalFunction · 0.85
formatPercentFunction · 0.85
emptyBlockFunction · 0.85

Tested by

no test coverage detected