Skip to content

Commit 9eceba7

Browse files
authored
ref(insights): use epm instead of spm in http module (#88102)
With the eap dataset, we'll only support `epm` as eap will include more then spans, events per minute is more generic. This PR converts the http module to use `epm` instead of `spm`. In the backend `spm` just maps to `epm` anyways
1 parent 40c7acc commit 9eceba7

File tree

9 files changed

+40
-30
lines changed

9 files changed

+40
-30
lines changed

static/app/views/insights/common/components/tableCells/renderHeadCell.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const {
3131
TIME_SPENT_PERCENTAGE,
3232
SPS,
3333
SPM,
34+
EPM,
3435
HTTP_ERROR_COUNT,
3536
HTTP_RESPONSE_RATE,
3637
CACHE_HIT_RATE,
@@ -48,6 +49,7 @@ export const SORTABLE_FIELDS = new Set([
4849
`count()`,
4950
`${SPS}()`,
5051
`${SPM}()`,
52+
`${EPM}()`,
5153
`${TIME_SPENT_PERCENTAGE}()`,
5254
`${HTTP_ERROR_COUNT}()`,
5355
`${HTTP_RESPONSE_RATE}(2)`,

static/app/views/insights/constants.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ export const STARFISH_AGGREGATION_FIELDS: Record<
1414
defaultOutputType: 'number',
1515
valueType: FieldValueType.NUMBER,
1616
},
17+
[SpanFunction.EPM]: {
18+
desc: t('Events per second'),
19+
kind: FieldKind.FUNCTION,
20+
defaultOutputType: 'number',
21+
valueType: FieldValueType.NUMBER,
22+
},
1723
[SpanFunction.SPM]: {
1824
desc: t('Spans per minute'),
1925
kind: FieldKind.FUNCTION,

static/app/views/insights/http/components/tables/domainTransactionsTable.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type Row = Pick<
2626
| 'project.id'
2727
| 'transaction'
2828
| 'transaction.method'
29-
| 'spm()'
29+
| 'epm()'
3030
| 'http_response_rate(3)'
3131
| 'http_response_rate(4)'
3232
| 'http_response_rate(5)'
@@ -37,7 +37,7 @@ type Row = Pick<
3737

3838
type Column = GridColumnHeader<
3939
| 'transaction'
40-
| 'spm()'
40+
| 'epm()'
4141
| 'http_response_rate(3)'
4242
| 'http_response_rate(4)'
4343
| 'http_response_rate(5)'
@@ -52,7 +52,7 @@ const COLUMN_ORDER: Column[] = [
5252
width: COL_WIDTH_UNDEFINED,
5353
},
5454
{
55-
key: 'spm()',
55+
key: 'epm()',
5656
name: `${t('Requests')} ${RATE_UNIT_TITLE[RateUnit.PER_MINUTE]}`,
5757
width: COL_WIDTH_UNDEFINED,
5858
},
@@ -85,7 +85,7 @@ const COLUMN_ORDER: Column[] = [
8585

8686
const SORTABLE_FIELDS = [
8787
'avg(span.self_time)',
88-
'spm()',
88+
'epm()',
8989
'http_response_rate(3)',
9090
'http_response_rate(4)',
9191
'http_response_rate(5)',

static/app/views/insights/http/components/tables/domainsTable.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type Row = Pick<
2626
| 'project'
2727
| 'project.id'
2828
| 'span.domain'
29-
| 'spm()'
29+
| 'epm()'
3030
| 'http_response_rate(3)'
3131
| 'http_response_rate(4)'
3232
| 'http_response_rate(5)'
@@ -38,7 +38,7 @@ type Row = Pick<
3838
type Column = GridColumnHeader<
3939
| 'span.domain'
4040
| 'project'
41-
| 'spm()'
41+
| 'epm()'
4242
| 'http_response_rate(3)'
4343
| 'http_response_rate(4)'
4444
| 'http_response_rate(5)'
@@ -58,7 +58,7 @@ const COLUMN_ORDER: Column[] = [
5858
width: COL_WIDTH_UNDEFINED,
5959
},
6060
{
61-
key: 'spm()',
61+
key: 'epm()',
6262
name: `${t('Requests')} ${RATE_UNIT_TITLE[RateUnit.PER_MINUTE]}`,
6363
width: COL_WIDTH_UNDEFINED,
6464
},
@@ -91,7 +91,7 @@ const COLUMN_ORDER: Column[] = [
9191

9292
const SORTABLE_FIELDS = [
9393
'avg(span.self_time)',
94-
'spm()',
94+
'epm()',
9595
'http_response_rate(3)',
9696
'http_response_rate(4)',
9797
'http_response_rate(5)',

static/app/views/insights/http/views/httpDomainSummaryPage.spec.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ describe('HTTPSummaryPage', function () {
126126
],
127127
meta: {
128128
fields: {
129-
'spm()': 'rate',
129+
'epm()': 'rate',
130130
},
131131
units: {
132-
'spm()': '1/second',
132+
'epm()': '1/second',
133133
},
134134
},
135135
},
@@ -227,7 +227,7 @@ describe('HTTPSummaryPage', function () {
227227
referrer: 'api.performance.http.domain-summary-throughput-chart',
228228
statsPeriod: '10d',
229229
topEvents: undefined,
230-
yAxis: 'spm()',
230+
yAxis: 'epm()',
231231
transformAliasToInputFormat: '1',
232232
},
233233
})
@@ -299,7 +299,7 @@ describe('HTTPSummaryPage', function () {
299299
dataset: 'spansMetrics',
300300
environment: [],
301301
field: [
302-
'spm()',
302+
'epm()',
303303
'avg(span.self_time)',
304304
'sum(span.self_time)',
305305
'http_response_rate(3)',
@@ -328,7 +328,7 @@ describe('HTTPSummaryPage', function () {
328328
'project.id',
329329
'transaction',
330330
'transaction.method',
331-
'spm()',
331+
'epm()',
332332
'http_response_rate(3)',
333333
'http_response_rate(4)',
334334
'http_response_rate(5)',
@@ -384,7 +384,7 @@ describe('HTTPSummaryPage', function () {
384384
'project.id': 8,
385385
transaction: '/api/users',
386386
'transaction.method': 'GET',
387-
'spm()': 17.88,
387+
'epm()': 17.88,
388388
'http_response_rate(3)': 0.97,
389389
'http_response_rate(4)': 0.025,
390390
'http_response_rate(5)': 0.005,
@@ -394,7 +394,7 @@ describe('HTTPSummaryPage', function () {
394394
],
395395
meta: {
396396
fields: {
397-
'spm()': 'rate',
397+
'epm()': 'rate',
398398
'avg(span.self_time)': 'duration',
399399
'http_response_rate(3)': 'percentage',
400400
'http_response_rate(4)': 'percentage',

static/app/views/insights/http/views/httpDomainSummaryPage.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function HTTPDomainSummaryPage() {
112112
{
113113
search: MutableSearch.fromQueryObject(filters),
114114
fields: [
115-
`${SpanFunction.SPM}()`,
115+
`${SpanFunction.EPM}()`,
116116
`avg(${SpanMetricsField.SPAN_SELF_TIME})`,
117117
`sum(${SpanMetricsField.SPAN_SELF_TIME})`,
118118
'http_response_rate(3)',
@@ -131,7 +131,7 @@ export function HTTPDomainSummaryPage() {
131131
} = useSpanMetricsSeries(
132132
{
133133
search: MutableSearch.fromQueryObject(filters),
134-
yAxis: ['spm()'],
134+
yAxis: ['epm()'],
135135
transformAliasToInputFormat: true,
136136
},
137137
Referrer.DOMAIN_SUMMARY_THROUGHPUT_CHART
@@ -176,7 +176,7 @@ export function HTTPDomainSummaryPage() {
176176
'project.id',
177177
'transaction',
178178
'transaction.method',
179-
'spm()',
179+
'epm()',
180180
'http_response_rate(3)',
181181
'http_response_rate(4)',
182182
'http_response_rate(5)',
@@ -245,7 +245,7 @@ export function HTTPDomainSummaryPage() {
245245
<ReadoutRibbon>
246246
<MetricReadout
247247
title={getThroughputTitle('http')}
248-
value={domainMetrics?.[0]?.[`${SpanFunction.SPM}()`]}
248+
value={domainMetrics?.[0]?.[`${SpanFunction.EPM}()`]}
249249
unit={RateUnit.PER_MINUTE}
250250
isLoading={areDomainMetricsLoading}
251251
/>
@@ -297,7 +297,7 @@ export function HTTPDomainSummaryPage() {
297297
<ModuleLayout.Third>
298298
<InsightsLineChartWidget
299299
title={getThroughputChartTitle('http')}
300-
series={[throughputData['spm()']]}
300+
series={[throughputData['epm()']]}
301301
isLoading={isThroughputDataLoading}
302302
error={throughputError}
303303
/>

static/app/views/insights/http/views/httpLandingPage.spec.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe('HTTPLandingPage', function () {
144144
project: 'backend',
145145
'project.id': 1,
146146
'sum(span.self_time)': 815833579.659315,
147-
'spm()': 40767.0,
147+
'epm()': 40767.0,
148148
'time_spent_percentage()': 0.33634048399458855,
149149
'http_response_rate(3)': 0.00035567983908553485,
150150
'http_response_rate(4)': 0.3931893443226139,
@@ -156,7 +156,7 @@ describe('HTTPLandingPage', function () {
156156
project: 'frontend',
157157
'project.id': 2,
158158
'sum(span.self_time)': 473552338.9970339,
159-
'spm()': 29912.133333333335,
159+
'epm()': 29912.133333333335,
160160
'time_spent_percentage()': 0.19522955032268177,
161161
'http_response_rate(3)': 0.0,
162162
'http_response_rate(4)': 0.0012324987407562593,
@@ -170,7 +170,7 @@ describe('HTTPLandingPage', function () {
170170
'span.domain': 'array',
171171
'sum(span.self_time)': 'duration',
172172
'http_response_rate(3)': 'percentage',
173-
'spm()': 'rate',
173+
'epm()': 'rate',
174174
'time_spent_percentage()': 'percentage',
175175
'http_response_rate(4)': 'percentage',
176176
'http_response_rate(5)': 'percentage',
@@ -195,10 +195,10 @@ describe('HTTPLandingPage', function () {
195195
],
196196
meta: {
197197
fields: {
198-
'spm()': 'rate',
198+
'epm()': 'rate',
199199
},
200200
units: {
201-
'spm()': '1/second',
201+
'epm()': '1/second',
202202
},
203203
},
204204
},
@@ -295,7 +295,7 @@ describe('HTTPLandingPage', function () {
295295
referrer: 'api.performance.http.landing-throughput-chart',
296296
statsPeriod: '10d',
297297
topEvents: undefined,
298-
yAxis: 'spm()',
298+
yAxis: 'epm()',
299299
transformAliasToInputFormat: '1',
300300
},
301301
})
@@ -386,7 +386,7 @@ describe('HTTPLandingPage', function () {
386386
'project',
387387
'project.id',
388388
'span.domain',
389-
'spm()',
389+
'epm()',
390390
'http_response_rate(3)',
391391
'http_response_rate(4)',
392392
'http_response_rate(5)',

static/app/views/insights/http/views/httpLandingPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function HTTPLandingPage() {
103103
} = useSpanMetricsSeries(
104104
{
105105
search: MutableSearch.fromQueryObject(chartFilters),
106-
yAxis: ['spm()'],
106+
yAxis: ['epm()'],
107107
transformAliasToInputFormat: true,
108108
},
109109
Referrer.LANDING_THROUGHPUT_CHART
@@ -142,7 +142,7 @@ export function HTTPLandingPage() {
142142
'project',
143143
'project.id',
144144
'span.domain',
145-
'spm()',
145+
'epm()',
146146
'http_response_rate(3)',
147147
'http_response_rate(4)',
148148
'http_response_rate(5)',
@@ -184,7 +184,7 @@ export function HTTPLandingPage() {
184184
<ModuleLayout.Third>
185185
<InsightsLineChartWidget
186186
title={getThroughputChartTitle('http')}
187-
series={[throughputData['spm()']]}
187+
series={[throughputData['epm()']]}
188188
isLoading={isThroughputDataLoading}
189189
error={throughputError}
190190
/>

static/app/views/insights/types.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export type ConditionalAggregate =
142142
export const SPAN_FUNCTIONS = [
143143
'sps',
144144
'spm',
145+
'epm',
145146
'count',
146147
'time_spent_percentage',
147148
'http_response_rate',
@@ -401,6 +402,7 @@ export type Op = SpanIndexedFieldTypes[SpanIndexedField.SPAN_OP];
401402
export enum SpanFunction {
402403
SPS = 'sps',
403404
SPM = 'spm',
405+
EPM = 'epm',
404406
TIME_SPENT_PERCENTAGE = 'time_spent_percentage',
405407
HTTP_ERROR_COUNT = 'http_error_count',
406408
HTTP_RESPONSE_RATE = 'http_response_rate',

0 commit comments

Comments
 (0)