Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
80c4afd
Refactor es queries and associated components/endpoints.
justinkambic Jan 25, 2019
0889e35
Add unit tests, repair broken tests.
justinkambic Jan 25, 2019
bfd9029
[Uptime] Add API functional tests for uptime graphQL (#29128)
justinkambic Jan 25, 2019
737af05
Add HB 7.0 data for API tests.
justinkambic Jan 26, 2019
665a7b7
Configure first error_list test to work with 7.x data.
justinkambic Jan 26, 2019
cd16442
Configure error_list filtered by id to work with 7.x data.
justinkambic Jan 26, 2019
59a59f4
Configure error_list functional tests to work with 7.x data.
justinkambic Jan 27, 2019
a03fb9d
Update snapshot test to work with 7.x data.
justinkambic Jan 27, 2019
04e8818
Update snapshot down filtered test to work with 7.x data.
justinkambic Jan 27, 2019
91b961d
Configure snapshot up test to work with 7.x data.
justinkambic Jan 27, 2019
fecfe54
Configure ping list tests to work with 7.x data.
justinkambic Jan 27, 2019
28db77e
Configure monitor list tests to work with 7.x data.
justinkambic Jan 27, 2019
ab9d159
Configure monitor status bar tests to work with 7.x data.
justinkambic Jan 27, 2019
a3f6d6f
Configure filterBar tests to work with 7.x data.
justinkambic Jan 27, 2019
e911f62
Configure docCount tests to work with 7.x data.
justinkambic Jan 27, 2019
8b42129
Simplify code based on PR feedback.
justinkambic Jan 27, 2019
78f88c6
Add loading spinner to monitor page title based on PR feedback.
justinkambic Jan 27, 2019
3e7e918
Rename GQL type based on PR feedback.
justinkambic Jan 27, 2019
dd2916d
Remove use of 'undefined' in ES query based on PR feedback.
justinkambic Jan 27, 2019
8178a47
Simplify code based on PR feedback.
justinkambic Jan 27, 2019
81eb06c
Add definite size/shard_size for terms agg based on PR feedback.
justinkambic Jan 28, 2019
fd7f930
Simplify ES query based on PR feedback.
justinkambic Jan 28, 2019
a714129
Update x-pack/plugins/uptime/server/lib/adapters/monitors/elasticsear…
pickypg Jan 28, 2019
81baabd
Increase size for ES errors query based on PR feedback.
justinkambic Jan 28, 2019
c5b198b
Fix hardcoded field in terms filter based on PR feedback.
justinkambic Jan 28, 2019
ed4d83d
Simplify get code for monitors function.
justinkambic Jan 28, 2019
21a7b3b
Reduce unnecessarily large size for terms agg based on PR feedback.
justinkambic Jan 28, 2019
d2dc10a
Pluralize filter bar props.
justinkambic Jan 28, 2019
f4f863d
Refactor filter bar query based on PR feedback.
justinkambic Jan 28, 2019
6728fd6
Update test.
justinkambic Jan 28, 2019
6d542a8
Merge branch 'master' into uptime_port-func-tests-to-7.x
justinkambic Jan 28, 2019
5dd3fcd
Merge branch 'uptime_improve-es-queries' into uptime_port-func-tests-…
justinkambic Jan 28, 2019
c11f6f0
Fix busted GQL query.
justinkambic Jan 28, 2019
ea4e0ef
Update functional test docs to use data without buggy values.
justinkambic Jan 28, 2019
c82ca56
Update index name in HB functional api test docs.
justinkambic Jan 28, 2019
180196b
Update snapshot base functional test.
justinkambic Jan 28, 2019
9f6088e
Make snapshot filter tests pass, fix associated bug.
justinkambic Jan 28, 2019
ffbc297
Configure remaining snapshot e2e tests to work with 7.x data.
justinkambic Jan 29, 2019
1f4b1f1
Give better variable names and comments for ugly code.
justinkambic Jan 29, 2019
12df980
Configure ping list query tests to work with updated 7.x data.
justinkambic Jan 29, 2019
bafbcfb
Rename graphql describe block.
justinkambic Jan 29, 2019
7f77844
Update monitor status bar query tests to work with updated 7.x data.
justinkambic Jan 29, 2019
f70b731
Update monitor list query tests to work with updated 7.x data.
justinkambic Jan 29, 2019
3832749
Update filter bar query to work with updated 7.x data.
justinkambic Jan 29, 2019
ec731ca
Update error list query to work with updated 7.x data.
justinkambic Jan 29, 2019
b547914
Update doc count fixture to work with new 7.x data.
justinkambic Jan 29, 2019
096bb14
Merge branch 'master' into uptime_port-func-tests-to-7.x
justinkambic Jan 29, 2019
e111662
Merge branch 'master' into uptime_port-func-tests-to-7.x
justinkambic Jan 29, 2019
90752cb
Merge branch 'master' into uptime_port-func-tests-to-7.x
justinkambic Jan 30, 2019
41e0529
Merge branch 'master' into uptime_port-func-tests-to-7.x
justinkambic Jan 31, 2019
8856be8
Address PR feedback with filter typing to clean up code.
justinkambic Jan 31, 2019
c747e4f
Add comments based on PR feedback.
justinkambic Jan 31, 2019
9b3b9f2
Fix bug introduced in 8856be8e39a32b395f84da07ddc667c1f212068b.
justinkambic Jan 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions x-pack/plugins/uptime/common/graphql/introspection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1698,14 +1698,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "trouble",
"description": "",
"args": [],
"type": { "kind": "SCALAR", "name": "Int", "ofType": null },
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "total",
"description": "",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/uptime/common/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,6 @@ export interface Snapshot {

down?: number | null;

trouble?: number | null;

total?: number | null;

histogram?: (HistogramSeries | null)[] | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@

import gql from 'graphql-tag';

export const getDocCountQuery = gql`
{
getDocCount {
count
}
export const getDocCountQueryString = `
{
getDocCount {
count
}
}
`;

export const getDocCountQuery = gql`
${getDocCountQueryString}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ interface ErrorListProps {
type Props = ErrorListProps & UptimeCommonProps;

export const ErrorList = ({
autorefreshInterval,
autorefreshIsPaused,
dateRangeStart,
dateRangeEnd,
filters,
autorefreshInterval,
autorefreshIsPaused,
}: Props) => (
<Query
pollInterval={autorefreshIsPaused ? undefined : autorefreshInterval}
query={getErrorListQuery}
variables={{ dateRangeStart, dateRangeEnd, filters }}
pollInterval={autorefreshIsPaused ? undefined : autorefreshInterval}
>
{({ loading, error, data }) => {
if (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@

import gql from 'graphql-tag';

export const getErrorListQuery = gql`
query ErrorList($dateRangeStart: String!, $dateRangeEnd: String!, $filters: String) {
errorList: getErrorsList(
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
filters: $filters
) {
latestMessage
monitorId
type
count
statusCode
timestamp
}
export const getErrorListQueryString = `
query ErrorList($dateRangeStart: String!, $dateRangeEnd: String!, $filters: String) {
errorList: getErrorsList(
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
filters: $filters
) {
latestMessage
monitorId
type
count
statusCode
timestamp
}
}
`;

export const getErrorListQuery = gql`
${getErrorListQueryString}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,18 @@ type Props = FilterBarProps & UptimeCommonProps;
const MAX_SELECTION_LENGTH = 20;
const SEARCH_THRESHOLD = 2;

export const FilterBar = ({ dateRangeEnd, dateRangeStart, updateQuery }: Props) => (
<Query query={getFilterBarQuery} variables={{ dateRangeStart, dateRangeEnd }}>
export const FilterBar = ({
autorefreshInterval,
autorefreshIsPaused,
dateRangeStart,
dateRangeEnd,
updateQuery,
}: Props) => (
<Query
pollInterval={autorefreshIsPaused ? undefined : autorefreshInterval}
query={getFilterBarQuery}
variables={{ dateRangeStart, dateRangeEnd }}
>
{({ loading, error, data }) => {
if (loading) {
return i18n.translate('xpack.uptime.filterBar.loadingMessage', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import gql from 'graphql-tag';

export const getFilterBarQuery = gql`
query FilterBar($dateRangeStart: String!, $dateRangeEnd: String!) {
filterBar: getFilterBar(dateRangeStart: $dateRangeStart, dateRangeEnd: $dateRangeEnd) {
ports
export const getFilterBarQueryString = `
query FilterBar($dateRangeStart: String!, $dateRangeEnd: String!) {
filterBar: getFilterBar(dateRangeStart: $dateRangeStart, dateRangeEnd: $dateRangeEnd) {
ports
ids {
key
url
Expand All @@ -18,3 +18,7 @@ export const getFilterBarQuery = gql`
}
}
`;

export const getFilterBarQuery = gql`
${getFilterBarQueryString}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,35 @@

import gql from 'graphql-tag';

export const createGetMonitorChartsQuery = gql`
query MonitorCharts($dateRangeStart: String!, $dateRangeEnd: String!, $monitorId: String!) {
monitorChartsData: getMonitorChartsData(
monitorId: $monitorId
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
) {
minDuration {
x
y
}
maxDuration {
x
y
}
avgDuration {
x
y
}
status {
x
up
down
total
}
export const createGetMonitorChartsQueryString = `
query MonitorCharts($dateRangeStart: String!, $dateRangeEnd: String!, $monitorId: String!) {
monitorChartsData: getMonitorChartsData(
monitorId: $monitorId
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
) {
minDuration {
x
y
}
maxDuration {
x
y
}
avgDuration {
x
y
}
status {
x
up
down
total
}
}
}
`;

export const createGetMonitorChartsQuery = gql`
${createGetMonitorChartsQueryString}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import gql from 'graphql-tag';

export const getMonitorListQuery = gql`
export const getMonitorListQueryString = `
query MonitorList($dateRangeStart: String!, $dateRangeEnd: String!, $filters: String) {
monitorStatus: getMonitors(
dateRangeStart: $dateRangeStart
Expand Down Expand Up @@ -45,3 +45,7 @@ export const getMonitorListQuery = gql`
}
}
`;

export const getMonitorListQuery = gql`
${getMonitorListQueryString}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,28 @@

import gql from 'graphql-tag';

export const createGetMonitorStatusBarQuery = gql`
query MonitorStatus($dateRangeStart: String!, $dateRangeEnd: String!, $monitorId: String) {
monitorStatus: getLatestMonitors(
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
monitorId: $monitorId
) {
timestamp
millisFromNow
monitor {
status
host
ip
duration {
us
}
}
url {
full
export const getMonitorStatusBarQueryString = `
query MonitorStatus($dateRangeStart: String!, $dateRangeEnd: String!, $monitorId: String) {
monitorStatus: getLatestMonitors(
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
monitorId: $monitorId
) {
timestamp
millisFromNow
monitor {
status
duration {
us
}
}
url {
full
}
}
}
`;

export const getMonitorStatusBarQuery = gql`
${getMonitorStatusBarQueryString}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { UptimeCommonProps } from '../../../uptime_app';
import { StatusBar } from '../../functional';
import { EmptyStatusBar } from '../../functional/empty_status_bar';
import { formatDuration } from './format_duration';
import { createGetMonitorStatusBarQuery } from './get_monitor_status_bar';
import { getMonitorStatusBarQuery } from './get_monitor_status_bar';

interface MonitorStatusBarProps {
monitorId: string;
Expand All @@ -37,7 +37,7 @@ export const MonitorStatusBar = ({
}: Props) => (
<Query
pollInterval={autorefreshIsPaused ? undefined : autorefreshInterval}
query={createGetMonitorStatusBarQuery}
query={getMonitorStatusBarQuery}
variables={{ dateRangeStart, dateRangeEnd, monitorId }}
>
{({ loading, error, data }: MonitorStatusBarQueryParams) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

import gql from 'graphql-tag';

export const getPingsQuery = gql`
query PingList(
$dateRangeStart: String!
$dateRangeEnd: String!
$monitorId: String
$status: String
$sort: String
$size: Int
export const getPingsQueryString = `
query PingList(
$dateRangeStart: String!
$dateRangeEnd: String!
$monitorId: String
$status: String
$sort: String
$size: Int
) {
allPings(
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
monitorId: $monitorId
status: $status
sort: $sort
size: $size
) {
allPings(
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
monitorId: $monitorId
status: $status
sort: $sort
size: $size
) {
total
pings {
timestamp
Expand Down Expand Up @@ -50,3 +50,7 @@ export const getPingsQuery = gql`
}
}
`;

export const getPingsQuery = gql`
${getPingsQueryString}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,34 @@

import gql from 'graphql-tag';

export const getSnapshotQuery = gql`
query Snapshot($dateRangeStart: String!, $dateRangeEnd: String!, $filters: String) {
snapshot: getSnapshot(
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
filters: $filters
) {
up
down
total
histogram {
monitorId
data {
upCount
downCount
x
x0
y
}
export const getSnapshotQueryString = `
query Snapshot(
$dateRangeStart: String!
$dateRangeEnd: String!
$filters: String
) {
snapshot: getSnapshot(
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
filters: $filters
) {
up
down
total
histogram {
monitorId
data {
upCount
downCount
x
x0
y
}
}
}
}
`;

export const getSnapshotQuery = gql`
${getSnapshotQueryString}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const monitorsSchema = gql`
type Snapshot {
up: Int
down: Int
trouble: Int
total: Int
histogram: [HistogramSeries]
}
Expand Down
Loading