@@ -285,15 +285,6 @@ $(function () {
285285 recoverKeys = data [ 'pgmap' ] [ 'recovering_keys_per_sec' ] ;
286286 recoverObjects = data [ 'pgmap' ] [ 'recovering_objects_per_sec' ] ;
287287
288- // *throughput*
289- opsPerSec = data [ 'pgmap' ] [ 'op_per_sec' ] || 0 ;
290-
291- // new in Jewel
292- if ( 'write_op_per_sec' in data [ 'pgmap' ] ) {
293- writeOpsPerSec = data [ 'pgmap' ] [ 'write_op_per_sec' ] || 0
294- readOpsPerSec = data [ 'pgmap' ] [ 'read_op_per_sec' ] || 0
295- }
296-
297288 writesPerSec = fmtBytes ( data [ 'pgmap' ] [ 'write_bytes_sec' ] || 0 ) ;
298289 readsPerSec = fmtBytes ( data [ 'pgmap' ] [ 'read_bytes_sec' ] || 0 ) ;
299290
@@ -331,6 +322,29 @@ $(function () {
331322
332323 // Update Content {{{
333324 // ----------------------------------------------------------------
325+ // update current throughput values
326+ if ( 'op_per_sec' in data [ 'pgmap' ] ) {
327+ $ ( "#operations_per_second" ) . html ( data [ 'pgmap' ] [ 'op_per_sec' ] || 0 ) ;
328+ $ ( "#ops_container" ) . show ( ) ;
329+ } else {
330+ if ( ! ( 'write_op_per_sec' in data [ 'pgmap' ] || 'read_op_per_sec' in data [ 'pgmap' ] ) ) {
331+ $ ( "#operations_per_second" ) . html ( 0 ) ;
332+ $ ( "#ops_container" ) . show ( ) ;
333+ } else {
334+ $ ( "#ops_container" ) . hide ( ) ;
335+ }
336+ }
337+
338+ if ( 'write_op_per_sec' in data [ 'pgmap' ] || 'read_op_per_sec' in data [ 'pgmap' ] ) {
339+ $ ( "#write_operations_per_second" ) . html ( data [ 'pgmap' ] [ 'write_op_per_sec' ] || 0 ) ;
340+ $ ( "#read_operations_per_second" ) . html ( data [ 'pgmap' ] [ 'read_op_per_sec' ] || 0 ) ;
341+ $ ( "#write_ops_container" ) . show ( ) ;
342+ $ ( "#read_ops_container" ) . show ( ) ;
343+ } else {
344+ $ ( "#read_ops_container" ) . hide ( ) ;
345+ $ ( "#write_ops_container" ) . hide ( ) ;
346+ }
347+
334348 // update storage capacity
335349 $ ( "#utilization" ) . dxCircularGauge ( $ . extend ( true , { } , gauge_options , {
336350 value : percentUsed
@@ -360,28 +374,6 @@ $(function () {
360374 $ ( "#recovering_objects" ) . empty ( ) ;
361375 }
362376
363- // update current throughput values
364- if ( typeof ( writeOpsPerSec ) == 'undefined' && typeof ( readOpsPerSec ) == 'undefined' ) {
365- $ ( "#operations_per_second" ) . html ( opsPerSec ) ;
366- $ ( "#ops_container" ) . show ( ) ;
367- } else {
368- $ ( "#ops_container" ) . hide ( ) ;
369- }
370-
371- if ( typeof ( writeOpsPerSec ) != 'undefined' ) {
372- $ ( "#write_operations_per_second" ) . html ( writeOpsPerSec ) ;
373- $ ( "#write_ops_container" ) . show ( ) ;
374- } else {
375- $ ( "#write_ops_container" ) . hide ( ) ;
376- }
377-
378- if ( typeof ( readOpsPerSec ) != 'undefined' ) {
379- $ ( "#read_operations_per_second" ) . html ( readOpsPerSec ) ;
380- $ ( "#read_ops_container" ) . show ( ) ;
381- } else {
382- $ ( "#read_ops_container" ) . hide ( ) ;
383- }
384-
385377 $ ( "#write_bytes" ) . html ( writesPerSec ) ;
386378 $ ( "#read_bytes" ) . html ( readsPerSec ) ;
387379
0 commit comments