Skip to content

Commit cd39d0a

Browse files
authored
* Add chunks micmro/PerfCascade#237 * make sure to add chunks only if we have a page
1 parent f51ca0f commit cd39d0a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

index.js

+18
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,24 @@ module.exports = {
430430
if (entry.response) {
431431
entry.response.content.size += params.dataLength;
432432
}
433+
434+
const page = pages.find(page => page.id === entry.pageref);
435+
436+
if (entry._chunks && page) {
437+
entry._chunks.push({
438+
ts: formatMillis((params.timestamp - page.__timestamp) * 1000),
439+
bytes: params.dataLength
440+
});
441+
} else if (page) {
442+
entry._chunks = [
443+
{
444+
ts: formatMillis(
445+
(params.timestamp - page.__timestamp) * 1000
446+
),
447+
bytes: params.dataLength
448+
}
449+
];
450+
}
433451
}
434452
break;
435453

0 commit comments

Comments
 (0)