[HLRC][ML] Add ML get model snapshots API#35487
Conversation
|
Pinging @elastic/es-core-infra |
|
Pinging @elastic/ml-core |
| GetModelSnapshotsResponse response = execute(request, machineLearningClient::getModelSnapshots, | ||
| machineLearningClient::getModelSnapshotsAsync); | ||
|
|
||
| assertThat(response.count(), equalTo(3L)); |
There was a problem hiding this comment.
Hmmm, I think you mean for this to be 1L, this goes for similar tests below.
There was a problem hiding this comment.
Thanks for the review Ben - very thorough! The response count represents the total number of snapshots associated with the job hence is constant regardless of the for of a (valid) query. 3L is correct in these instances.
There was a problem hiding this comment.
Interesting, as that is not how the other AbstractResponse<T> classes act. I suppose if the tests pass it is OK.
Usually, count() represents the number of items returned (basically, the same size as the list itself).
There was a problem hiding this comment.
It works like the total_hits of elasticsearch. So it will return as many docs match the query despite of how many fit in a page.
| // end::get-model-snapshots-snapshot-id | ||
|
|
||
| // Set snapshot id to null as it is incompatible with other args | ||
| request.setSnapshotId(null); // <1> |
| include-tagged::{doc-tests-file}[{api}-response] | ||
| -------------------------------------------------- | ||
| <1> The count of categories that were matched | ||
| <2> The categories retrieved No newline at end of file |
There was a problem hiding this comment.
categories should probably be snapshots
…e/add-ml-get-model-snapshot-info-to-hlrc
Relates #29827