Skip to content

Commit

Permalink
update estimateBucketSpan schema and api test (elastic#58004) (elasti…
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Feb 20, 2020
1 parent 4d686e5 commit 1f87879
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const estimateBucketSpanSchema = schema.object({
aggTypes: schema.arrayOf(schema.nullable(schema.string())),
duration: schema.object({ start: schema.number(), end: schema.number() }),
fields: schema.arrayOf(schema.nullable(schema.string())),
filters: schema.maybe(schema.arrayOf(schema.any())),
index: schema.string(),
query: schema.any(),
splitField: schema.maybe(schema.string()),
Expand Down
17 changes: 17 additions & 0 deletions x-pack/test/api_integration/apis/ml/bucket_span_estimator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ export default ({ getService }: FtrProviderContext) => {
responseBody: { name: '3h', ms: 10800000 },
},
},
{
testTitleSuffix: 'with 1 field, 1 agg, no split, and empty filters',
user: USER.ML_POWERUSER,
requestBody: {
aggTypes: ['avg'],
duration: { start: 1560297859000, end: 1562975136000 },
fields: ['taxless_total_price'],
filters: [],
index: 'ecommerce',
query: { bool: { must: [{ match_all: {} }] } },
timeField: 'order_date',
},
expected: {
responseCode: 200,
responseBody: { name: '15m', ms: 900000 },
},
},
];

describe('bucket span estimator', function() {
Expand Down

0 comments on commit 1f87879

Please sign in to comment.