Add outgoing payload size to flipper network plugin

Summary:
Flipper network plugin does not show request payload size at all, only the response.

I was trying to use flipper to check the compression ratio and overall analytics log size, but wasn't able to it, so fixed the network plugin

Reviewed By: lblasa

Differential Revision: D34062808

fbshipit-source-id: f4d4395eece9d41380b8ac6f834a014315c5db66
This commit is contained in:
Erkka Marjakangas
2022-02-14 10:20:33 -08:00
committed by Facebook GitHub Bot
parent 4e766c44bd
commit c973f4eba0
3 changed files with 28 additions and 6 deletions

View File

@@ -49,6 +49,7 @@ import {
convertRequestToCurlCommand,
getHeaderValue,
getResponseLength,
getRequestLength,
formatStatus,
formatBytes,
formatDuration,
@@ -553,6 +554,7 @@ function updateRequestWithResponseInfo(
responseData: decodeBody(response.headers, response.data),
responseIsMock: response.isMock,
responseLength: getResponseLength(response),
requestLength: getRequestLength(request),
duration: response.timestamp - request.requestTime.getTime(),
insights: response.insights ?? undefined,
};
@@ -675,9 +677,16 @@ const baseColumns: DataTableColumn<Request>[] = [
formatters: formatStatus,
align: 'right',
},
{
key: 'requestLength',
title: 'Request Size',
width: 100,
formatters: formatBytes,
align: 'right',
},
{
key: 'responseLength',
title: 'Size',
title: 'Response Size',
width: 100,
formatters: formatBytes,
align: 'right',