Skip to content

Commit

Permalink
ref(insights): abstract ScreenLoadSpans side panel for mobile modules
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinL10 committed May 15, 2024
1 parent 893a38b commit 4155cd8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ import {
COLD_START_TYPE,
StartTypeSelector,
} from 'sentry/views/performance/mobile/appStarts/screenSummary/startTypeSelector';
<<<<<<< HEAD
import {BASE_URL} from 'sentry/views/performance/mobile/appStarts/settings';
=======
import {SpanSamplesPanel} from 'sentry/views/performance/mobile/components/spanSamplesPanel';
>>>>>>> 16c919f580 (ref(insights): abstract ScreenLoadSpans side panel for mobile modules)
import {MetricsRibbon} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/metricsRibbon';
import {ScreenLoadSpanSamples} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/samples';
import {ModulePageProviders} from 'sentry/views/performance/modulePageProviders';
import {
PRIMARY_RELEASE_ALIAS,
ReleaseComparisonSelector,
SECONDARY_RELEASE_ALIAS,
} from 'sentry/views/starfish/components/releaseSelector';
import {SpanMetricsField} from 'sentry/views/starfish/types';
import {ModuleName, SpanMetricsField} from 'sentry/views/starfish/types';
import {ROUTE_NAMES} from 'sentry/views/starfish/utils/routeNames';
import {QueryParameterNames} from 'sentry/views/starfish/views/queryParameters';

Expand Down Expand Up @@ -187,12 +190,13 @@ export function ScreenSummary() {
<SamplesTables transactionName={transactionName} />
</SamplesContainer>
{spanGroup && spanOp && appStartType && (
<ScreenLoadSpanSamples
<SpanSamplesPanel
additionalFilters={{
[SpanMetricsField.APP_START_TYPE]: appStartType,
...(deviceClass ? {[SpanMetricsField.DEVICE_CLASS]: deviceClass} : {}),
}}
groupId={spanGroup}
moduleName={ModuleName.STARTUP}
transactionName={transactionName}
spanDescription={spanDescription}
spanOp={spanOp}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ import useOrganization from 'sentry/utils/useOrganization';
import useProjects from 'sentry/utils/useProjects';
import useRouter from 'sentry/utils/useRouter';
import {normalizeUrl} from 'sentry/utils/withDomainRequired';
import {ScreenLoadSampleContainer} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/samples/samplesContainer';
import {SpanSamplesContainer} from 'sentry/views/performance/mobile/components/spanSamplesPanelContainer';
import DetailPanel from 'sentry/views/starfish/components/detailPanel';
import {useReleaseSelection} from 'sentry/views/starfish/queries/useReleases';
import type {ModuleName} from 'sentry/views/starfish/types';

type Props = {
groupId: string;
moduleName: ModuleName;
transactionName: string;
additionalFilters?: Record<string, string>;
onClose?: () => void;
Expand All @@ -29,8 +31,9 @@ type Props = {
transactionRoute?: string;
};

export function ScreenLoadSpanSamples({
export function SpanSamplesPanel({
groupId,
moduleName,
transactionName,
transactionMethod,
spanDescription,
Expand Down Expand Up @@ -112,8 +115,9 @@ export function ScreenLoadSpanSamples({
<PageAlert />
<ChartsContainer>
<ChartsContainerItem key="release1">
<ScreenLoadSampleContainer
<SpanSamplesContainer
groupId={groupId}
moduleName={moduleName}
transactionName={transactionName}
transactionMethod={transactionMethod}
release={primaryRelease}
Expand All @@ -124,8 +128,9 @@ export function ScreenLoadSpanSamples({
/>
</ChartsContainerItem>
<ChartsContainerItem key="release2">
<ScreenLoadSampleContainer
<SpanSamplesContainer
groupId={groupId}
moduleName={moduleName}
transactionName={transactionName}
transactionMethod={transactionMethod}
release={secondaryRelease}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ import {
} from 'sentry/views/performance/mobile/screenload/screens/platformSelector';
import {isCrossPlatform} from 'sentry/views/performance/mobile/screenload/screens/utils';
import {useSpanMetrics} from 'sentry/views/starfish/queries/useDiscover';
import type {SpanMetricsQueryFilters} from 'sentry/views/starfish/types';
import {ModuleName, SpanMetricsField} from 'sentry/views/starfish/types';
import {
type ModuleName,
SpanMetricsField,
type SpanMetricsQueryFilters,
} from 'sentry/views/starfish/types';
import {formatVersionAndCenterTruncate} from 'sentry/views/starfish/utils/centerTruncate';
import {DataTitles} from 'sentry/views/starfish/views/spans/types';
import DurationChart from 'sentry/views/starfish/views/spanSummaryPage/sampleList/durationChart';
Expand All @@ -34,6 +37,7 @@ const {SPAN_SELF_TIME, SPAN_OP} = SpanMetricsField;

type Props = {
groupId: string;
moduleName: ModuleName;
transactionName: string;
additionalFilters?: Record<string, string>;
project?: Project | null;
Expand All @@ -44,8 +48,9 @@ type Props = {
transactionMethod?: string;
};

export function ScreenLoadSampleContainer({
export function SpanSamplesContainer({
groupId,
moduleName,
transactionName,
transactionMethod,
release,
Expand Down Expand Up @@ -182,7 +187,7 @@ export function ScreenLoadSampleContainer({
onMouseOverSample={sample => setHighlightedSpanId(sample.span_id)}
groupId={groupId}
transactionName={transactionName}
moduleName={ModuleName.SCREEN}
moduleName={moduleName}
release={release}
columnOrder={[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import useOrganization from 'sentry/utils/useOrganization';
import useProjects from 'sentry/utils/useProjects';
import useRouter from 'sentry/utils/useRouter';
import {normalizeUrl} from 'sentry/utils/withDomainRequired';
import {SpanSamplesPanel} from 'sentry/views/performance/mobile/components/spanSamplesPanel';
import {
ScreenCharts,
YAxis,
} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/charts';
import {ScreenLoadEventSamples} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/eventSamples';
import {MetricsRibbon} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/metricsRibbon';
import {ScreenLoadSpanSamples} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/samples';
import {ScreenLoadSpansTable} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/table';
import {
MobileCursors,
Expand All @@ -42,7 +42,7 @@ import {
ReleaseComparisonSelector,
SECONDARY_RELEASE_ALIAS,
} from 'sentry/views/starfish/components/releaseSelector';
import {SpanMetricsField} from 'sentry/views/starfish/types';
import {ModuleName, SpanMetricsField} from 'sentry/views/starfish/types';
import {QueryParameterNames} from 'sentry/views/starfish/views/queryParameters';

type Query = {
Expand Down Expand Up @@ -209,8 +209,9 @@ function ScreenLoadSpans() {
project={project}
/>
{spanGroup && (
<ScreenLoadSpanSamples
<SpanSamplesPanel
groupId={spanGroup}
moduleName={ModuleName.SCREEN}
transactionName={transactionName}
spanDescription={spanDescription}
onClose={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import useOrganization from 'sentry/utils/useOrganization';
import useRouter from 'sentry/utils/useRouter';
import {normalizeUrl} from 'sentry/utils/withDomainRequired';
import {SamplesTables} from 'sentry/views/performance/mobile/components/samplesTables';
import {ScreenLoadSpanSamples} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/samples';
import {SpanSamplesPanel} from 'sentry/views/performance/mobile/components/spanSamplesPanel';
import {SpanOperationTable} from 'sentry/views/performance/mobile/ui/screenSummary/spanOperationTable';
import {BASE_URL} from 'sentry/views/performance/mobile/ui/settings';
import {ModulePageProviders} from 'sentry/views/performance/modulePageProviders';
import {ReleaseComparisonSelector} from 'sentry/views/starfish/components/releaseSelector';
import {SpanMetricsField} from 'sentry/views/starfish/types';
import {ModuleName, SpanMetricsField} from 'sentry/views/starfish/types';
import {QueryParameterNames} from 'sentry/views/starfish/views/queryParameters';

type Query = {
Expand Down Expand Up @@ -102,11 +102,12 @@ function ScreenSummary() {
</SamplesContainer>

{spanGroup && spanOp && (
<ScreenLoadSpanSamples
<SpanSamplesPanel
additionalFilters={{
...(deviceClass ? {[SpanMetricsField.DEVICE_CLASS]: deviceClass} : {}),
}}
groupId={spanGroup}
moduleName={ModuleName.OTHER}
transactionName={transactionName}
spanDescription={spanDescription}
spanOp={spanOp}
Expand Down

0 comments on commit 4155cd8

Please sign in to comment.