Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ export function extractJobDetails(job) {
if (job.node) {
datafeed.items.push(['node', JSON.stringify(job.node)]);
}
if (job.datafeed_config && job.datafeed_config.timing_stats) {
// remove the timing_stats list from the datafeed section
// so not to show it twice.
const i = datafeed.items.findIndex(item => item[0] === 'timing_stats');
if (i >= 0) {
datafeed.items.splice(i, 1);
}
}

const counts = {
title: i18n.translate('xpack.ml.jobsList.jobDetails.countsTitle', {
Expand All @@ -139,6 +147,17 @@ export function extractJobDetails(job) {
items: filterObjects(job.model_size_stats).map(formatValues)
};

const datafeedTimingStats = {
title: i18n.translate('xpack.ml.jobsList.jobDetails.datafeedTimingStatsTitle', {
defaultMessage: 'Timing stats'
}),
position: 'right',
items: (job.datafeed_config && job.datafeed_config.timing_stats) ?
filterObjects(job.datafeed_config.timing_stats)
.filter(o => o[0] !== 'total_search_time_ms') // remove total_search_time_ms as average_search_time_per_bucket_ms is better
.map(formatValues) : []
};

return {
general,
customUrl,
Expand All @@ -151,6 +170,7 @@ export function extractJobDetails(job) {
dataDescription,
datafeed,
counts,
modelSizeStats
modelSizeStats,
datafeedTimingStats
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class JobDetailsUI extends Component {
dataDescription,
datafeed,
counts,
modelSizeStats
modelSizeStats,
datafeedTimingStats
} = extractJobDetails(job);

const { intl } = this.props;
Expand All @@ -93,7 +94,7 @@ class JobDetailsUI extends Component {
id: 'xpack.ml.jobsList.jobDetails.tabs.datafeedLabel',
defaultMessage: 'Datafeed'
}),
content: <JobDetailsPane sections={[datafeed]} />,
content: <JobDetailsPane sections={[datafeed, datafeedTimingStats]} />,
}, {
id: 'counts',
name: intl.formatMessage({
Expand Down
1 change: 1 addition & 0 deletions x-pack/legacy/plugins/ml/public/services/job_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ class JobService {
delete tempJob.datafeed_config.job_id;
delete tempJob.datafeed_config.state;
delete tempJob.datafeed_config.node;
delete tempJob.datafeed_config.timing_stats;

// remove query_delay if it's between 60s and 120s
// the back-end produces a random value between 60 and 120 and so
Expand Down
1 change: 1 addition & 0 deletions x-pack/legacy/plugins/ml/server/models/job_service/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export function jobsProvider(callWithRequest) {
const datafeedStats = results[DATAFEED_STATS].datafeeds.find(ds => (ds.datafeed_id === datafeed.datafeed_id));
if (datafeedStats) {
datafeed.state = datafeedStats.state;
datafeed.timing_stats = datafeedStats.timing_stats;
}
}
datafeeds[datafeed.job_id] = datafeed;
Expand Down