Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APM] Fix missing ML data, and NaN issue #34333

Merged
merged 4 commits into from
Apr 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Fix snapshots
  • Loading branch information
sorenlouv committed Apr 2, 2019
commit 97e77297b9d08192e0e680c64a137d8771bda34b
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ Object {
"x": 1528966800000,
"y": 52360.30017052116,
},
Object {
"x": 1528977600000,
"y": null,
},
],
"p95": Array [
Object {
Expand Down Expand Up @@ -639,6 +643,10 @@ Object {
"x": 1528966800000,
"y": 194970.75667682925,
},
Object {
"x": 1528977600000,
"y": null,
},
],
"p99": Array [
Object {
Expand Down Expand Up @@ -957,6 +965,10 @@ Object {
"x": 1528966800000,
"y": 473485.4199999998,
},
Object {
"x": 1528977600000,
"y": null,
},
],
},
"totalHits": 1297673,
Expand Down Expand Up @@ -1279,6 +1291,10 @@ Object {
"x": 1528966800000,
"y": 81845,
},
Object {
"x": 1528977600000,
"y": 0,
},
],
"key": "HTTP 2xx",
},
Expand Down Expand Up @@ -1600,6 +1616,10 @@ Object {
"x": 1528966800000,
"y": 0,
},
Object {
"x": 1528977600000,
"y": 0,
},
],
"key": "HTTP 3xx",
},
Expand Down Expand Up @@ -1921,6 +1941,10 @@ Object {
"x": 1528966800000,
"y": 6070,
},
Object {
"x": 1528977600000,
"y": 0,
},
],
"key": "HTTP 4xx",
},
Expand Down Expand Up @@ -2242,6 +2266,10 @@ Object {
"x": 1528966800000,
"y": 5915,
},
Object {
"x": 1528977600000,
"y": 0,
},
],
"key": "HTTP 5xx",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { first, last } from 'lodash';
import { first } from 'lodash';
import { timeseriesResponse } from './mock-responses/timeseries_response';
import {
ApmTimeSeriesResponse,
Expand All @@ -21,16 +21,13 @@ describe('timeseriesTransformer', () => {
});
});

it('should not contain first and last bucket', () => {
it('should remove first bucket', () => {
const mockDates = timeseriesResponse.aggregations.transaction_results.buckets[0].timeseries.buckets.map(
bucket => bucket.key
);

expect(first(res.responseTimes.avg).x).not.toBe(first(mockDates));
expect(last(res.responseTimes.avg).x).not.toBe(last(mockDates));

expect(first(res.tpmBuckets[0].dataPoints).x).not.toBe(first(mockDates));
expect(last(res.tpmBuckets[0].dataPoints).x).not.toBe(last(mockDates));
});

it('should have correct order', () => {
Expand Down Expand Up @@ -74,7 +71,7 @@ describe('getTpmBuckets', () => {
{
key_as_string: '',
key: 3,
doc_count: 1337
doc_count: 400
}
]
}
Expand Down Expand Up @@ -102,16 +99,22 @@ describe('getTpmBuckets', () => {
{
key_as_string: '',
key: 3,
doc_count: 1337
doc_count: 300
}
]
}
}
];
const bucketSize = 10;
expect(getTpmBuckets(buckets, bucketSize)).toEqual([
{ dataPoints: [{ x: 1, y: 1200 }, { x: 2, y: 1800 }], key: 'HTTP 4xx' },
{ dataPoints: [{ x: 1, y: 3000 }, { x: 2, y: 600 }], key: 'HTTP 5xx' }
{
dataPoints: [{ x: 1, y: 1200 }, { x: 2, y: 1800 }, { x: 3, y: 2400 }],
key: 'HTTP 4xx'
},
{
dataPoints: [{ x: 1, y: 3000 }, { x: 2, y: 600 }, { x: 3, y: 1800 }],
key: 'HTTP 5xx'
}
]);
});
});