Skip to content

Commit

Permalink
Log get job stats in the right place and fix silly error
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkyle committed Nov 22, 2018
1 parent 4a755d2 commit 6532995
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public TransportGetJobsStatsAction(Settings settings, TransportService transport

@Override
protected void doExecute(Task task, GetJobsStatsAction.Request request, ActionListener<GetJobsStatsAction.Response> finalListener) {

logger.debug("Get stats for job [{}]", request.getJobId());
jobManager.expandJobIds(request.getJobId(), request.allowNoJobs(), ActionListener.wrap(
expandedIds -> {
request.setExpandedJobsIds(new ArrayList<>(expandedIds));
Expand Down Expand Up @@ -111,7 +111,6 @@ protected QueryPage<GetJobsStatsAction.Response.JobStats> readTaskResponse(Strea
protected void taskOperation(GetJobsStatsAction.Request request, TransportOpenJobAction.JobTask task,
ActionListener<QueryPage<GetJobsStatsAction.Response.JobStats>> listener) {
String jobId = task.getJobId();
logger.debug("Get stats for job [{}]", jobId);
ClusterState state = clusterService.state();
PersistentTasksCustomMetaData tasks = state.getMetaData().custom(PersistentTasksCustomMetaData.TYPE);
Optional<Tuple<DataCounts, ModelSizeStats>> stats = processManager.getStatistics(task);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@

- do:
xpack.ml.get_job_stats:
job_id: migration-old-cluster-open-job
job_id: migration*
- match: { count: 2 }
- match: { jobs.0.job_id: migration-old-cluster-closed-job}
- match: { jobs.0.state: closed }
- is_false: jobs.0.node
- match: { jobs.1.job_id: migration-old-cluster-open-job}
- match: { jobs.1.state: opened }
- is_true: jobs.1.node
# TODO can't test for assignment here as the job may not be re-allocated yet
# - is_true: jobs.1.node
- is_false: jobs.1.assignment_explanation

- do:
Expand All @@ -38,7 +39,8 @@
datafeed_id: migration*
- match: { datafeeds.0.datafeed_id: migration-old-cluster-started-datafeed}
- match: { datafeeds.0.state: started }
- is_true: datafeeds.0.node
# TODO can't test for assignment here as the datafeed may not be re-allocated yet
# - is_true: datafeeds.0.node
- match: { datafeeds.1.datafeed_id: migration-old-cluster-stopped-datafeed}
- match: { datafeeds.1.state: stopped }
- is_false: datafeeds.1.node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,16 @@ setup:

- do:
xpack.ml.get_job_stats:
job_id: migration-old-cluster-open-job
# - match: { count: 2 }
# - match: { jobs.0.job_id: migration-old-cluster-closed-job }
# - match: { jobs.0.state: closed }
# - is_false: jobs.0.node
# - match: { jobs.1.job_id: migration-old-cluster-open-job }
# - match: { jobs.1.state: opened }
job_id: migration*
- match: { count: 2 }
- match: { jobs.0.job_id: migration-old-cluster-closed-job }
- match: { jobs.0.state: closed }
- is_false: jobs.0.node
- match: { jobs.1.job_id: migration-old-cluster-open-job }
- match: { jobs.1.state: opened }
# TODO can't test for assignment here as the job may not be re-allocated yet
# - is_true: jobs.1.node
# - is_false: jobs.1.assignment_explanation
- match: { jobs.0.job_id: migration-old-cluster-open-job }
- match: { jobs.0.state: opened }
- is_true: jobs.0.node
- is_false: jobs.0.assignment_explanation
- is_false: jobs.1.assignment_explanation

- do:
xpack.ml.get_datafeeds:
Expand All @@ -46,7 +43,8 @@ setup:
datafeed_id: migration*
- match: { datafeeds.0.datafeed_id: migration-old-cluster-started-datafeed }
- match: { datafeeds.0.state: started }
- is_true: datafeeds.0.node
# TODO can't test for assignment here as the datafeed may not be re-allocated yet
# - is_true: datafeeds.0.node
- match: { datafeeds.1.datafeed_id: migration-old-cluster-stopped-datafeed }
- match: { datafeeds.1.state: stopped }
- is_false: datafeeds.1.node
Expand Down

0 comments on commit 6532995

Please sign in to comment.