kibana/x-pack/test/apm_api_integration/utils.ts
Cauê Marcondes 2fcf2a91cc
[APM] Break down transaction table api removing the sparklines (#88946)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
2021-02-12 11:57:01 +01:00

19 lines
700 B
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { Coordinate } from '../../plugins/apm/typings/timeseries';
import { isFiniteNumber } from '../../plugins/apm/common/utils/is_finite_number';
import { Maybe } from '../../plugins/apm/typings/common';
export function roundNumber(num: Maybe<number>) {
return isFiniteNumber(num) ? num.toPrecision(4) : '';
}
export function removeEmptyCoordinates(coordinates: Coordinate[]) {
return coordinates.filter(({ y }) => isFiniteNumber(y));
}