|
@@ -16,15 +16,22 @@ import {useResourcesQuery} from 'sentry/views/performance/browser/resources/util
|
|
|
import {DurationCell} from 'sentry/views/starfish/components/tableCells/durationCell';
|
|
|
import {renderHeadCell} from 'sentry/views/starfish/components/tableCells/renderHeadCell';
|
|
|
import {ThroughputCell} from 'sentry/views/starfish/components/tableCells/throughputCell';
|
|
|
-import {SpanMetricsField} from 'sentry/views/starfish/types';
|
|
|
+import {SpanFunction, SpanMetricsField} from 'sentry/views/starfish/types';
|
|
|
|
|
|
-const {SPAN_DESCRIPTION, RESOURCE_RENDER_BLOCKING_STATUS, SPAN_OP, SPAN_SELF_TIME} =
|
|
|
- SpanMetricsField;
|
|
|
+const {
|
|
|
+ SPAN_DESCRIPTION,
|
|
|
+ RESOURCE_RENDER_BLOCKING_STATUS,
|
|
|
+ SPAN_OP,
|
|
|
+ SPAN_SELF_TIME,
|
|
|
+ HTTP_RESPONSE_CONTENT_LENGTH,
|
|
|
+} = SpanMetricsField;
|
|
|
+
|
|
|
+const {SPM} = SpanFunction;
|
|
|
|
|
|
type Row = {
|
|
|
+ 'avg(http.response_content_length)': number;
|
|
|
'avg(span.self_time)': number;
|
|
|
'http.decoded_response_content_length': number;
|
|
|
- 'http.response_content_length': number;
|
|
|
'resource.render_blocking_status': string;
|
|
|
'span.description': string;
|
|
|
'span.domain': string;
|
|
@@ -48,24 +55,24 @@ function ResourceTable({sort}: Props) {
|
|
|
{key: SPAN_OP, width: COL_WIDTH_UNDEFINED, name: 'Type'},
|
|
|
{key: `avg(${SPAN_SELF_TIME})`, width: COL_WIDTH_UNDEFINED, name: 'Avg Duration'},
|
|
|
{
|
|
|
- key: 'spm()',
|
|
|
+ key: `${SPM}()`,
|
|
|
width: COL_WIDTH_UNDEFINED,
|
|
|
- name: 'Throughput',
|
|
|
+ name: t('Throughput'),
|
|
|
},
|
|
|
{
|
|
|
- key: 'http.response_content_length',
|
|
|
+ key: `avg(${HTTP_RESPONSE_CONTENT_LENGTH})`,
|
|
|
width: COL_WIDTH_UNDEFINED,
|
|
|
- name: 'Resource size',
|
|
|
+ name: t('Avg Resource size'),
|
|
|
},
|
|
|
{
|
|
|
key: RESOURCE_RENDER_BLOCKING_STATUS,
|
|
|
width: COL_WIDTH_UNDEFINED,
|
|
|
- name: 'Render blocking',
|
|
|
+ name: t('Render blocking'),
|
|
|
},
|
|
|
{
|
|
|
key: 'http.decoded_response_content_length',
|
|
|
width: COL_WIDTH_UNDEFINED,
|
|
|
- name: 'Uncompressed',
|
|
|
+ name: t('Uncompressed'),
|
|
|
},
|
|
|
];
|
|
|
const tableData: Row[] = data.length
|
|
@@ -74,7 +81,6 @@ function ResourceTable({sort}: Props) {
|
|
|
'http.decoded_response_content_length': Math.floor(
|
|
|
Math.random() * (1000 - 500) + 500
|
|
|
),
|
|
|
- 'http.response_content_length': Math.floor(Math.random() * (500 - 50) + 50),
|
|
|
}))
|
|
|
: [];
|
|
|
|
|
@@ -90,7 +96,7 @@ function ResourceTable({sort}: Props) {
|
|
|
if (key === 'spm()') {
|
|
|
return <ThroughputCell rate={row[key] * 60} unit={RateUnits.PER_SECOND} />;
|
|
|
}
|
|
|
- if (key === 'http.response_content_length') {
|
|
|
+ if (key === 'avg(http.response_content_length)') {
|
|
|
return <FileSize bytes={row[key]} />;
|
|
|
}
|
|
|
if (key === `avg(span.self_time)`) {
|
|
@@ -109,10 +115,10 @@ function ResourceTable({sort}: Props) {
|
|
|
return <span>{opName}</span>;
|
|
|
}
|
|
|
if (key === 'http.decoded_response_content_length') {
|
|
|
- const isCompressed =
|
|
|
- row['http.response_content_length'] !==
|
|
|
+ const isUncompressed =
|
|
|
+ row['http.response_content_length'] ===
|
|
|
row['http.decoded_response_content_length'];
|
|
|
- return <span>{isCompressed ? t('true') : t('false')}</span>;
|
|
|
+ return <span>{isUncompressed ? t('true') : t('false')}</span>;
|
|
|
}
|
|
|
return <span>{row[key]}</span>;
|
|
|
};
|