diff --git a/client/Stats.js b/client/Stats.js index 9c70e67..ad8c0f1 100644 --- a/client/Stats.js +++ b/client/Stats.js @@ -39,20 +39,6 @@ class Stats extends React.Component { const since = parseDate(totals.since) const until = parseDate(totals.until) - // Protocols - const protocolRows = Object.keys(totals.requests.protocol).sort((a, b) => { - return totals.requests.protocol[b] - totals.requests.protocol[a] - }).map(protocol => { - const requests = totals.requests.protocol[protocol] - - return ( - - {protocol} - {formatNumber(requests)} ({formatPercent(requests / sumValues(totals.requests.protocol))}%) - - ) - }) - // Packages const packageRows = [] @@ -129,26 +115,24 @@ class Stats extends React.Component { } }) + // Protocols + const protocolRows = Object.keys(totals.requests.protocol).sort((a, b) => { + return totals.requests.protocol[b] - totals.requests.protocol[a] + }).map(protocol => { + const requests = totals.requests.protocol[protocol] + + return ( + + {protocol} + {formatNumber(requests)} ({formatPercent(requests / sumValues(totals.requests.protocol))}%) + + ) + }) + return (

From {formatDate(since, 'MMM D')} to {formatDate(until, 'MMM D')} unpkg served {formatNumber(totals.requests.all)} requests and a total of {formatBytes(totals.bandwidth.all)} of data to {formatNumber(totals.uniques.all)} unique visitors, {formatPercent(totals.requests.cached / totals.requests.all, 0)}% of which were served from the cache.

-

Protocols

- -

The table below breaks down requests to unpkg from {formatDate(since, 'MMM D')} to {formatDate(until, 'MMM D')} by HTTP protocol.

- - - - - - - - - - {protocolRows} - -
ProtocolRequests (% of total)
-

Packages

The table below shows the most popular packages served by unpkg from {formatDate(since, 'MMM D')} to {formatDate(until, 'MMM D')}. Only the top {Object.keys(totals.requests.package).length} packages are shown.

@@ -207,6 +191,23 @@ class Stats extends React.Component { {regionRows} + +

Protocols

+ +

The table below breaks down requests to unpkg from {formatDate(since, 'MMM D')} to {formatDate(until, 'MMM D')} by HTTP protocol.

+ + + + + + + + + + {protocolRows} + +
ProtocolRequests (% of total)
+
) }