mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Add disk space percentage to node listing (#42145)
* Add disk space percentage to node listing * Test modification for totalSpace * Fix test mockup * Add totalSpace to fixture * Test fixup * Remove trailing space per review suggestion * More fixture updates * More fixture update * More fixture updates * Update mock * More fixture changes
This commit is contained in:
parent
392b8e16f7
commit
15c43b73ef
5 changed files with 14 additions and 6 deletions
|
@ -15,6 +15,7 @@ export function NodeDetailStatus({ stats }) {
|
|||
transport_address: transportAddress,
|
||||
usedHeap,
|
||||
freeSpace,
|
||||
totalSpace,
|
||||
documents,
|
||||
dataSize,
|
||||
indexCount,
|
||||
|
@ -24,6 +25,8 @@ export function NodeDetailStatus({ stats }) {
|
|||
isOnline,
|
||||
} = stats;
|
||||
|
||||
const percentSpaceUsed = (freeSpace / totalSpace) * 100;
|
||||
|
||||
const metrics = [
|
||||
{
|
||||
label: i18n.translate('xpack.monitoring.elasticsearch.nodeDetailStatus.transportAddress', {
|
||||
|
@ -45,9 +48,9 @@ export function NodeDetailStatus({ stats }) {
|
|||
},
|
||||
{
|
||||
label: i18n.translate('xpack.monitoring.elasticsearch.nodeDetailStatus.freeDiskSpaceLabel', {
|
||||
defaultMessage: 'Free Disk Space'
|
||||
defaultMessage: 'Free Disk Space',
|
||||
}),
|
||||
value: formatMetric(freeSpace, '0.0 b'),
|
||||
value: formatMetric(freeSpace, '0.0 b') + ' (' + formatMetric(percentSpaceUsed, '0,0.[00]', '%', { prependSpace: false }) + ')',
|
||||
'data-test-subj': 'freeDiskSpace'
|
||||
},
|
||||
{
|
||||
|
|
|
@ -59,6 +59,7 @@ describe('Elasticsearch Node Summary get_node_summary handleResponse', () => {
|
|||
documents: undefined,
|
||||
dataSize: undefined,
|
||||
freeSpace: undefined,
|
||||
totalSpace: undefined,
|
||||
usedHeap: undefined,
|
||||
nodeTypeLabel: 'Node',
|
||||
nodeTypeClass: 'fa-server',
|
||||
|
@ -108,7 +109,8 @@ describe('Elasticsearch Node Summary get_node_summary handleResponse', () => {
|
|||
},
|
||||
fs: {
|
||||
total: {
|
||||
available_in_bytes: 8700
|
||||
available_in_bytes: 8700,
|
||||
total_in_bytes: 10000
|
||||
}
|
||||
},
|
||||
jvm: {
|
||||
|
@ -135,6 +137,7 @@ describe('Elasticsearch Node Summary get_node_summary handleResponse', () => {
|
|||
documents: 11000,
|
||||
dataSize: 35000,
|
||||
freeSpace: 8700,
|
||||
totalSpace: 10000,
|
||||
usedHeap: 33,
|
||||
nodeTypeLabel: 'Master Node',
|
||||
nodeTypeClass: 'fa-star',
|
||||
|
|
|
@ -44,6 +44,7 @@ export function handleResponse(clusterState, shardStats, nodeUuid) {
|
|||
documents: get(sourceStats, 'indices.docs.count'),
|
||||
dataSize: get(sourceStats, 'indices.store.size_in_bytes'),
|
||||
freeSpace: get(sourceStats, 'fs.total.available_in_bytes'),
|
||||
totalSpace: get(sourceStats, 'fs.total.total_in_bytes'),
|
||||
usedHeap: get(sourceStats, 'jvm.mem.heap_used_percent'),
|
||||
status: i18n.translate('xpack.monitoring.es.nodes.onlineStatusLabel', {
|
||||
defaultMessage: 'Online' }),
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"documents": 24830,
|
||||
"dataSize": 52847579,
|
||||
"freeSpace": 186755088384,
|
||||
"totalSpace": 499065712640,
|
||||
"usedHeap": 29,
|
||||
"status": "Online",
|
||||
"isOnline": true
|
||||
|
|
|
@ -42,7 +42,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
expect(await nodeDetail.getSummary()).to.eql({
|
||||
transportAddress: 'Transport Address\n127.0.0.1:9300',
|
||||
jvmHeap: 'JVM Heap\n29%',
|
||||
freeDiskSpace: 'Free Disk Space\n173.9 GB',
|
||||
freeDiskSpace: 'Free Disk Space\n173.9 GB (37.42%)',
|
||||
documentCount: 'Documents\n24.8k',
|
||||
dataSize: 'Data\n50.4 MB',
|
||||
indicesCount: 'Indices\n20',
|
||||
|
@ -58,7 +58,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
expect(await nodeDetail.getSummary()).to.eql({
|
||||
transportAddress: 'Transport Address\n127.0.0.1:9302',
|
||||
jvmHeap: 'JVM Heap\n17%',
|
||||
freeDiskSpace: 'Free Disk Space\n173.9 GB',
|
||||
freeDiskSpace: 'Free Disk Space\n173.9 GB (37.42%)',
|
||||
documentCount: 'Documents\n240',
|
||||
dataSize: 'Data\n1.4 MB',
|
||||
indicesCount: 'Indices\n4',
|
||||
|
@ -93,7 +93,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
expect(await nodeDetail.getSummary()).to.eql({
|
||||
transportAddress: 'Transport Address\n127.0.0.1:9302',
|
||||
jvmHeap: 'JVM Heap\nN/A',
|
||||
freeDiskSpace: 'Free Disk Space\nN/A',
|
||||
freeDiskSpace: 'Free Disk Space\nN/A (N/A)',
|
||||
documentCount: 'Documents\nN/A',
|
||||
dataSize: 'Data\nN/A',
|
||||
indicesCount: 'Indices\nN/A',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue