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

[ML] add GET _cat/ml/datafeeds #51500

Merged
merged 3 commits into from
Feb 3, 2020

Conversation

benwtrent
Copy link
Member

@benwtrent benwtrent commented Jan 27, 2020

This adds GET _cat/ml/datafeeds && _cat/ml/datafeeds/{datafeed_id}

Example calls

# GET _cat/ml/datafeeds?v
#! Deprecation: [interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval] in the future.
id                             state bucket.count search.count
datafeed-low_request_rate    stopped 1457         3
datafeed-response_code_rates stopped 1460         18
datafeed-url_scanning        stopped 1460         18

# GET _cat/ml/datafeeds?h=*&v
#! Deprecation: [interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval] in the future.
id                             state assignment_explanation bucket.count search.count search.time search.bucket_avg   search.exp_avg_hour node.id node.name node.ephemeral_id node.address
datafeed-low_request_rate    stopped                        1457         3            62ms        0.0425531914893617  20.160978098329824                                      
datafeed-response_code_rates stopped                        1460         18           127ms       0.08698630136986302 2.529951653336354                                       
datafeed-url_scanning        stopped                        1460         18           173ms       0.1184931506849315  2.8745993097731013                                      

# GET _cat/ml/datafeeds?help
id                     |                       | the datafeed_id                                           
state                  | s                     | the datafeed state                                        
assignment_explanation | ae                    | why the datafeed is or is not assigned to a node          
bucket.count           | bc,bucketCount        | bucket count                                              
search.count           | sc,searchCount        | number of searches ran by the datafeed                    
search.time            | st,searchTime         | the total search time                                     
search.bucket_avg      | sba,bucketTimeMin     | the average search time per bucket (millisecond)          
search.exp_avg_hour    | seah,searchExpAvgHour | the exponential average search time per hour (millisecond)
node.id                | ni,nodeId             | id of the assigned node                                   
node.name              | nn,nodeName           | name of the assigned node                                 
node.ephemeral_id      | ne,nodeEphemeralId    | ephemeral id of the assigned node                         
node.address           | na,nodeAddress        | network address of the assigned node                      


closes #51411

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

if (Strings.isNullOrEmpty(datafeedId)) {
datafeedId = GetDatafeedsStatsAction.ALL;
}
GetDatafeedsStatsAction.Request request = new GetDatafeedsStatsAction.Request(datafeedId);
Copy link
Member

Choose a reason for hiding this comment

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

I thought this was GetDatafeeds not stats but stats makes a lot more sense 👍. I suppose naming the endpoint _cat/ml/datafeeds_stats isn't great. All good here.

"required":false,
"description":"Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)"
},
"bytes":{
Copy link
Member

Choose a reason for hiding this comment

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

Are there any byte units returned?

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't think so, these options are a catch all as these parameters come by default with _cat APIs.

Copy link
Member

Choose a reason for hiding this comment

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

There is also a default size parameter https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html that is only used by cat thread pool

My preference would be to remove this but it's not a deal breaker

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

"required":false,
"description":"Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)"
},
"bytes":{
Copy link
Member

Choose a reason for hiding this comment

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

There is also a default size parameter https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html that is only used by cat thread pool

My preference would be to remove this but it's not a deal breaker

@benwtrent
Copy link
Member Author

@elasticmachine update branch

@benwtrent benwtrent merged commit 836e64b into elastic:master Feb 3, 2020
@benwtrent benwtrent deleted the feature/ml-_cat-datafeeds-api branch February 3, 2020 21:06
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Feb 3, 2020
This adds GET _cat/ml/datafeeds && _cat/ml/datafeeds/{datafeed_id}
benwtrent added a commit that referenced this pull request Feb 3, 2020
* [ML] add GET _cat/ml/datafeeds (#51500)

This adds GET _cat/ml/datafeeds && _cat/ml/datafeeds/{datafeed_id}

* fixing for java8 compilation
@lcawl
Copy link
Contributor

lcawl commented Feb 25, 2020

Documentation added in #52738

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.

Create GET _cat/ml/datafeeds API
5 participants