Skip to content

Commit 71f8232

Browse files
TkDodogggritso
andauthored
ref(✂️): remove unused useDiscoverSeries (#100296)
The only usage was in its own test, since the usage is currently being replaced with the `useFetchSpanTimeSeries` hook. Interestingly, the `DiscoverSeries` type stays behind because it’s used in a bunch of places, but those will be slowly eliminated as the `useFetchSpanTimeSeries` hook gets more usage. Closes ENG-5604 --------- Co-authored-by: George Gritsouk <[email protected]>
1 parent 8b5f442 commit 71f8232

File tree

15 files changed

+17
-528
lines changed

15 files changed

+17
-528
lines changed

static/app/components/charts/chartWidgetLoader-unmocked-imports.spec.tsx

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -96,48 +96,6 @@ jest.mock('sentry/views/insights/common/queries/useTopNDiscoverSeries', () => ({
9696
error: null,
9797
})),
9898
}));
99-
jest.mock('sentry/views/insights/common/queries/useDiscoverSeries', () => ({
100-
useSpanSeries: jest.fn(() => ({
101-
data: {
102-
'epm()': {},
103-
'count(span.duration)': mockDiscoverSeries('count(span.duration)'),
104-
'avg(span.duration)': mockDiscoverSeries('avg(span.duration)'),
105-
'p95(span.duration)': mockDiscoverSeries('p95(span.duration)'),
106-
'trace_status_rate(internal_error)': mockDiscoverSeries(
107-
'trace_status_rate(internal_error)'
108-
),
109-
'cache_miss_rate()': {},
110-
'http_response_rate(3)': {},
111-
'http_response_rate(4)': {},
112-
'http_response_rate(5)': {},
113-
'avg(span.self_time)': {},
114-
'avg(http.response_content_length)': {},
115-
'avg(http.response_transfer_size)': {},
116-
'avg(http.decoded_response_content_length)': {},
117-
'avg(messaging.message.receive.latency)': {},
118-
'performance_score(measurements.score.lcp)': {
119-
data: [],
120-
},
121-
'performance_score(measurements.score.fcp)': {
122-
data: [],
123-
},
124-
'performance_score(measurements.score.cls)': {
125-
data: [],
126-
},
127-
'performance_score(measurements.score.inp)': {
128-
data: [],
129-
},
130-
'performance_score(measurements.score.ttfb)': {
131-
data: [],
132-
},
133-
'count()': {
134-
data: [],
135-
},
136-
},
137-
isPending: false,
138-
error: null,
139-
})),
140-
}));
14199
jest.mock('sentry/utils/timeSeries/useFetchEventsTimeSeries', () => ({
142100
useFetchSpanTimeSeries: jest.fn(({groupBy}: {groupBy?: string[]}) => ({
143101
data: {

static/app/views/insights/common/components/insightsTimeSeriesWidget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {
4141
ModalChartContainer,
4242
} from 'sentry/views/insights/common/components/insightsChartContainer';
4343
import type {LoadableChartWidgetProps} from 'sentry/views/insights/common/components/widgets/types';
44-
import type {DiscoverSeries} from 'sentry/views/insights/common/queries/useDiscoverSeries';
44+
import type {DiscoverSeries} from 'sentry/views/insights/common/queries/types';
4545
import {convertSeriesToTimeseries} from 'sentry/views/insights/common/utils/convertSeriesToTimeseries';
4646
import {BASE_FIELD_ALIASES, INGESTION_DELAY} from 'sentry/views/insights/settings';
4747
import type {SpanFields} from 'sentry/views/insights/types';

static/app/views/insights/common/queries/convertDiscoverTimeseriesResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import moment from 'moment-timezone';
22

3-
import type {DiscoverSeries} from './useDiscoverSeries';
3+
import type {DiscoverSeries} from './types';
44

55
const DATE_FORMAT = 'YYYY-MM-DDTHH:mm:ssZ';
66

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type {Series} from 'sentry/types/echarts';
2+
import {type EventsMetaType} from 'sentry/utils/discover/eventView';
3+
4+
export type DiscoverSeries = Series & {
5+
meta: EventsMetaType;
6+
};

0 commit comments

Comments
 (0)