Browse Source

fix(starfish) Improve number formatting in span module pages (#50731)

- Use proper duration formatting
- Humanize large throughput numbers
George Gritsouk 1 year ago
parent
commit
db108f6ba7

+ 2 - 2
static/app/views/starfish/components/tableCells/throughputCell.tsx

@@ -2,7 +2,7 @@ import styled from '@emotion/styled';
 
 import {t} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
-import {formatPercentage} from 'sentry/utils/formatters';
+import {formatAbbreviatedNumber, formatPercentage} from 'sentry/utils/formatters';
 import {ComparisonLabel} from 'sentry/views/starfish/components/samplesTable/common';
 
 type Props = {
@@ -14,7 +14,7 @@ export default function ThroughputCell({throughputPerSecond, delta}: Props) {
   const throughput = throughputPerSecond ? throughputPerSecond.toFixed(2) : '--';
   return (
     <Container>
-      <span>{`${throughput}/${t('s')}`}</span>
+      <span>{`${formatAbbreviatedNumber(throughput)}/${t('s')}`}</span>
       {delta ? (
         <ComparisonLabel value={delta * -1}>
           {delta > 0 ? '+' : ''}

+ 1 - 2
static/app/views/starfish/views/spans/spansTable.tsx

@@ -48,8 +48,7 @@ export type Keys =
   | 'p95(span.duration)'
   | 'sps_percent_change()'
   | 'sum(span.duration)'
-  | 'time_spent_percentage()'
-  | 'percentile_percent_change(span.duration, 0.95)';
+  | 'time_spent_percentage()';
 export type TableColumnHeader = GridColumnHeader<Keys>;
 
 export default function SpansTable({