Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APM] Service overview: Transactions table #83429

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions x-pack/plugins/apm/common/utils/formatters/duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import { i18n } from '@kbn/i18n';
import moment from 'moment';
import { memoize } from 'lodash';
import { memoize, isNumber } from 'lodash';
import { NOT_AVAILABLE_LABEL } from '../../../common/i18n';
import { asDecimalOrInteger, asInteger } from './formatters';
import { asDecimal, asDecimalOrInteger, asInteger } from './formatters';
import { TimeUnit } from './datetime';
import { Maybe } from '../../../typings/common';

Expand Down Expand Up @@ -143,6 +143,29 @@ export const getDurationFormatter: TimeFormatterBuilder = memoize(
}
);

export function asTransactionRate(value: Maybe<number>) {
if (!isNumber(value)) {
return NOT_AVAILABLE_LABEL;
}

let displayedValue: string;

if (value === 0) {
displayedValue = '0';
} else if (value <= 0.1) {
displayedValue = '< 0.1';
} else {
displayedValue = asDecimal(value);
}

return i18n.translate('xpack.apm.transactionRateLabel', {
defaultMessage: `{value} tpm`,
values: {
value: displayedValue,
},
});
}

/**
* Converts value and returns it formatted - 00 unit
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import { isRumAgentName } from '../../../../common/agent_name';
import { ChartsSyncContextProvider } from '../../../context/charts_sync_context';
import { TransactionErrorRateChart } from '../../shared/charts/transaction_error_rate_chart';
import { ServiceMapLink } from '../../shared/Links/apm/ServiceMapLink';
import { TransactionOverviewLink } from '../../shared/Links/apm/TransactionOverviewLink';
import { SearchBar } from '../../shared/search_bar';
import { ServiceOverviewErrorsTable } from './service_overview_errors_table';
import { ServiceOverviewTransactionsTable } from './service_overview_transactions_table';
import { TableLinkFlexItem } from './table_link_flex_item';

const rowHeight = 310;
Expand Down Expand Up @@ -84,30 +84,7 @@ export function ServiceOverview({
</EuiFlexItem>
<EuiFlexItem grow={6}>
<EuiPanel>
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem>
<EuiTitle size="xs">
<h2>
{i18n.translate(
'xpack.apm.serviceOverview.transactionsTableTitle',
{
defaultMessage: 'Transactions',
}
)}
</h2>
</EuiTitle>
</EuiFlexItem>
<TableLinkFlexItem>
<TransactionOverviewLink serviceName={serviceName}>
{i18n.translate(
'xpack.apm.serviceOverview.transactionsTableLinkText',
{
defaultMessage: 'View transactions',
}
)}
</TransactionOverviewLink>
</TableLinkFlexItem>
</EuiFlexGroup>
<ServiceOverviewTransactionsTable serviceName={serviceName} />
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { callApmApi } from '../../../../services/rest/createCallApmApi';
import { TimestampTooltip } from '../../../shared/TimestampTooltip';
import { ErrorDetailLink } from '../../../shared/Links/apm/ErrorDetailLink';
import { px, truncate, unit } from '../../../../style/variables';
import { FetchWrapper } from './fetch_wrapper';
import { TableFetchWrapper } from '../../../shared/table_fetch_wrapper';

interface Props {
serviceName: string;
Expand Down Expand Up @@ -223,7 +223,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) {
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem>
<FetchWrapper hasData={!!items.length} status={status}>
<TableFetchWrapper hasData={!!items.length} status={status}>
<EuiBasicTable
columns={columns}
items={items}
Expand Down Expand Up @@ -259,7 +259,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) {
},
}}
/>
</FetchWrapper>
</TableFetchWrapper>
</EuiFlexItem>
</EuiFlexGroup>
);
Expand Down
Loading