Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {useCallback, useEffect, useMemo, useState} from 'react';
import {QueryServiceClient} from '@parca/client';
import {Query} from '@parca/parser';
import {TEST_IDS, testId} from '@parca/test-utils';
import type {NavigateFunction} from '@parca/utilities';

import {ProfileDiffSource, ProfileViewWithData} from '..';
import ProfileSelector from '../ProfileSelector';
Expand All @@ -25,13 +24,9 @@ import {useQueryState} from '../hooks/useQueryState';

interface ProfileExplorerCompareProps {
queryClient: QueryServiceClient;
navigateTo: NavigateFunction;
}

const ProfileExplorerCompare = ({
queryClient,
navigateTo,
}: ProfileExplorerCompareProps): JSX.Element => {
const ProfileExplorerCompare = ({queryClient}: ProfileExplorerCompareProps): JSX.Element => {
const [showMetricsGraph, setShowMetricsGraph] = useState(true);
const {closeCompareMode, isCompareMode, isCompareAbsolute} = useCompareModeMeta();

Expand Down Expand Up @@ -107,7 +102,6 @@ const ProfileExplorerCompare = ({
closeProfile={closeProfileA}
enforcedProfileName={''}
comparing={true}
navigateTo={navigateTo}
suffix="_a"
showMetricsGraph={showMetricsGraph}
setDisplayHideMetricsGraphButton={setShowMetricsGraph}
Expand All @@ -122,7 +116,6 @@ const ProfileExplorerCompare = ({
closeProfile={closeProfileB}
enforcedProfileName={enforcedProfileNameA}
comparing={true}
navigateTo={navigateTo}
suffix="_b"
showMetricsGraph={showMetricsGraph}
setDisplayHideMetricsGraphButton={setShowMetricsGraph}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,16 @@
import {useCallback, useState} from 'react';

import {QueryServiceClient} from '@parca/client';
import type {NavigateFunction} from '@parca/utilities';

import {ProfileViewWithData} from '..';
import ProfileSelector from '../ProfileSelector';
import {useQueryState} from '../hooks/useQueryState';

interface ProfileExplorerSingleProps {
queryClient: QueryServiceClient;
navigateTo: NavigateFunction;
}

const ProfileExplorerSingle = ({
queryClient,
navigateTo,
}: ProfileExplorerSingleProps): JSX.Element => {
const ProfileExplorerSingle = ({queryClient}: ProfileExplorerSingleProps): JSX.Element => {
const [showMetricsGraph, setShowMetricsGraph] = useState(true);
const {profileSource, setDraftTimeRange, commitDraft} = useQueryState({suffix: '_a'});

Expand All @@ -47,7 +42,6 @@ const ProfileExplorerSingle = ({
closeProfile={() => {}} // eslint-disable-line @typescript-eslint/no-empty-function
comparing={false}
enforcedProfileName={''}
navigateTo={navigateTo}
suffix="_a"
showMetricsGraph={showMetricsGraph}
setDisplayHideMetricsGraphButton={setShowMetricsGraph}
Expand Down
13 changes: 6 additions & 7 deletions ui/packages/shared/profile/src/ProfileExplorer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {Provider} from 'react-redux';
import {QueryServiceClient} from '@parca/client';
import {KeyDownProvider, useParcaContext} from '@parca/components';
import {createStore} from '@parca/store';
import {capitalizeOnlyFirstLetter, type NavigateFunction} from '@parca/utilities';
import {capitalizeOnlyFirstLetter} from '@parca/utilities';

import {useCompareModeMeta} from '../hooks/useCompareModeMeta';
import {useHasProfileData} from '../useHasProfileData';
Expand All @@ -27,7 +27,6 @@ import ProfileExplorerSingle from './ProfileExplorerSingle';

interface ProfileExplorerProps {
queryClient: QueryServiceClient;
navigateTo: NavigateFunction;
}

const ErrorContent = ({errorMessage}: {errorMessage: string}): JSX.Element => {
Expand All @@ -41,7 +40,7 @@ const ErrorContent = ({errorMessage}: {errorMessage: string}): JSX.Element => {
);
};

const ProfileExplorerApp = ({queryClient, navigateTo}: ProfileExplorerProps): JSX.Element => {
const ProfileExplorerApp = ({queryClient}: ProfileExplorerProps): JSX.Element => {
const {
loading: hasProfileDataLoading,
data: hasProfileData,
Expand Down Expand Up @@ -77,13 +76,13 @@ const ProfileExplorerApp = ({queryClient, navigateTo}: ProfileExplorerProps): JS
}

if (isCompareMode) {
return <ProfileExplorerCompare queryClient={queryClient} navigateTo={navigateTo} />;
return <ProfileExplorerCompare queryClient={queryClient} />;
}

return <ProfileExplorerSingle queryClient={queryClient} navigateTo={navigateTo} />;
return <ProfileExplorerSingle queryClient={queryClient} />;
};

const ProfileExplorer = ({queryClient, navigateTo}: ProfileExplorerProps): JSX.Element => {
const ProfileExplorer = ({queryClient}: ProfileExplorerProps): JSX.Element => {
const {additionalFlamegraphColorProfiles} = useParcaContext();

const {store: reduxStore} = useMemo(() => {
Expand All @@ -93,7 +92,7 @@ const ProfileExplorer = ({queryClient, navigateTo}: ProfileExplorerProps): JSX.E
return (
<Provider store={reduxStore}>
<KeyDownProvider>
<ProfileExplorerApp queryClient={queryClient} navigateTo={navigateTo} />
<ProfileExplorerApp queryClient={queryClient} />
</KeyDownProvider>
</Provider>
);
Expand Down
4 changes: 1 addition & 3 deletions ui/packages/shared/profile/src/ProfileSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {DateTimeRange, IconButton, useGrpcMetadata, useParcaContext} from '@parc
import {CloseIcon} from '@parca/icons';
import {Query} from '@parca/parser';
import {TEST_IDS, testId} from '@parca/test-utils';
import {millisToProtoTimestamp, type NavigateFunction} from '@parca/utilities';
import {millisToProtoTimestamp} from '@parca/utilities';

import {
ProfileFilter,
Expand Down Expand Up @@ -59,7 +59,6 @@ interface ProfileSelectorProps extends ProfileSelectorFeatures {
closeProfile: () => void;
enforcedProfileName: string;
comparing: boolean;
navigateTo: NavigateFunction;
setDisplayHideMetricsGraphButton?: Dispatch<SetStateAction<boolean>>;
suffix?: '_a' | '_b'; // For comparison mode
onSearchHook?: () => void;
Expand Down Expand Up @@ -104,7 +103,6 @@ const ProfileSelector = ({
closeProfile,
enforcedProfileName,
comparing,
navigateTo: _navigateTo,
showMetricsGraph = true,
showSumBySelector = true,
showProfileTypeSelector = true,
Expand Down
Loading