Skip to content

Commit

Permalink
Add utilization to Kibana status page.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeelmers committed Mar 27, 2023
1 parent 23617c1 commit 09b4167
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ describe('response processing', () => {
const data = await loadStatus({ http, notifications });
const names = data.metrics.map((m) => m.name);
expect(names).toEqual([
'Heap total',
'Heap used',
'Heap used out of 976.56 KB',
'Requests per second',
'Utilization (active: 1.00 / idle: 1.00)',
'Load',
'Delay',
'Response time avg',
]);
const values = data.metrics.map((m) => m.value);
expect(values).toEqual([1000000, 100, 400, [4.1, 2.1, 0.1], 1, 4000]);
expect(values).toEqual([100, 400, 1, [4.1, 2.1, 0.1], 1, 4000]);
});

test('adds meta details to Load, Delay and Response time', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import numeral from '@elastic/numeral';
import { i18n } from '@kbn/i18n';
import type { HttpSetup } from '@kbn/core-http-browser';
import type { NotificationsSetup } from '@kbn/core-notifications-browser';
Expand Down Expand Up @@ -57,16 +58,10 @@ function formatMetrics({ metrics }: StatusResponse): Metric[] {
}

return [
{
name: i18n.translate('core.statusPage.metricsTiles.columns.heapTotalHeader', {
defaultMessage: 'Heap total',
}),
value: metrics.process.memory.heap.size_limit,
type: 'byte',
},
{
name: i18n.translate('core.statusPage.metricsTiles.columns.heapUsedHeader', {
defaultMessage: 'Heap used',
defaultMessage: 'Heap used out of {heapTotal}',
values: { heapTotal: numeral(metrics.process.memory.heap.size_limit).format('0.00 b') },
}),
value: metrics.process.memory.heap.used_in_bytes,
type: 'byte',
Expand All @@ -78,6 +73,17 @@ function formatMetrics({ metrics }: StatusResponse): Metric[] {
value: (metrics.requests.total * 1000) / metrics.collection_interval_in_millis,
type: 'float',
},
{
name: i18n.translate('core.statusPage.metricsTiles.columns.utilizationHeader', {
defaultMessage: 'Utilization (active: {active} / idle: {idle})',
values: {
active: numeral(metrics.process.event_loop_utilization.active).format('0.00'),
idle: numeral(metrics.process.event_loop_utilization.idle).format('0.00'),
},
}),
value: metrics.process.event_loop_utilization.utilization,
type: 'float',
},
{
name: i18n.translate('core.statusPage.metricsTiles.columns.loadHeader', {
defaultMessage: 'Load',
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,6 @@
"core.status.yellowTitle": "Jaune",
"core.statusPage.coreStatus.sectionTitle": "Statut principal",
"core.statusPage.loadStatus.serverIsDownErrorMessage": "Échec de requête du statut du serveur. Votre serveur est peut-être indisponible ?",
"core.statusPage.metricsTiles.columns.heapTotalHeader": "Tas total",
"core.statusPage.metricsTiles.columns.heapUsedHeader": "Tas utilisé",
"core.statusPage.metricsTiles.columns.load.metaHeader": "Intervalle de charge",
"core.statusPage.metricsTiles.columns.loadHeader": "Charge",
"core.statusPage.metricsTiles.columns.processDelayDetailsHeader": "Centiles",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,6 @@
"core.status.yellowTitle": "黄",
"core.statusPage.coreStatus.sectionTitle": "コアステータス",
"core.statusPage.loadStatus.serverIsDownErrorMessage": "サーバーステータスのリクエストに失敗しました。サーバーがダウンしている可能性があります。",
"core.statusPage.metricsTiles.columns.heapTotalHeader": "ヒープ合計",
"core.statusPage.metricsTiles.columns.heapUsedHeader": "使用ヒープ",
"core.statusPage.metricsTiles.columns.load.metaHeader": "読み込み間隔",
"core.statusPage.metricsTiles.columns.loadHeader": "読み込み",
"core.statusPage.metricsTiles.columns.processDelayDetailsHeader": "パーセンタイル",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,6 @@
"core.status.yellowTitle": "黄色",
"core.statusPage.coreStatus.sectionTitle": "核心状态",
"core.statusPage.loadStatus.serverIsDownErrorMessage": "无法请求服务器状态。也许您的服务器已关闭?",
"core.statusPage.metricsTiles.columns.heapTotalHeader": "堆总数",
"core.statusPage.metricsTiles.columns.heapUsedHeader": "已使用堆数",
"core.statusPage.metricsTiles.columns.load.metaHeader": "加载时间间隔",
"core.statusPage.metricsTiles.columns.loadHeader": "加载",
"core.statusPage.metricsTiles.columns.processDelayDetailsHeader": "百分位数",
Expand Down

0 comments on commit 09b4167

Please sign in to comment.