forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Synthetics] Errors page added failed test count (elastic#143633)
- Loading branch information
Showing
6 changed files
with
97 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...s/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests_count.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* 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 { useKibana } from '@kbn/kibana-react-plugin/public'; | ||
import React from 'react'; | ||
import { ClientPluginsStart } from '../../../../../plugin'; | ||
import { KpiWrapper } from '../monitor_summary/kpi_wrapper'; | ||
import { useMonitorQueryId } from '../hooks/use_monitor_query_id'; | ||
|
||
export const FailedTestsCount = (time: { to: string; from: string }) => { | ||
const { observability } = useKibana<ClientPluginsStart>().services; | ||
|
||
const { ExploratoryViewEmbeddable } = observability; | ||
|
||
const monitorId = useMonitorQueryId(); | ||
|
||
return ( | ||
<KpiWrapper> | ||
<ExploratoryViewEmbeddable | ||
reportType="single-metric" | ||
attributes={[ | ||
{ | ||
time, | ||
reportDefinitions: { | ||
'monitor.id': [monitorId], | ||
}, | ||
dataType: 'synthetics', | ||
selectedMetricField: 'monitor_failed_tests', | ||
name: 'synthetics-series-1', | ||
}, | ||
]} | ||
/> | ||
</KpiWrapper> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters