From c067346870ccc3b9ce7e01d4b730bbd34a2c61bc Mon Sep 17 00:00:00 2001 From: Luke De Feo Date: Fri, 30 Jun 2023 08:17:46 -0700 Subject: [PATCH] Add more diagnostics Summary: node count and root node prescense will be very useful Reviewed By: lblasa Differential Revision: D47153394 fbshipit-source-id: 067f6f3aefa17cdfa88124956781400f53fe08d7 --- .../ui-debugger/components/PerfStats.tsx | 4 ++++ .../public/ui-debugger/components/main.tsx | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/desktop/plugins/public/ui-debugger/components/PerfStats.tsx b/desktop/plugins/public/ui-debugger/components/PerfStats.tsx index 43c39f710..f8b101a03 100644 --- a/desktop/plugins/public/ui-debugger/components/PerfStats.tsx +++ b/desktop/plugins/public/ui-debugger/components/PerfStats.tsx @@ -12,6 +12,7 @@ import { DynamicPerformanceStatsEvent, UIState, Id, + UINode, } from '../types'; import React, {useMemo} from 'react'; import { @@ -25,6 +26,7 @@ import { export function PerfStats(props: { uiState: UIState; + nodes: Map; rootId?: Id; events: DataSource; }) { @@ -68,6 +70,8 @@ export function PerfStats(props: { data={{ ...Object.fromEntries(uiStateValues), rootId: props.rootId, + nodesCount: props.nodes.size, + rootNode: props.nodes.get(props.rootId ?? 'noroot'), }}> diff --git a/desktop/plugins/public/ui-debugger/components/main.tsx b/desktop/plugins/public/ui-debugger/components/main.tsx index 41029c25d..5b3604d19 100644 --- a/desktop/plugins/public/ui-debugger/components/main.tsx +++ b/desktop/plugins/public/ui-debugger/components/main.tsx @@ -50,6 +50,16 @@ export function Component() { setBottomPanelComponent(undefined); }; + if (showPerfStats) + return ( + + ); + if (streamState.state === 'FatalError') { return ( - ); - if (rootId == null || streamState.state === 'RetryingAfterError') { return (