[Uptime] Display pings over time instead of status over time (#40759) (#40888)

This PR changes the reverts the data shown in the status over time chart to what we showed in older versions. This makes it display simple ping counts instead of the weird metric it currently displays. The current count doesn't make any sense with coalesced locations like we have in 7.3. Given that the current chart is so confusing as to be harmful I'm marking this a bug.
This commit is contained in:
Andrew Cholakian 2019-07-17 03:00:39 -05:00 committed by GitHub
parent 5940b2f14f
commit 852819eccb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 117 additions and 196 deletions

View file

@ -67,8 +67,8 @@ export const SnapshotHistogramComponent = ({
<EuiTitle size="xs">
<h5>
<FormattedMessage
id="xpack.uptime.snapshot.statusOverTimeTitle"
defaultMessage="Status over time"
id="xpack.uptime.snapshot.pingsOverTimeTitle"
defaultMessage="Pings over time"
/>
</h5>
</EuiTitle>
@ -111,8 +111,8 @@ export const SnapshotHistogramComponent = ({
<EuiTitle size="xs">
<h5>
<FormattedMessage
id="xpack.uptime.snapshot.statusOverTimeTitle"
defaultMessage="Status over time"
id="xpack.uptime.snapshot.pingsOverTimeTitle"
defaultMessage="Pings over time"
/>
</h5>
</EuiTitle>

View file

@ -15,6 +15,32 @@ describe('ElasticsearchPingsAdapter class', () => {
let mockHits: any[];
let mockEsSearchResult: any;
let mockEsCountResult: any;
const standardMockResponse: any = {
aggregations: {
timeseries: {
buckets: [
{
key: 1,
up: {
doc_count: 2,
},
down: {
doc_count: 1,
},
},
{
key: 2,
up: {
doc_count: 2,
},
down: {
bucket_count: 1,
},
},
],
},
},
};
beforeEach(() => {
mockHits = [
@ -71,13 +97,11 @@ describe('ElasticsearchPingsAdapter class', () => {
buckets: [
{
key: 1,
bucket_total: {
value: 2,
up: {
doc_count: 2,
},
down: {
bucket_count: {
value: 1,
},
doc_count: 1,
},
},
],
@ -98,36 +122,9 @@ describe('ElasticsearchPingsAdapter class', () => {
it('returns expected result for no status filter', async () => {
expect.assertions(2);
const search = jest.fn();
search.mockReturnValue({
aggregations: {
timeseries: {
buckets: [
{
key: 1,
bucket_total: {
value: 3,
},
down: {
bucket_count: {
value: 1,
},
},
},
{
key: 2,
bucket_total: {
value: 3,
},
down: {
bucket_count: {
value: 1,
},
},
},
],
},
},
});
search.mockReturnValue(standardMockResponse);
const pingDatabase = {
search,
count: jest.fn(),
@ -149,35 +146,29 @@ describe('ElasticsearchPingsAdapter class', () => {
buckets: [
{
key: 1,
bucket_total: {
value: 3,
up: {
doc_count: 2,
},
down: {
bucket_count: {
value: 1,
},
doc_count: 1,
},
},
{
key: 2,
bucket_total: {
value: 3,
up: {
doc_count: 2,
},
down: {
bucket_count: {
value: 2,
},
doc_count: 2,
},
},
{
key: 3,
bucket_total: {
value: 3,
up: {
doc_count: 3,
},
down: {
bucket_count: {
value: 1,
},
doc_count: 1,
},
},
],
@ -219,35 +210,29 @@ describe('ElasticsearchPingsAdapter class', () => {
buckets: [
{
key: 1,
bucket_total: {
value: 3,
up: {
doc_count: 2,
},
down: {
bucket_count: {
value: 1,
},
doc_count: 1,
},
},
{
key: 2,
bucket_total: {
value: 3,
up: {
doc_count: 1,
},
down: {
bucket_count: {
value: 2,
},
doc_count: 2,
},
},
{
key: 3,
bucket_total: {
value: 3,
up: {
doc_count: 3,
},
down: {
bucket_count: {
value: 1,
},
doc_count: 1,
},
},
],
@ -275,36 +260,7 @@ describe('ElasticsearchPingsAdapter class', () => {
it('returns a down-filtered array for when filtered by down status', async () => {
expect.assertions(2);
const search = jest.fn();
search.mockReturnValue({
aggregations: {
timeseries: {
buckets: [
{
key: 1,
bucket_total: {
value: 3,
},
down: {
bucket_count: {
value: 1,
},
},
},
{
key: 2,
bucket_total: {
value: 3,
},
down: {
bucket_count: {
value: 1,
},
},
},
],
},
},
});
search.mockReturnValue(standardMockResponse);
const searchFilter = `{"bool":{"must":[{"match":{"monitor.status":{"query":"down","operator":"and"}}}]}}`;
const pingDatabase = {
search,
@ -326,36 +282,9 @@ describe('ElasticsearchPingsAdapter class', () => {
it('returns a down-filtered array for when filtered by up status', async () => {
expect.assertions(2);
const search = jest.fn();
search.mockReturnValue({
aggregations: {
timeseries: {
buckets: [
{
key: 1,
bucket_total: {
value: 3,
},
down: {
bucket_count: {
value: 1,
},
},
},
{
key: 2,
bucket_total: {
value: 3,
},
down: {
bucket_count: {
value: 1,
},
},
},
],
},
},
});
search.mockReturnValue(standardMockResponse);
const searchFilter = `{"bool":{"must":[{"match":{"monitor.status":{"query":"up","operator":"and"}}}]}}`;
const pingDatabase = {
search,

View file

@ -215,18 +215,12 @@ export class ElasticsearchPingsAdapter implements UMPingsAdapter {
'monitor.status': 'down',
},
},
aggs: {
bucket_count: {
cardinality: {
field: 'monitor.id',
},
},
},
},
bucket_total: {
cardinality: {
field: 'monitor.id',
precision_threshold: 20000,
up: {
filter: {
term: {
'monitor.status': 'up',
},
},
},
},
@ -239,12 +233,12 @@ export class ElasticsearchPingsAdapter implements UMPingsAdapter {
const buckets: HistogramQueryResult[] = get(result, 'aggregations.timeseries.buckets', []);
const mappedBuckets = buckets.map(bucket => {
const key: number = get(bucket, 'key');
const total: number = get(bucket, 'bucket_total.value');
const downCount: number = get(bucket, 'down.bucket_count.value');
const downCount: number = get(bucket, 'down.doc_count');
const upCount: number = get(bucket, 'up.doc_count');
return {
key,
downCount: statusFilter && statusFilter !== 'down' ? 0 : downCount,
upCount: statusFilter && statusFilter !== 'up' ? 0 : total - downCount,
upCount: statusFilter && statusFilter !== 'up' ? 0 : upCount,
y: 1,
};
});

View file

@ -10639,7 +10639,6 @@
"xpack.uptime.snapshot.stats.downDescription": "ダウン",
"xpack.uptime.snapshot.stats.totalDescription": "合計",
"xpack.uptime.snapshot.stats.upDescription": "アップ",
"xpack.uptime.snapshot.statusOverTimeTitle": "長期的なステータス",
"xpack.uptime.snapshotHistogram.series.downLabel": "ダウン",
"xpack.uptime.snapshotHistogram.series.upLabel": "アップ",
"xpack.uptime.uptimeFeatureCatalogueTitle": "起動時間",

View file

@ -10640,7 +10640,6 @@
"xpack.uptime.snapshot.stats.downDescription": "关闭",
"xpack.uptime.snapshot.stats.totalDescription": "合计",
"xpack.uptime.snapshot.stats.upDescription": "运行",
"xpack.uptime.snapshot.statusOverTimeTitle": "时移状态",
"xpack.uptime.snapshotHistogram.series.downLabel": "关闭",
"xpack.uptime.snapshotHistogram.series.upLabel": "运行",
"xpack.uptime.uptimeFeatureCatalogueTitle": "运行时间",

View file

@ -1,21 +1,21 @@
{
"histogram": [
{ "upCount": 7, "downCount": 3, "x": 1548697764160, "x0": 1548697571840, "y": 1 },
{ "upCount": 7, "downCount": 3, "x": 1548697956480, "x0": 1548697764160, "y": 1 },
{ "upCount": 7, "downCount": 3, "x": 1548698148800, "x0": 1548697956480, "y": 1 },
{ "upCount": 7, "downCount": 3, "x": 1548698341120, "x0": 1548698148800, "y": 1 },
{ "upCount": 7, "downCount": 3, "x": 1548698533440, "x0": 1548698341120, "y": 1 },
{ "upCount": 7, "downCount": 3, "x": 1548698725760, "x0": 1548698533440, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548698918080, "x0": 1548698725760, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548699110400, "x0": 1548698918080, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548699302720, "x0": 1548699110400, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548699495040, "x0": 1548699302720, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548699687360, "x0": 1548699495040, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548699879680, "x0": 1548699687360, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548700072000, "x0": 1548699879680, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548700264320, "x0": 1548700072000, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548700456640, "x0": 1548700264320, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548700648960, "x0": 1548700456640, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548700841280, "x0": 1548700648960, "y": 1 }
{ "upCount": 173, "downCount": 201, "x": 1548697764160, "x0": 1548697571840, "y": 1 },
{ "upCount": 243, "downCount": 277, "x": 1548697956480, "x0": 1548697764160, "y": 1 },
{ "upCount": 238, "downCount": 278, "x": 1548698148800, "x0": 1548697956480, "y": 1 },
{ "upCount": 244, "downCount": 279, "x": 1548698341120, "x0": 1548698148800, "y": 1 },
{ "upCount": 409, "downCount": 120, "x": 1548698533440, "x0": 1548698341120, "y": 1 },
{ "upCount": 444, "downCount": 88, "x": 1548698725760, "x0": 1548698533440, "y": 1 },
{ "upCount": 430, "downCount": 76, "x": 1548698918080, "x0": 1548698725760, "y": 1 },
{ "upCount": 434, "downCount": 78, "x": 1548699110400, "x0": 1548698918080, "y": 1 },
{ "upCount": 455, "downCount": 76, "x": 1548699302720, "x0": 1548699110400, "y": 1 },
{ "upCount": 451, "downCount": 85, "x": 1548699495040, "x0": 1548699302720, "y": 1 },
{ "upCount": 458, "downCount": 89, "x": 1548699687360, "x0": 1548699495040, "y": 1 },
{ "upCount": 455, "downCount": 86, "x": 1548699879680, "x0": 1548699687360, "y": 1 },
{ "upCount": 455, "downCount": 87, "x": 1548700072000, "x0": 1548699879680, "y": 1 },
{ "upCount": 459, "downCount": 88, "x": 1548700264320, "x0": 1548700072000, "y": 1 },
{ "upCount": 432, "downCount": 87, "x": 1548700456640, "x0": 1548700264320, "y": 1 },
{ "upCount": 431, "downCount": 86, "x": 1548700648960, "x0": 1548700456640, "y": 1 },
{ "upCount": 433, "downCount": 87, "x": 1548700841280, "x0": 1548700648960, "y": 1 }
]
}

View file

@ -1,21 +1,21 @@
{
"histogram": [
{ "upCount": 7, "downCount": 0, "x": 1548697764160, "x0": 1548697571840, "y": 1 },
{ "upCount": 7, "downCount": 0, "x": 1548697956480, "x0": 1548697764160, "y": 1 },
{ "upCount": 7, "downCount": 0, "x": 1548698148800, "x0": 1548697956480, "y": 1 },
{ "upCount": 7, "downCount": 0, "x": 1548698341120, "x0": 1548698148800, "y": 1 },
{ "upCount": 7, "downCount": 0, "x": 1548698533440, "x0": 1548698341120, "y": 1 },
{ "upCount": 7, "downCount": 0, "x": 1548698725760, "x0": 1548698533440, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548698918080, "x0": 1548698725760, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548699110400, "x0": 1548698918080, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548699302720, "x0": 1548699110400, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548699495040, "x0": 1548699302720, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548699687360, "x0": 1548699495040, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548699879680, "x0": 1548699687360, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548700072000, "x0": 1548699879680, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548700264320, "x0": 1548700072000, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548700456640, "x0": 1548700264320, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548700648960, "x0": 1548700456640, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548700841280, "x0": 1548700648960, "y": 1 }
{ "upCount": 173, "downCount": 0, "x": 1548697764160, "x0": 1548697571840, "y": 1 },
{ "upCount": 243, "downCount": 0, "x": 1548697956480, "x0": 1548697764160, "y": 1 },
{ "upCount": 238, "downCount": 0, "x": 1548698148800, "x0": 1548697956480, "y": 1 },
{ "upCount": 244, "downCount": 0, "x": 1548698341120, "x0": 1548698148800, "y": 1 },
{ "upCount": 409, "downCount": 0, "x": 1548698533440, "x0": 1548698341120, "y": 1 },
{ "upCount": 444, "downCount": 0, "x": 1548698725760, "x0": 1548698533440, "y": 1 },
{ "upCount": 430, "downCount": 0, "x": 1548698918080, "x0": 1548698725760, "y": 1 },
{ "upCount": 434, "downCount": 0, "x": 1548699110400, "x0": 1548698918080, "y": 1 },
{ "upCount": 455, "downCount": 0, "x": 1548699302720, "x0": 1548699110400, "y": 1 },
{ "upCount": 451, "downCount": 0, "x": 1548699495040, "x0": 1548699302720, "y": 1 },
{ "upCount": 458, "downCount": 0, "x": 1548699687360, "x0": 1548699495040, "y": 1 },
{ "upCount": 455, "downCount": 0, "x": 1548699879680, "x0": 1548699687360, "y": 1 },
{ "upCount": 455, "downCount": 0, "x": 1548700072000, "x0": 1548699879680, "y": 1 },
{ "upCount": 459, "downCount": 0, "x": 1548700264320, "x0": 1548700072000, "y": 1 },
{ "upCount": 432, "downCount": 0, "x": 1548700456640, "x0": 1548700264320, "y": 1 },
{ "upCount": 431, "downCount": 0, "x": 1548700648960, "x0": 1548700456640, "y": 1 },
{ "upCount": 433, "downCount": 0, "x": 1548700841280, "x0": 1548700648960, "y": 1 }
]
}

View file

@ -1,21 +1,21 @@
{
"histogram": [
{ "upCount": 1, "downCount": 0, "x": 1548697764160, "x0": 1548697571840, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548697956480, "x0": 1548697764160, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548698148800, "x0": 1548697956480, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548698341120, "x0": 1548698148800, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548698533440, "x0": 1548698341120, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548698725760, "x0": 1548698533440, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548698918080, "x0": 1548698725760, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548699110400, "x0": 1548698918080, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548699302720, "x0": 1548699110400, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548699495040, "x0": 1548699302720, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548699687360, "x0": 1548699495040, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548699879680, "x0": 1548699687360, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548700072000, "x0": 1548699879680, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548700264320, "x0": 1548700072000, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548700456640, "x0": 1548700264320, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548700648960, "x0": 1548700456640, "y": 1 },
{ "upCount": 1, "downCount": 0, "x": 1548700841280, "x0": 1548700648960, "y": 1 }
{ "upCount": 37, "downCount": 0, "x": 1548697764160, "x0": 1548697571840, "y": 1 },
{ "upCount": 52, "downCount": 0, "x": 1548697956480, "x0": 1548697764160, "y": 1 },
{ "upCount": 51, "downCount": 0, "x": 1548698148800, "x0": 1548697956480, "y": 1 },
{ "upCount": 52, "downCount": 0, "x": 1548698341120, "x0": 1548698148800, "y": 1 },
{ "upCount": 58, "downCount": 0, "x": 1548698533440, "x0": 1548698341120, "y": 1 },
{ "upCount": 58, "downCount": 0, "x": 1548698725760, "x0": 1548698533440, "y": 1 },
{ "upCount": 51, "downCount": 0, "x": 1548698918080, "x0": 1548698725760, "y": 1 },
{ "upCount": 52, "downCount": 0, "x": 1548699110400, "x0": 1548698918080, "y": 1 },
{ "upCount": 61, "downCount": 0, "x": 1548699302720, "x0": 1548699110400, "y": 1 },
{ "upCount": 60, "downCount": 0, "x": 1548699495040, "x0": 1548699302720, "y": 1 },
{ "upCount": 61, "downCount": 0, "x": 1548699687360, "x0": 1548699495040, "y": 1 },
{ "upCount": 63, "downCount": 0, "x": 1548699879680, "x0": 1548699687360, "y": 1 },
{ "upCount": 62, "downCount": 0, "x": 1548700072000, "x0": 1548699879680, "y": 1 },
{ "upCount": 62, "downCount": 0, "x": 1548700264320, "x0": 1548700072000, "y": 1 },
{ "upCount": 52, "downCount": 0, "x": 1548700456640, "x0": 1548700264320, "y": 1 },
{ "upCount": 51, "downCount": 0, "x": 1548700648960, "x0": 1548700456640, "y": 1 },
{ "upCount": 51, "downCount": 0, "x": 1548700841280, "x0": 1548700648960, "y": 1 }
]
}