Skip to content

Commit

Permalink
[Monitoring/ML] add number of forecasts to monitoring overview (#20758)…
Browse files Browse the repository at this point in the history
… (#20889)

Add forecasts (Number of forecasts for an ml jobs) as column to the ML Jobs monitoring page. Related to: elastic/elasticsearch#31647
  • Loading branch information
Hendrik Muhs authored Jul 18, 2018
1 parent 05bbe62 commit 31eb567
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const columns = [
{ title: 'State', sortKey: 'state' },
{ title: 'Processed Records', sortKey: 'data_counts.processed_record_count' },
{ title: 'Model Size', sortKey: 'model_size_stats.model_bytes' },
{ title: 'Forecasts', sortKey: 'forecasts_stats.total' },
{ title: 'Node', sortKey: 'node.name' }
];
const jobRowFactory = (scope, kbnUrl) => {
Expand Down Expand Up @@ -56,6 +57,7 @@ const jobRowFactory = (scope, kbnUrl) => {
</KuiTableRowCell>
<KuiTableRowCell>{ numeral(props.data_counts.processed_record_count).format(LARGE_ABBREVIATED) }</KuiTableRowCell>
<KuiTableRowCell>{ numeral(props.model_size_stats.model_bytes).format(LARGE_BYTES) }</KuiTableRowCell>
<KuiTableRowCell>{ numeral(props.forecasts_stats.total).format(LARGE_ABBREVIATED) }</KuiTableRowCell>
<KuiTableRowCell>
{ getNode(props.node) }
</KuiTableRowCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@ describe('Get ML Jobs', () => {
state: 'opened',
data_counts: { processed_record_count: 1 },
model_size_stats: { model_bytes: 293847 },
forecasts_stats: { total: 5 },
node: { id: 'node-01', name: 'nameOfNode1' }
});
set(jobStats, 'hits.hits[1]._source.job_stats', {
job_id: 'job_id_dos',
state: 'opened',
data_counts: { processed_record_count: 3 },
model_size_stats: { model_bytes: 39045 },
forecasts_stats: { total: 0 },
node: { id: 'node-02', name: 'nameOfNode2' }
});
set(jobStats, 'hits.hits[2]._source.job_stats', {
job_id: 'job_id_tres',
state: 'opened',
data_counts: { processed_record_count: 5 },
model_size_stats: { model_bytes: 983457 },
forecasts_stats: { total: 4 },
node: { id: 'node-03', name: 'nameOfNode3' }
});

Expand All @@ -45,20 +48,23 @@ describe('Get ML Jobs', () => {
state: 'opened',
data_counts: { processed_record_count: 1 },
model_size_stats: { model_bytes: 293847 },
forecasts_stats: { total: 5 },
node: { id: 'node-01', name: 'nameOfNode1' }
},
{
job_id: 'job_id_dos',
state: 'opened',
data_counts: { processed_record_count: 3 },
model_size_stats: { model_bytes: 39045 },
forecasts_stats: { total: 0 },
node: { id: 'node-02', name: 'nameOfNode2' }
},
{
job_id: 'job_id_tres',
state: 'opened',
data_counts: { processed_record_count: 5 },
model_size_stats: { model_bytes: 983457 },
forecasts_stats: { total: 4 },
node: { id: 'node-03', name: 'nameOfNode3' }
}
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export function getMlJobs(req, esIndexPattern) {
'hits.hits._source.job_stats.state',
'hits.hits._source.job_stats.data_counts.processed_record_count',
'hits.hits._source.job_stats.model_size_stats.model_bytes',
'hits.hits._source.job_stats.forecasts_stats.total',
'hits.hits._source.job_stats.node.id',
'hits.hits._source.job_stats.node.name'
],
Expand Down

0 comments on commit 31eb567

Please sign in to comment.