mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Uptime] handle null duration on ping list (#125438)
* uptime - handle null duration * adjust types * Update x-pack/plugins/uptime/server/lib/synthetics_service/service_api_client.ts * raise per page of synthetics monitors * Remove tooltip
This commit is contained in:
parent
d364f237c5
commit
52e9c51d15
5 changed files with 18 additions and 9 deletions
|
@ -90,14 +90,14 @@ export type Tls = t.TypeOf<typeof TlsType>;
|
|||
|
||||
export const MonitorType = t.intersection([
|
||||
t.type({
|
||||
duration: t.type({
|
||||
us: t.number,
|
||||
}),
|
||||
id: t.string,
|
||||
status: t.string,
|
||||
type: t.string,
|
||||
}),
|
||||
t.partial({
|
||||
duration: t.type({
|
||||
us: t.number,
|
||||
}),
|
||||
check_group: t.string,
|
||||
ip: t.string,
|
||||
name: t.string,
|
||||
|
|
|
@ -42,7 +42,6 @@ describe('PingList component', () => {
|
|||
type: 'io',
|
||||
},
|
||||
monitor: {
|
||||
duration: { us: 1370 },
|
||||
id: 'auto-tcp-0X81440A68E839814D',
|
||||
ip: '255.255.255.0',
|
||||
name: '',
|
||||
|
@ -161,9 +160,6 @@ describe('PingList component', () => {
|
|||
"type": "io",
|
||||
},
|
||||
"monitor": Object {
|
||||
"duration": Object {
|
||||
"us": 1370,
|
||||
},
|
||||
"id": "auto-tcp-0X81440A68E839814D",
|
||||
"ip": "255.255.255.0",
|
||||
"name": "",
|
||||
|
@ -186,6 +182,13 @@ describe('PingList component', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('duration column', () => {
|
||||
it('shows -- when duration is null', () => {
|
||||
const { getByTestId } = render(<PingList />);
|
||||
expect(getByTestId('ping-list-duration-unavailable-tool-tip')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe('formatDuration', () => {
|
||||
it('returns zero for < 1 millisecond', () => {
|
||||
expect(formatDuration(984)).toBe('0 ms');
|
||||
|
|
|
@ -140,7 +140,12 @@ export function PingListTable({ loading, error, pings, pagination, onChange, fai
|
|||
name: i18n.translate('xpack.uptime.pingList.durationMsColumnLabel', {
|
||||
defaultMessage: 'Duration',
|
||||
}),
|
||||
render: (duration: number) => formatDuration(duration),
|
||||
render: (duration: number | null) =>
|
||||
duration ? (
|
||||
formatDuration(duration)
|
||||
) : (
|
||||
<span data-test-subj="ping-list-duration-unavailable-tool-tip">{'--'}</span>
|
||||
),
|
||||
},
|
||||
...(hasError
|
||||
? [
|
||||
|
|
|
@ -135,7 +135,7 @@ export const MonitorListComponent: ({
|
|||
timestamp={timestamp}
|
||||
summaryPings={summaryPings ?? []}
|
||||
monitorType={type}
|
||||
duration={duration!.us}
|
||||
duration={duration?.us}
|
||||
monitorId={monitorId}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -280,6 +280,7 @@ export class SyntheticsService {
|
|||
const findResult = await savedObjectsClient.find<SyntheticsMonitor>({
|
||||
type: syntheticsMonitorType,
|
||||
namespaces: ['*'],
|
||||
perPage: 10000,
|
||||
});
|
||||
|
||||
hydrateSavedObjects({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue