Skip to content

Commit

Permalink
[ML] Fix jest test.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Oct 13, 2021
1 parent e747535 commit e2424ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ describe('query_histogram_range_steps', () => {
);

expect(resp.length).toEqual(100);
expect(resp[0]).toEqual(9.260965422132594);
expect(resp[99]).toEqual(18521.930844265193);
expect(resp[0]).toEqual(9);
expect(resp[99]).toEqual(18522);
expect(esClientSearchMock).toHaveBeenCalledTimes(1);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { getRequestBase } from './get_request_base';

const getHistogramRangeSteps = (min: number, max: number, steps: number) => {
// A d3 based scale function as a helper to get equally distributed bins on a log scale.
// We round the final values because the ES range agg we used won't accept numbers with decimals for `transaction.duration.us`.
// We round the final values because the ES range agg we use won't accept numbers with decimals for `transaction.duration.us`.
const logFn = scaleLog().domain([min, max]).range([1, steps]);
return [...Array(steps).keys()]
.map(logFn.invert)
Expand Down

0 comments on commit e2424ae

Please sign in to comment.