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.
[Observability]Adding specific Return APIs for each plugin (elastic#6…
…9257) * Adding specific apis for each plugin * adding metric hosts stat * addressing PR comment * addressing PR comments * changing series to key/value * exporting interfaces * adding label to stat * refactoring types Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
f38404f
commit 654974c
Showing
3 changed files
with
107 additions
and
44 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
42 changes: 0 additions & 42 deletions
42
x-pack/plugins/observability/public/typings/data_handler/index.d.ts
This file was deleted.
Oops, something went wrong.
86 changes: 86 additions & 0 deletions
86
x-pack/plugins/observability/public/typings/fetch_data_response/index.d.ts
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,86 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
interface Percentage { | ||
label: string; | ||
pct: number; | ||
color?: string; | ||
} | ||
interface Bytes { | ||
label: string; | ||
bytes: number; | ||
color?: string; | ||
} | ||
interface Numeral { | ||
label: string; | ||
value: number; | ||
color?: string; | ||
} | ||
|
||
export interface Coordinates { | ||
x: number; | ||
y?: number; | ||
} | ||
|
||
interface Series { | ||
label: string; | ||
coordinates: Coordinates[]; | ||
color?: string; | ||
} | ||
|
||
export interface FetchDataResponse { | ||
title: string; | ||
appLink: string; | ||
} | ||
|
||
export interface LogsFetchDataResponse extends FetchDataResponse { | ||
stats: Record<string, Numeral>; | ||
series: Record<string, Series>; | ||
} | ||
|
||
export interface MetricsFetchDataResponse extends FetchDataResponse { | ||
stats: { | ||
hosts: Numeral; | ||
cpu: Percentage; | ||
memory: Percentage; | ||
disk: Percentage; | ||
inboundTraffic: Bytes; | ||
outboundTraffic: Bytes; | ||
}; | ||
series: { | ||
inboundTraffic: Series; | ||
outboundTraffic: Series; | ||
}; | ||
} | ||
|
||
export interface UptimeFetchDataResponse extends FetchDataResponse { | ||
stats: { | ||
monitors: Numeral; | ||
up: Numeral; | ||
down: Numeral; | ||
}; | ||
series: { | ||
up: Series; | ||
down: Series; | ||
}; | ||
} | ||
|
||
export interface ApmFetchDataResponse extends FetchDataResponse { | ||
stats: { | ||
services: Numeral; | ||
transactions: Numeral; | ||
}; | ||
series: { | ||
transactions: Series; | ||
}; | ||
} | ||
|
||
export interface ObservabilityFetchDataResponse { | ||
apm: ApmFetchDataResponse; | ||
infra_metrics: MetricsFetchDataResponse; | ||
infra_logs: LogsFetchDataResponse; | ||
uptime: UptimeFetchDataResponse; | ||
} |