From 4c6a530d5eb88869cfec6a8df09c014ddad6caaf Mon Sep 17 00:00:00 2001 From: Juha Sointusalo Date: Tue, 5 Jan 2016 21:10:19 +0200 Subject: [PATCH] ops: show large numbers in human readable format --- html/inc/db_ops.inc | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/html/inc/db_ops.inc b/html/inc/db_ops.inc index 908bd33a22..ee55c31aa9 100644 --- a/html/inc/db_ops.inc +++ b/html/inc/db_ops.inc @@ -854,25 +854,29 @@ function show_host($host) { row("CPU", "$host->p_vendor $host->p_model"); row("GFLOPS", number_format($host->p_fpops/1e9, 2)); row("GIOPS", number_format($host->p_iops/1e9, 2)); - row("memory bandwidth", $host->p_membw); + $x = $host->p_membw/(1024*1024); + $y = number_format($x, 2); + row("Memory bandwidth", "$y MB/sec"); row("Operating System", "$host->os_name $host->os_version"); $x = $host->m_nbytes/(1024*1024); - $y = round($x, 2); + $y = number_format($x, 2); row("Memory", "$y MB"); $x = $host->m_cache/1024; - $y = round($x, 2); + $y = number_format($x, 2); row("Cache", "$y KB"); $x = $host->m_swap/(1024*1024); - $y = round($x, 2); + $y = number_format($x, 2); row("Swap Space", "$y MB"); $x = $host->d_total/(1024*1024*1024); - $y = round($x, 2); + $y = number_format($x, 2); row("Total Disk Space", "$y GB"); $x = $host->d_free/(1024*1024*1024); - $y = round($x, 2); + $y = number_format($x, 2); row("Free Disk Space", "$y GB"); - row("Avg network bandwidth (upstream)", "$host->n_bwup bytes/sec"); - row("Avg network bandwidth (downstream)", "$host->n_bwdown bytes/sec"); + $x = number_format($host->n_bwup/1024); + row("Avg network bandwidth (upstream)", "$x kB/sec"); + $x = number_format($host->n_bwdown/1024); + row("Avg network bandwidth (downstream)", "$x kB/sec"); row("Average turnaround", days_string($host->avg_turnaround)); row("Number of RPCs", $host->rpc_seqno); row("Last RPC", time_str($host->rpc_time)); @@ -897,10 +901,16 @@ function show_workunit($wu) { row("XML doc", "
".htmlspecialchars($wu->xml_doc)."
"); row("Application", "appid\">" . app_name_by_id($wu->appid) . " [".$wu->appid."]"); row("Batch", $wu->batch); - row("Estimated FP Operations", $wu->rsc_fpops_est); - row("Max FP Operations", $wu->rsc_fpops_bound); - row("Max Memory Usage", $wu->rsc_memory_bound); - row("Max Disk Usage", $wu->rsc_disk_bound); + $x = number_format($wu->rsc_fpops_est/1e9, 2); + row("Estimated FP Operations", "$x GFLOPS"); + $x = number_format($wu->rsc_fpops_bound/1e9, 2); + row("Max FP Operations", "$x GFLOPS"); + $x = $wu->rsc_memory_bound/(1024*1024); + $y = number_format($x, 2); + row("Max Memory Usage", "$y MB"); + $x = $wu->rsc_disk_bound/(1024*1024); + $y = number_format($x, 2); + row("Max Disk Usage", "$y MB"); row("Need validate?", ($wu->need_validate?"yes [":"no [").$wu->need_validate."]"); row("Canonical resultid", "canonical_resultid\">".$wu->canonical_resultid."");