Skip to content

Commit

Permalink
update analytics job creation to use _explain api endpoint for modelM…
Browse files Browse the repository at this point in the history
…emoryLimit estimate
  • Loading branch information
alvarezmelissa87 committed Nov 25, 2019
1 parent adc11a5 commit 758661b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export const CreateAnalyticsForm: FC<CreateAnalyticsFormProps> = ({ actions, sta
delete jobConfig.model_memory_limit;
const resp = await ml.dataFrameAnalytics.estimateDataFrameAnalyticsMemoryUsage(jobConfig);
setFormState({
modelMemoryLimit: resp.expected_memory_without_disk,
modelMemoryLimit:
resp.memory_estimation && resp.memory_estimation.expected_memory_without_disk,
});
} catch (e) {
setFormState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const dataFrameAnalytics = {
},
estimateDataFrameAnalyticsMemoryUsage(jobConfig) {
return http({
url: `${basePath}/data_frame/analytics/_estimate_memory_usage`,
url: `${basePath}/data_frame/analytics/_explain`,
method: 'POST',
data: jobConfig
});
Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/ml/server/client/elasticsearch_ml.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
ml.estimateDataFrameAnalyticsMemoryUsage = ca({
urls: [
{
fmt: '/_ml/data_frame/analytics/_estimate_memory_usage',
fmt: '/_ml/data_frame/analytics/_explain',
}
],
needBody: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function dataFrameAnalyticsRoutes({ commonRouteConfig, elasticsearchPlugi

route({
method: 'POST',
path: '/api/ml/data_frame/analytics/_estimate_memory_usage',
path: '/api/ml/data_frame/analytics/_explain',
handler(request) {
const callWithRequest = callWithRequestFactory(elasticsearchPlugin, request);
return callWithRequest('ml.estimateDataFrameAnalyticsMemoryUsage', { body: request.payload })
Expand Down

0 comments on commit 758661b

Please sign in to comment.