Skip to content

[ML] Data frames: Analytics jobs list. - #42598

Merged
walterra merged 14 commits into
elastic:masterfrom
walterra:ml-dfa-jobs
Aug 8, 2019
Merged

walterra merged 14 commits into
elastic:masterfrom
walterra:ml-dfa-jobs

Conversation

@walterra

@walterra walterra commented Aug 5, 2019 •

Copy link
Copy Markdown
Contributor

Summary

Part of #42516.

Introduces the data frame analytics jobs list.

image

Features

  • “Analytics” main menu item links to analytics job list
  • User can start/stop/delete job
  • User can see job stats/config in expanded row
  • Running analytics jobs requires the same privileges as anomaly detection; ml_user and ml_admin. Feature control is also shared with anomaly_detection.

Notes

  • The code is mostly a copy of the data frames transform list. Because both features are beta/experimental and it has not been definitely decided where this code will end up, transforms/analytics are for now not sharing any code.
  • Some features which are not yet available for analytics but are already part of transforms (e.g. audit messages, batch/continuous, job description field) were copied over and commented out.
  • Note the "Create" button is disabled, analytics job creation will be added in another PR. At the moment the list allows you to view jobs created via API.
  • Unlike transforms, the analytics API doesn't have an endpoint for previewing results, so there is no preview tab in the expanded rows.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@walterra walterra self-assigned this Aug 5, 2019
@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui

@walterra
walterra marked this pull request as ready for review August 7, 2019 07:49
@walterra
walterra requested review from a team as code owners August 7, 2019 07:49
@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

<p>
{i18n.translate('xpack.ml.dataframe.analyticsList.startModalBody', {
defaultMessage:
'A data frame analytics job will increase search and indexing load in your cluster. Please stop the analytics job if excessive load is experienced. Are you sure you want to start this analytics job?',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this warning on starting an analytics job needed? We don't show one when starting an anomaly detection job for example.

@walterra walterra Aug 8, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behaviour is the same as with transforms. I will revisit in a follow up after some further discussions, no definitive decision yet. Updated #42516 accordingly.

@peteharverson peteharverson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and LGTM.

);
}

function stringMatch(str: string | undefined, substr: string) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this function has been created and used in a couple of other places already - transform_list.tsx and jobs_list/components/utils.js - might be worth moving to a common place.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note to the project to do this in a follow up (once we have a decision where transforms/analytics code will live eventually), I intentionally didn't do any code deduplication in this PR.


// This component extends EuiInMemoryTable with some
// fixes and TS specs until the changes become available upstream.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will these additions be a problem once they do become available in the EUI component itself?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If time permits I'll do a EUI PR with these updates then updating this can go hand in hand.

@alvarezmelissa87 alvarezmelissa87 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of small comments but overall LGTM ⚡️

@walterra walterra added the Feature:Data Frame Analytics ML data frame analytics features label Aug 8, 2019

@jgowdyelastic jgowdyelastic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

REFRESH_ANALYTICS_LIST_STATE.IDLE
);

export const useRefreshAnalyticsList = (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a nicely structured hook. i wonder if it could be used in a more general way for managing things that load.
also, could isLoading be moved to be something returned from the hook, like refresh is? i guess you'd then need something watching isLoading on the other end.

@walterra walterra Aug 8, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! Yes I think isLoading could be moved inside the custom hook, don't remember exactly why I did it this way, maybe I had issues with updates. Just checked because someone mentioned it a while ago, APM has a generic version useFetcher() similar to this, we could have a look if we wanted to reuse it https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/apm/public/hooks/useFetcher.tsx

item: DataFrameAnalyticsListRow;
}

export const DeleteAction: SFC<DeleteActionProps> = ({ item }) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably should be using FC for all new code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed for all analytics code in aec4524.

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@walterra
walterra merged commit 81d7d6c into elastic:master Aug 8, 2019
@walterra
walterra deleted the ml-dfa-jobs branch August 8, 2019 13:35
walterra added a commit to walterra/kibana that referenced this pull request Aug 8, 2019
Introduces the data frame analytics jobs list.
walterra added a commit that referenced this pull request Aug 8, 2019
Introduces the data frame analytics jobs list.
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
Introduces the data frame analytics jobs list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants