diff --git a/site/app.js b/site/app.js index b49304a..c85aa6c 100644 --- a/site/app.js +++ b/site/app.js @@ -764,6 +764,35 @@ const render = async () => { const uptimePercent = document.getElementById('uptimePercent'); uptimePercent.textContent = `${(uptime * 100).toFixed(2)}% uptime`; + const acquisitionDate = new Date('2018-10-26T00:00:00Z'); // https://blogs.microsoft.com/blog/2018/10/26/microsoft-completes-github-acquisition/ + + const acquisitionDowntimeIntervals = windowEntries + .filter((entry) => { + return countsAsDowntime(entry.impact) && entry.end instanceof Date && entry.end > acquisitionDate; + }) + .map((entry) => { + const start = entry.start < acquisitionDate ? acquisitionDate : entry.start; + return [start, entry.end]; + }); + + const mergedAcquisitionDowntime = mergeIntervals(acquisitionDowntimeIntervals); + + const acquisitionDowntimeMinutes = mergedAcquisitionDowntime.reduce( + (total, [start, end]) => total + minutesBetween(start, end), + 0 + ); + + const acquisitionTotalMinutes = Math.max(1, minutesBetween(acquisitionDate, now)); + const acquisitionUptime = 1 - acquisitionDowntimeMinutes / acquisitionTotalMinutes; + + const sinceAcquisitionEl = document.getElementById('sinceAcquisitionStat'); + if (sinceAcquisitionEl) { + sinceAcquisitionEl.innerHTML = + `${(acquisitionUptime * 100).toFixed(2)}% uptime since ` + + `Microsoft acquired GitHub`; + } + const uptimeBars = document.getElementById('uptimeBars'); const uptimeTooltip = document.getElementById('uptimeTooltip'); const heroPanel = document.querySelector('.hero-panel'); diff --git a/site/index.html b/site/index.html index cddb66c..0634aaf 100644 --- a/site/index.html +++ b/site/index.html @@ -214,6 +214,14 @@

About this mirror

2019 (new)

+ +
+
+

Other stats

+
+

+

Calculated from incident downtime windows since October 26, 2018 (excluding scheduled maintenance).

+