Skip to content

Commit

Permalink
Resolved issue with largest request time
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinfarrugia committed Jun 21, 2021
1 parent 2dfe718 commit c5be9f8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/hara.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ const parseLargestCompressed = (data) => {
};

const parseLongest = (data) => {
const item = data
.sort((a, b) => a.response.time - b.response.time)
.reverse()[0];
const item = data.sort((a, b) => a.time - b.time).reverse()[0];

if (!item) {
return null;
Expand All @@ -71,7 +69,7 @@ const parsePages = (data) => ({
0.5
)
),
ninetyFifthPercentileOnLoad: Math.round(
ninetyFifthOnLoad: Math.round(
percentile(
data.map((n) => n.pageTimings.onLoad),
0.95
Expand All @@ -94,7 +92,7 @@ const parseRequests = (data) => {
data.map((n) => n.time),
0.5
),
ninetyFifthPercentileTime: percentile(
ninetyFifthTime: percentile(
data.map((n) => n.time),
0.95
),
Expand Down

0 comments on commit c5be9f8

Please sign in to comment.