@@ -11,6 +11,7 @@ import {
1111 PluginInitializerContext ,
1212 AppMountParameters ,
1313} from 'kibana/public' ;
14+ import { UptimeFetchDataResponse } from '../../../observability/public/typings/fetch_data_response' ;
1415import { DEFAULT_APP_CATEGORIES } from '../../../../../src/core/public' ;
1516import { UMFrontendLibs } from '../lib/lib' ;
1617import { PLUGIN } from '../../common/constants' ;
@@ -27,9 +28,8 @@ import {
2728} from '../../../../../src/plugins/data/public' ;
2829import { alertTypeInitializers } from '../lib/alert_types' ;
2930import { kibanaService } from '../state/kibana_service' ;
30- import { UptimeFetchDataResponse } from 'x-pack/plugins/observability/public/typings/fetch_data_response' ;
3131import { fetchSnapshotCount , fetchIndexStatus , fetchPingHistogram } from '../state/api' ;
32- import { ObservabilityPluginSetup } from 'x-pack/plugins /observability/public' ;
32+ import { ObservabilityPluginSetup } from '../../.. /observability/public' ;
3333
3434export interface ClientPluginsSetup {
3535 data : DataPublicPluginSetup ;
@@ -74,12 +74,15 @@ export class UptimePlugin
7474 const status = await fetchIndexStatus ( ) ;
7575 return status . docCount > 0 ;
7676 } ,
77- fetchData : async ( { startTime, endTime, bucketSize} ) => {
78- const snapshot = await fetchSnapshotCount ( { dateRangeStart : startTime , dateRangeEnd : endTime } ) ;
79- const pings = await fetchPingHistogram ( { dateStart : startTime , dateEnd : endTime } ) ;
77+ fetchData : async ( { startTime, endTime, bucketSize } ) => {
78+ const snapshot = await fetchSnapshotCount ( {
79+ dateRangeStart : startTime ,
80+ dateRangeEnd : endTime ,
81+ } ) ;
82+ const pings = await fetchPingHistogram ( { dateStart : startTime , dateEnd : endTime } ) ;
8083 const response : UptimeFetchDataResponse = {
8184 title : 'Uptime' ,
82- appLink : " /app/uptime#/" , // Todo is there some sort of helper that handles subpaths?
85+ appLink : ' /app/uptime#/' , // Todo is there some sort of helper that handles subpaths?
8386 stats : {
8487 monitors : {
8588 type : 'number' ,
@@ -94,19 +97,23 @@ export class UptimePlugin
9497 down : {
9598 type : 'number' ,
9699 label : 'Down' ,
97- value : snapshot . down
98- }
100+ value : snapshot . down ,
101+ } ,
99102 } ,
100103 series : {
101104 up : {
102105 label : 'Up' ,
103- coordinates : pings . histogram . map ( p => { return { x : p . x ! , y : p . upCount || 0 } } )
106+ coordinates : pings . histogram . map ( ( p ) => {
107+ return { x : p . x ! , y : p . upCount || 0 } ;
108+ } ) ,
104109 } ,
105110 down : {
106111 label : 'Down' ,
107- coordinates : pings . histogram . map ( p => { return { x : p . x ! , y : p . downCount || 0 } } )
108- }
109- }
112+ coordinates : pings . histogram . map ( ( p ) => {
113+ return { x : p . x ! , y : p . downCount || 0 } ;
114+ } ) ,
115+ } ,
116+ } ,
110117 } ;
111118 return response ;
112119 } ,
0 commit comments