Skip to content

Commit

Permalink
Merge pull request #47 from Crapworks/ops_sec_patch
Browse files Browse the repository at this point in the history
trying to fix problems with display of ops/sec
  • Loading branch information
Crapworks authored Jan 13, 2017
2 parents 389cd7d + 0dc253c commit 6bba525
Showing 1 changed file with 23 additions and 31 deletions.
54 changes: 23 additions & 31 deletions app/static/js/ceph.dash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -331,6 +322,29 @@ $(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'])) {
$("#operations_per_second").html(0);
$("#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
Expand Down Expand Up @@ -360,28 +374,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();
} 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);

Expand Down

0 comments on commit 6bba525

Please sign in to comment.