Skip to content

Commit f511cba

Browse files
obostjancicMichaelSun48
authored andcommitted
chore(metrics): remove DDM references (#68898)
1 parent 9ac4a14 commit f511cba

23 files changed

Lines changed: 35 additions & 91 deletions

File tree

static/app/components/assistant/getGuidesContent.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,6 @@ export default function getGuidesContent(orgSlug: string | null): GuidesContent
174174
},
175175
],
176176
},
177-
{
178-
guide: 'ddm_view',
179-
requiredTargets: ['create_scratchpad'],
180-
steps: [
181-
{
182-
title: t('Save your charts'),
183-
target: 'create_scratchpad',
184-
description: t(
185-
`Scratchpads are stored locally on your device. If you want to share them, simply send the URL to your teammates.`
186-
),
187-
},
188-
],
189-
},
190177
];
191178
}
192179

static/app/types/hooks.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ type DisabledMemberTooltipProps = {children: React.ReactNode};
9393

9494
type DashboardHeadersProps = {organization: Organization};
9595

96-
type DDMMetricsSamplesListProps = {children: React.ReactNode; organization: Organization};
96+
type MetricsSamplesListProps = {children: React.ReactNode; organization: Organization};
9797

9898
type ReplayFeedbackButton = {children: React.ReactNode};
9999
type ReplayListPageHeaderProps = {children?: React.ReactNode};
@@ -188,7 +188,7 @@ export type ComponentHooks = {
188188
'component:dashboards-header': () => React.ComponentType<DashboardHeadersProps>;
189189
'component:data-consent-banner': () => React.ComponentType<{source: string}> | null;
190190
'component:data-consent-priority-learn-more': () => React.ComponentType<{}> | null;
191-
'component:ddm-metrics-samples-list': () => React.ComponentType<DDMMetricsSamplesListProps>;
191+
'component:ddm-metrics-samples-list': () => React.ComponentType<MetricsSamplesListProps>;
192192
'component:disabled-app-store-connect-multiple': () => React.ComponentType<DisabledAppStoreConnectMultiple>;
193193
'component:disabled-custom-symbol-sources': () => React.ComponentType<DisabledCustomSymbolSources>;
194194
'component:disabled-member': () => React.ComponentType<DisabledMemberViewProps>;

static/app/types/metrics.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface MetricsApiRequestQuery extends MetricsApiRequestMetric {
4343
statsPeriod?: string;
4444
}
4545

46-
export type MetricsDataIntervalLadder = 'ddm' | 'bar' | 'dashboard';
46+
export type MetricsDataIntervalLadder = 'metrics' | 'bar' | 'dashboard';
4747

4848
export type MetricsApiResponse = {
4949
end: string;

static/app/utils/metrics/dashboard.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ import {defined} from 'sentry/utils';
55
import {MRIToField} from 'sentry/utils/metrics/mri';
66
import type {MetricDisplayType, MetricsQuery} from 'sentry/utils/metrics/types';
77
import type {Widget, WidgetQuery} from 'sentry/views/dashboards/types';
8-
import {
9-
DashboardWidgetSource,
10-
DisplayType,
11-
WidgetType,
12-
} from 'sentry/views/dashboards/types';
8+
import {DisplayType, WidgetType} from 'sentry/views/dashboards/types';
139

1410
interface QueryParams extends MetricsQuery {
1511
id?: number;
@@ -90,7 +86,6 @@ export function getWidgetAsQueryParams(
9086
const {projects} = selection;
9187

9288
return {
93-
source: DashboardWidgetSource.DDM,
9489
start,
9590
end,
9691
statsPeriod: period,

static/app/utils/metrics/index.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import type {MetricsOperation} from 'sentry/types';
44
import {
55
getAbsoluteDateTimeRange,
66
getDateTimeParams,
7-
getDDMInterval,
87
getFormattedMQL,
8+
getMetricsInterval,
99
isFormattedMQL,
1010
} from 'sentry/utils/metrics';
1111

@@ -14,7 +14,7 @@ describe('getDDMInterval', () => {
1414
const dateTimeObj = {start: '2023-01-01', end: '2023-01-31'};
1515
const useCase = 'sessions';
1616

17-
const result = getDDMInterval(dateTimeObj, useCase);
17+
const result = getMetricsInterval(dateTimeObj, useCase);
1818

1919
expect(result).toBe('2h');
2020
});
@@ -26,7 +26,7 @@ describe('getDDMInterval', () => {
2626
};
2727
const useCase = 'custom';
2828

29-
const result = getDDMInterval(dateTimeObj, useCase);
29+
const result = getMetricsInterval(dateTimeObj, useCase);
3030

3131
expect(result).toBe('10s');
3232
});
@@ -35,7 +35,7 @@ describe('getDDMInterval', () => {
3535
const dateTimeObj = {start: '2023-01-01', end: '2023-01-01T01:05:00.000Z'};
3636
const useCase = 'sessions';
3737

38-
const result = getDDMInterval(dateTimeObj, useCase);
38+
const result = getMetricsInterval(dateTimeObj, useCase);
3939

4040
expect(result).toBe('1m');
4141
});

static/app/utils/metrics/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export function getMetricsUrl(
9999
}
100100

101101
const intervalLadders: Record<MetricsDataIntervalLadder, GranularityLadder> = {
102-
ddm: new GranularityLadder([
102+
metrics: new GranularityLadder([
103103
[SIXTY_DAYS, '1d'],
104104
[THIRTY_DAYS, '2h'],
105105
[TWO_WEEKS, '1h'],
@@ -129,14 +129,14 @@ const intervalLadders: Record<MetricsDataIntervalLadder, GranularityLadder> = {
129129
};
130130

131131
// Wraps getInterval since other users of this function, and other metric use cases do not have support for 10s granularity
132-
export function getDDMInterval(
132+
export function getMetricsInterval(
133133
datetimeObj: DateTimeObject,
134134
useCase: UseCase,
135-
ladder: MetricsDataIntervalLadder = 'ddm'
135+
ladder: MetricsDataIntervalLadder = 'metrics'
136136
) {
137137
const diffInMinutes = getDiffInMinutes(datetimeObj);
138138

139-
if (diffInMinutes <= ONE_HOUR && useCase === 'custom' && ladder === 'ddm') {
139+
if (diffInMinutes <= ONE_HOUR && useCase === 'custom' && ladder === 'metrics') {
140140
return '10s';
141141
}
142142

static/app/utils/metrics/useMetricsQuery.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ describe('getMetricsQueryApiRequestPayload', () => {
233233
};
234234

235235
const result = getMetricsQueryApiRequestPayload([metric], filters, {
236-
intervalLadder: 'ddm',
236+
intervalLadder: 'metrics',
237237
});
238238

239239
expect(result.query).toEqual({

static/app/utils/metrics/useMetricsQuery.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {useMemo} from 'react';
22

33
import type {PageFilters} from 'sentry/types';
44
import {parsePeriodToHours} from 'sentry/utils/dates';
5-
import {getDateTimeParams, getDDMInterval} from 'sentry/utils/metrics';
5+
import {getDateTimeParams, getMetricsInterval} from 'sentry/utils/metrics';
66
import {getUseCaseFromMRI, MRIToField} from 'sentry/utils/metrics/mri';
77
import {useApiQuery} from 'sentry/utils/queryClient';
88
import useOrganization from 'sentry/utils/useOrganization';
@@ -62,7 +62,7 @@ const getQueryInterval = (
6262
intervalLadder?: MetricsDataIntervalLadder
6363
) => {
6464
const useCase = getUseCaseFromMRI(query.mri) ?? 'custom';
65-
return getDDMInterval(datetime, useCase, intervalLadder);
65+
return getMetricsInterval(datetime, useCase, intervalLadder);
6666
};
6767

6868
export function isMetricFormula(

static/app/views/alerts/rules/metric/metricRulePresets.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function makeDefaultCta({
5858
end: timePeriod.end,
5959
utc: timePeriod.utc,
6060
// 7 days are 9998m in alerts as of a rounding error in the `events-stats` endpoint
61-
// We need to round to 7d here to display it correctly in DDM
61+
// We need to round to 7d here to display it correctly in Metrics
6262
statsPeriod: timePeriod.period === '9998m' ? '7d' : timePeriod.period,
6363
project: projects
6464
.filter(({slug}) => rule.projects.includes(slug))

static/app/views/dashboards/types.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export enum DisplayType {
2424
export enum WidgetType {
2525
DISCOVER = 'discover',
2626
ISSUE = 'issue',
27-
RELEASE = 'metrics', // TODO(ddm): rename RELEASE to 'release', and METRICS to 'metrics'
27+
RELEASE = 'metrics', // TODO(metrics): rename RELEASE to 'release', and METRICS to 'metrics'
2828
METRICS = 'custom-metrics',
2929
}
3030

@@ -152,5 +152,4 @@ export enum DashboardWidgetSource {
152152
DASHBOARDS = 'dashboards',
153153
LIBRARY = 'library',
154154
ISSUE_DETAILS = 'issueDetail',
155-
DDM = 'ddm',
156155
}

0 commit comments

Comments
 (0)