Browse Source

fix(perf): Fix incorrect units in TPM table field (#57019)

We need to make sure to pass the field unit to the renderer. Without the
unit, depending on the field type, it might assume an incorrect unit.
For example, `"rate"` fields will assume the rate is per second, even
though it might actually be per minute.

The Performance landing page table wasn't passing the unit, so it was
incorrectly showing rates as "/s" even though they're "/min".
George Gritsouk 1 year ago
parent
commit
ca9e693a8c
1 changed files with 6 additions and 1 deletions
  1. 6 1
      static/app/views/performance/table.tsx

+ 6 - 1
static/app/views/performance/table.tsx

@@ -214,8 +214,13 @@ class _Table extends Component<Props, State> {
     const tableMeta = tableData.meta;
 
     const field = String(column.key);
+
     const fieldRenderer = getFieldRenderer(field, tableMeta, false);
-    const rendered = fieldRenderer(dataRow, {organization, location});
+    const rendered = fieldRenderer(dataRow, {
+      organization,
+      location,
+      unit: tableMeta.units?.[column.key],
+    });
 
     const allowActions = [
       Actions.ADD,