• /
  • Log in

MetricTableRowCell

Renders a row table cell showing a particular metric. The metric is formatted according to the unit passed. Units are 1:1 compatible with the ones supported by <NrqlQuery> format type CHART.

Unit and prefix formatting is automatically picked for you so that it is consistent with the rest of the platform. Metrics are automatically aligned to the left, and ellipsified from the right, which is the standard way for presenting them.

Usage

import { MetricTableRowCell } from 'nr1'

Examples

Props

classNamestring

Appends class names to the component.

Should be used only for positioning and spacing purposes.

onClickfunction

Callback fired any time the user clicks on the table cell.

function (
event: React.MouseEvent
)
styleobject

Inline style for custom styling.

Should be used only for positioning and spacing purposes.

testIdstring

Adds a data-test-id attribute.

Use it to target the component in unit and e2e tests.

toshape|string

Location object or url string to link to.

Linked TableRowCells are unstyled and will not show icons for external links. If the same styling as the Link component is what is desired, then use a Link instead as a child component within the cell.

shape

pathnamerequiredstring
searchstring
hashstring
typeenum
DEFAULT
MetricTableRowCell.TYPE.UNKNOWN

Unit of the provided metric. Will be used for auto-formatting the numerical value.

<One of
MetricTableRowCell.TYPE.APDEX,
MetricTableRowCell.TYPE.BITS,
MetricTableRowCell.TYPE.BITS_PER_MS,
MetricTableRowCell.TYPE.BITS_PER_SECOND,
MetricTableRowCell.TYPE.BYTES,
MetricTableRowCell.TYPE.BYTES_PER_MS,
MetricTableRowCell.TYPE.BYTES_PER_SECOND,
MetricTableRowCell.TYPE.CELSIUS,
MetricTableRowCell.TYPE.COUNT,
MetricTableRowCell.TYPE.HERTZ,
MetricTableRowCell.TYPE.MS,
MetricTableRowCell.TYPE.PAGES_PER_SECOND,
MetricTableRowCell.TYPE.PERCENTAGE,
MetricTableRowCell.TYPE.REQUESTS_PER_SECOND,
MetricTableRowCell.TYPE.SECONDS,
MetricTableRowCell.TYPE.TIMESTAMP,
MetricTableRowCell.TYPE.UNKNOWN,
>
valuerequirednumber

Metric value, always in the shape of a number.

Create issueEdit page
Copyright © 2021 New Relic Inc.