Skip to content

Commit 31d7b6c

Browse files
authored
ref(✂️): remove unused code from performance (#90144)
1 parent 70bd245 commit 31d7b6c

File tree

19 files changed

+7
-955
lines changed

19 files changed

+7
-955
lines changed

static/app/utils/performance/contexts/metricsCardinality.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ function Provider(
166166
return <_Provider {...props}>{props.children}</_Provider>;
167167
}
168168

169-
export const MetricsCardinalityConsumer = _Context.Consumer;
170-
171169
export const useMetricsCardinalityContext = _useContext;
172170

173171
/**

static/app/utils/performance/contexts/metricsEnhancedPerformanceDataContext.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type {ReactNode} from 'react';
22
import {useCallback, useState} from 'react';
33

44
import {Tag} from 'sentry/components/core/badge/tag';
5-
import {t} from 'sentry/locale';
65
import useOrganization from 'sentry/utils/useOrganization';
76
import type {Widget} from 'sentry/views/dashboards/types';
87
import {WIDGET_MAP_DENY_LIST} from 'sentry/views/performance/landing/widgets/utils';
@@ -25,8 +24,6 @@ const [_MEPDataProvider, _useMEPDataContext, _Context] =
2524
name: 'MetricsEnhancedPerformanceDataContext',
2625
});
2726

28-
export const MEPDataConsumer = _Context.Consumer;
29-
export const MEPDataContext = _Context;
3027
export function MEPDataProvider({
3128
children,
3229
chartSetting,
@@ -164,21 +161,3 @@ export function useExtractionStatus(props: {
164161
}
165162
return 'extracted';
166163
}
167-
168-
export function ExtractedMetricsTag(props: {queryKey: MetricsResultsMetaMapKey}) {
169-
const extractionStatus = useExtractionStatus(props);
170-
171-
if (extractionStatus === 'extracted') {
172-
return (
173-
<Tag type="info" data-test-id="has-metrics-data-tag">
174-
{t('extracted')}
175-
</Tag>
176-
);
177-
}
178-
179-
if (extractionStatus === 'not-extracted') {
180-
return <Tag style={{opacity: 0.25}}>{t('not extracted')}</Tag>;
181-
}
182-
183-
return null;
184-
}
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type {ImmutableEventView} from 'sentry/utils/discover/eventView';
21
import type EventView from 'sentry/utils/discover/eventView';
32

43
import {createDefinedContext} from './utils';
@@ -16,14 +15,3 @@ const [
1615
});
1716

1817
export {PerformanceEventViewProvider, PerformanceEventViewContext};
19-
20-
// Provides a readonly event view. Also omits anything that isn't currently
21-
// read-only, although in the future we should switch the code in EventView
22-
// instead. If you need mutability, use the mutable version.
23-
export function usePerformanceEventView(): ImmutableEventView {
24-
return _usePerformanceEventView().eventView;
25-
}
26-
27-
export function useMutablePerformanceEventView() {
28-
return usePerformanceEventView().clone();
29-
}

static/app/views/performance/data.tsx

Lines changed: 0 additions & 244 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
} from './vitalDetail/utils';
2323

2424
export const DEFAULT_STATS_PERIOD = '14d';
25-
export const DEFAULT_PROJECT_THRESHOLD_METRIC = 'duration';
2625
export const DEFAULT_PROJECT_THRESHOLD = 300;
2726

2827
export const COLUMN_TITLES = [
@@ -84,41 +83,6 @@ type TooltipOption = SelectValue<string> & {
8483
tooltip: string;
8584
};
8685

87-
export function getAxisOptions(organization: Organization): TooltipOption[] {
88-
return [
89-
{
90-
tooltip: getTermHelp(organization, PerformanceTerm.APDEX),
91-
value: 'apdex()',
92-
label: t('Apdex'),
93-
},
94-
{
95-
tooltip: getTermHelp(organization, PerformanceTerm.TPM),
96-
value: 'tpm()',
97-
label: t('Transactions Per Minute'),
98-
},
99-
{
100-
tooltip: getTermHelp(organization, PerformanceTerm.FAILURE_RATE),
101-
value: 'failure_rate()',
102-
label: t('Failure Rate'),
103-
},
104-
{
105-
tooltip: getTermHelp(organization, PerformanceTerm.P50),
106-
value: 'p50()',
107-
label: t('p50 Duration'),
108-
},
109-
{
110-
tooltip: getTermHelp(organization, PerformanceTerm.P95),
111-
value: 'p95()',
112-
label: t('p95 Duration'),
113-
},
114-
{
115-
tooltip: getTermHelp(organization, PerformanceTerm.P99),
116-
value: 'p99()',
117-
label: t('p99 Duration'),
118-
},
119-
];
120-
}
121-
12286
export type AxisOption = TooltipOption & {
12387
field: string;
12488
label: string;
@@ -128,214 +92,6 @@ export type AxisOption = TooltipOption & {
12892
isRightDefault?: boolean;
12993
};
13094

131-
export function getFrontendAxisOptions(organization: Organization): AxisOption[] {
132-
return [
133-
{
134-
tooltip: getTermHelp(organization, PerformanceTerm.LCP),
135-
value: `p75(lcp)`,
136-
label: t('LCP p75'),
137-
field: 'p75(measurements.lcp)',
138-
isLeftDefault: true,
139-
backupOption: {
140-
tooltip: getTermHelp(organization, PerformanceTerm.FCP),
141-
value: `p75(fcp)`,
142-
label: t('FCP p75'),
143-
field: 'p75(measurements.fcp)',
144-
},
145-
},
146-
{
147-
tooltip: getTermHelp(organization, PerformanceTerm.DURATION_DISTRIBUTION),
148-
value: 'lcp_distribution',
149-
label: t('LCP Distribution'),
150-
field: 'measurements.lcp',
151-
isDistribution: true,
152-
isRightDefault: true,
153-
backupOption: {
154-
tooltip: getTermHelp(organization, PerformanceTerm.DURATION_DISTRIBUTION),
155-
value: 'fcp_distribution',
156-
label: t('FCP Distribution'),
157-
field: 'measurements.fcp',
158-
isDistribution: true,
159-
},
160-
},
161-
{
162-
tooltip: getTermHelp(organization, PerformanceTerm.TPM),
163-
value: 'tpm()',
164-
label: t('Transactions Per Minute'),
165-
field: 'tpm()',
166-
},
167-
];
168-
}
169-
170-
export function getFrontendOtherAxisOptions(organization: Organization): AxisOption[] {
171-
return [
172-
{
173-
tooltip: getTermHelp(organization, PerformanceTerm.P50),
174-
value: `p50()`,
175-
label: t('Duration p50'),
176-
field: 'p50(transaction.duration)',
177-
},
178-
{
179-
tooltip: getTermHelp(organization, PerformanceTerm.P75),
180-
value: `p75()`,
181-
label: t('Duration p75'),
182-
field: 'p75(transaction.duration)',
183-
isLeftDefault: true,
184-
},
185-
{
186-
tooltip: getTermHelp(organization, PerformanceTerm.P95),
187-
value: `p95()`,
188-
label: t('Duration p95'),
189-
field: 'p95(transaction.duration)',
190-
},
191-
{
192-
tooltip: getTermHelp(organization, PerformanceTerm.DURATION_DISTRIBUTION),
193-
value: 'duration_distribution',
194-
label: t('Duration Distribution'),
195-
field: 'transaction.duration',
196-
isDistribution: true,
197-
isRightDefault: true,
198-
},
199-
];
200-
}
201-
202-
export function getBackendAxisOptions(organization: Organization): AxisOption[] {
203-
return [
204-
{
205-
tooltip: getTermHelp(organization, PerformanceTerm.P50),
206-
value: `p50()`,
207-
label: t('Duration p50'),
208-
field: 'p50(transaction.duration)',
209-
},
210-
{
211-
tooltip: getTermHelp(organization, PerformanceTerm.P75),
212-
value: `p75()`,
213-
label: t('Duration p75'),
214-
field: 'p75(transaction.duration)',
215-
isLeftDefault: true,
216-
},
217-
{
218-
tooltip: getTermHelp(organization, PerformanceTerm.P95),
219-
value: `p95()`,
220-
label: t('Duration p95'),
221-
field: 'p95(transaction.duration)',
222-
},
223-
{
224-
tooltip: getTermHelp(organization, PerformanceTerm.P99),
225-
value: `p99()`,
226-
label: t('Duration p99'),
227-
field: 'p99(transaction.duration)',
228-
},
229-
{
230-
tooltip: getTermHelp(organization, PerformanceTerm.TPM),
231-
value: 'tpm()',
232-
label: t('Transactions Per Minute'),
233-
field: 'tpm()',
234-
},
235-
{
236-
tooltip: getTermHelp(organization, PerformanceTerm.FAILURE_RATE),
237-
value: 'failure_rate()',
238-
label: t('Failure Rate'),
239-
field: 'failure_rate()',
240-
},
241-
{
242-
tooltip: getTermHelp(organization, PerformanceTerm.DURATION_DISTRIBUTION),
243-
value: 'duration_distribution',
244-
label: t('Duration Distribution'),
245-
field: 'transaction.duration',
246-
isDistribution: true,
247-
isRightDefault: true,
248-
},
249-
{
250-
tooltip: getTermHelp(organization, PerformanceTerm.APDEX),
251-
value: 'apdex()',
252-
label: t('Apdex'),
253-
field: 'apdex()',
254-
},
255-
];
256-
}
257-
258-
export function getMobileAxisOptions(organization: Organization): AxisOption[] {
259-
return [
260-
{
261-
tooltip: getTermHelp(organization, PerformanceTerm.APP_START_COLD),
262-
value: `p50(measurements.app_start_cold)`,
263-
label: t('Cold Start Duration p50'),
264-
field: 'p50(measurements.app_start_cold)',
265-
},
266-
{
267-
tooltip: getTermHelp(organization, PerformanceTerm.APP_START_COLD),
268-
value: `p75(measurements.app_start_cold)`,
269-
label: t('Cold Start Duration p75'),
270-
field: 'p75(measurements.app_start_cold)',
271-
isLeftDefault: true,
272-
},
273-
{
274-
tooltip: getTermHelp(organization, PerformanceTerm.APP_START_COLD),
275-
value: `p95(measurements.app_start_cold)`,
276-
label: t('Cold Start Duration p95'),
277-
field: 'p95(measurements.app_start_cold)',
278-
},
279-
{
280-
tooltip: getTermHelp(organization, PerformanceTerm.APP_START_COLD),
281-
value: `p99(measurements.app_start_cold)`,
282-
label: t('Cold Start Duration p99'),
283-
field: 'p99(measurements.app_start_cold)',
284-
},
285-
{
286-
tooltip: getTermHelp(organization, PerformanceTerm.DURATION_DISTRIBUTION),
287-
value: 'app_start_cold_distribution',
288-
label: t('Cold Start Distribution'),
289-
field: 'measurements.app_start_cold',
290-
isDistribution: true,
291-
isRightDefault: true,
292-
},
293-
{
294-
tooltip: getTermHelp(organization, PerformanceTerm.APP_START_WARM),
295-
value: `p50(measurements.app_start_warm)`,
296-
label: t('Warm Start Duration p50'),
297-
field: 'p50(measurements.app_start_warm)',
298-
},
299-
{
300-
tooltip: getTermHelp(organization, PerformanceTerm.APP_START_WARM),
301-
value: `p75(measurements.app_start_warm)`,
302-
label: t('Warm Start Duration p75'),
303-
field: 'p75(measurements.app_start_warm)',
304-
},
305-
{
306-
tooltip: getTermHelp(organization, PerformanceTerm.APP_START_WARM),
307-
value: `p95(measurements.app_start_warm)`,
308-
label: t('Warm Start Duration p95'),
309-
field: 'p95(measurements.app_start_warm)',
310-
},
311-
{
312-
tooltip: getTermHelp(organization, PerformanceTerm.APP_START_WARM),
313-
value: `p99(measurements.app_start_warm)`,
314-
label: t('Warm Start Duration p99'),
315-
field: 'p99(measurements.app_start_warm)',
316-
},
317-
{
318-
tooltip: getTermHelp(organization, PerformanceTerm.DURATION_DISTRIBUTION),
319-
value: 'app_start_warm_distribution',
320-
label: t('Warm Start Distribution'),
321-
field: 'measurements.app_start_warm',
322-
isDistribution: true,
323-
},
324-
{
325-
tooltip: getTermHelp(organization, PerformanceTerm.TPM),
326-
value: 'tpm()',
327-
label: t('Transactions Per Minute'),
328-
field: 'tpm()',
329-
},
330-
{
331-
tooltip: getTermHelp(organization, PerformanceTerm.FAILURE_RATE),
332-
value: 'failure_rate()',
333-
label: t('Failure Rate'),
334-
field: 'failure_rate()',
335-
},
336-
];
337-
}
338-
33995
type TermFormatter = (organization: Organization) => string;
34096

34197
export const PERFORMANCE_TERMS: Record<PerformanceTerm, TermFormatter> = {

0 commit comments

Comments
 (0)