Skip to content

Commit

Permalink
Add more diagnostics
Browse files Browse the repository at this point in the history
Summary: node count and root node prescense will be very useful

Reviewed By: lblasa

Differential Revision: D47153394

fbshipit-source-id: 067f6f3aefa17cdfa88124956781400f53fe08d7
  • Loading branch information
Luke De Feo authored and facebook-github-bot committed Jun 30, 2023
1 parent 2b17ac7 commit c067346
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
4 changes: 4 additions & 0 deletions desktop/plugins/public/ui-debugger/components/PerfStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
DynamicPerformanceStatsEvent,
UIState,
Id,
UINode,
} from '../types';
import React, {useMemo} from 'react';
import {
Expand All @@ -25,6 +26,7 @@ import {

export function PerfStats(props: {
uiState: UIState;
nodes: Map<Id, UINode>;
rootId?: Id;
events: DataSource<DynamicPerformanceStatsEvent, number>;
}) {
Expand Down Expand Up @@ -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'),
}}></DataInspector>
</DetailSidebar>
</Layout.Container>
Expand Down
19 changes: 10 additions & 9 deletions desktop/plugins/public/ui-debugger/components/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ export function Component() {
setBottomPanelComponent(undefined);
};

if (showPerfStats)
return (
<PerfStats
uiState={instance.uiState}
rootId={rootId}
nodes={nodes}
events={instance.perfEvents}
/>
);

if (streamState.state === 'FatalError') {
return (
<StreamInterceptorErrorView
Expand Down Expand Up @@ -78,15 +88,6 @@ export function Component() {
);
}

if (showPerfStats)
return (
<PerfStats
uiState={instance.uiState}
rootId={rootId}
events={instance.perfEvents}
/>
);

if (rootId == null || streamState.state === 'RetryingAfterError') {
return (
<Centered>
Expand Down

0 comments on commit c067346

Please sign in to comment.