Add payload size to performance stats event
Summary: Payload size is useful to understand how much data is going down the wire for frame updates. Reviewed By: LukeDefeo Differential Revision: D45114582 fbshipit-source-id: d0c2a01deb84a67017db88bd396b4859e08d0037
This commit is contained in:
committed by
Facebook GitHub Bot
parent
22e28a4f3e
commit
8cd2bb97bf
@@ -26,6 +26,10 @@ function formatDiff(ms: number): string {
|
|||||||
return `${ms.toFixed(0)}ms`;
|
return `${ms.toFixed(0)}ms`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatSize(bytes: number): string {
|
||||||
|
return `${(bytes / 1000).toFixed()}`;
|
||||||
|
}
|
||||||
|
|
||||||
const columns: DataTableColumn<PerformanceStatsEvent>[] = [
|
const columns: DataTableColumn<PerformanceStatsEvent>[] = [
|
||||||
{
|
{
|
||||||
key: 'txId',
|
key: 'txId',
|
||||||
@@ -91,4 +95,14 @@ const columns: DataTableColumn<PerformanceStatsEvent>[] = [
|
|||||||
return formatDiff(row.socketMS);
|
return formatDiff(row.socketMS);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'payloadSize',
|
||||||
|
title: 'Payload Size (KB)',
|
||||||
|
onRender: (row: PerformanceStatsEvent) => {
|
||||||
|
if (!row.payloadSize) {
|
||||||
|
return 'NaN';
|
||||||
|
}
|
||||||
|
return formatSize(row.payloadSize);
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export type PerformanceStatsEvent = {
|
|||||||
deferredComputationMS: number;
|
deferredComputationMS: number;
|
||||||
serializationMS: number;
|
serializationMS: number;
|
||||||
socketMS: number;
|
socketMS: number;
|
||||||
|
payloadSize?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type UpdateMetadataEvent = {
|
export type UpdateMetadataEvent = {
|
||||||
|
|||||||
Reference in New Issue
Block a user