From 04af0f2ea84564cd46ad208014f67832c8805a44 Mon Sep 17 00:00:00 2001 From: Christian Eichelmann Date: Wed, 11 Jan 2017 20:41:31 +0100 Subject: [PATCH 1/2] trying to fix problems with display of ops/sec --- app/static/js/ceph.dash.js | 39 +++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/app/static/js/ceph.dash.js b/app/static/js/ceph.dash.js index 2dc92bd..e3664ca 100644 --- a/app/static/js/ceph.dash.js +++ b/app/static/js/ceph.dash.js @@ -285,15 +285,6 @@ $(function () { recoverKeys = data['pgmap']['recovering_keys_per_sec']; recoverObjects = data['pgmap']['recovering_objects_per_sec']; - // *throughput* - opsPerSec = data['pgmap']['op_per_sec'] || 0; - - // new in Jewel - if('write_op_per_sec' in data['pgmap']) { - writeOpsPerSec = data['pgmap']['write_op_per_sec'] || 0 - readOpsPerSec = data['pgmap']['read_op_per_sec'] || 0 - } - writesPerSec = fmtBytes(data['pgmap']['write_bytes_sec'] || 0); readsPerSec = fmtBytes(data['pgmap']['read_bytes_sec'] || 0); @@ -331,6 +322,28 @@ $(function () { // Update Content {{{ // ---------------------------------------------------------------- + // update current throughput values + if ('op_per_sec' in data['pgmap']) { + $("#operations_per_second").html(data['pgmap']['op_per_sec'] || 0); + $("#ops_container").show(); + } else { + if (!('write_op_per_sec' in data['pgmap'] || 'read_op_per_sec' in data['pgmap'])) { + $("#ops_container").show(); + } else { + $("#ops_container").hide(); + } + } + + if ('write_op_per_sec' in data['pgmap'] || 'read_op_per_sec' in data['pgmap']) { + $("#write_operations_per_second").html(data['pgmap']['write_op_per_sec'] || 0); + $("#read_operations_per_second").html(data['pgmap']['read_op_per_sec'] || 0); + $("#write_ops_container").show(); + $("#read_ops_container").show(); + } else{ + $("#read_ops_container").hide(); + $("#write_ops_container").hide(); + } + // update storage capacity $("#utilization").dxCircularGauge($.extend(true, {}, gauge_options, { value: percentUsed @@ -360,14 +373,6 @@ $(function () { $("#recovering_objects").empty(); } - // update current throughput values - if( typeof(writeOpsPerSec) == 'undefined' && typeof(readOpsPerSec) == 'undefined' ){ - $("#operations_per_second").html(opsPerSec); - $("#ops_container").show(); - } else{ - $("#ops_container").hide(); - } - if( typeof(writeOpsPerSec) != 'undefined'){ $("#write_operations_per_second").html(writeOpsPerSec); $("#write_ops_container").show(); From 0dc253c887b5b64ac57f601bfdc15df17360e310 Mon Sep 17 00:00:00 2001 From: Christian Eichelmann Date: Fri, 13 Jan 2017 23:04:24 +0100 Subject: [PATCH 2/2] deleted obsolete section --- app/static/js/ceph.dash.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/app/static/js/ceph.dash.js b/app/static/js/ceph.dash.js index e3664ca..be245fd 100644 --- a/app/static/js/ceph.dash.js +++ b/app/static/js/ceph.dash.js @@ -328,6 +328,7 @@ $(function () { $("#ops_container").show(); } else { if (!('write_op_per_sec' in data['pgmap'] || 'read_op_per_sec' in data['pgmap'])) { + $("#operations_per_second").html(0); $("#ops_container").show(); } else { $("#ops_container").hide(); @@ -339,11 +340,11 @@ $(function () { $("#read_operations_per_second").html(data['pgmap']['read_op_per_sec'] || 0); $("#write_ops_container").show(); $("#read_ops_container").show(); - } else{ + } else { $("#read_ops_container").hide(); $("#write_ops_container").hide(); } - + // update storage capacity $("#utilization").dxCircularGauge($.extend(true, {}, gauge_options, { value: percentUsed @@ -373,20 +374,6 @@ $(function () { $("#recovering_objects").empty(); } - if( typeof(writeOpsPerSec) != 'undefined'){ - $("#write_operations_per_second").html(writeOpsPerSec); - $("#write_ops_container").show(); - } else{ - $("#write_ops_container").hide(); - } - - if( typeof(readOpsPerSec) != 'undefined'){ - $("#read_operations_per_second").html(readOpsPerSec); - $("#read_ops_container").show(); - } else{ - $("#read_ops_container").hide(); - } - $("#write_bytes").html(writesPerSec); $("#read_bytes").html(readsPerSec);