From aef99895a6c10ec3e71e44a51a1645a9f1c1d13c Mon Sep 17 00:00:00 2001 From: Benedikt Maier Date: Fri, 17 Nov 2017 12:35:05 -0500 Subject: [PATCH] Graph function for individual replica transfer --- web/html/dynamo/dynamo/dealermon/sites.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/html/dynamo/dynamo/dealermon/sites.php b/web/html/dynamo/dynamo/dealermon/sites.php index 0d6bcc4a..826d940a 100644 --- a/web/html/dynamo/dynamo/dealermon/sites.php +++ b/web/html/dynamo/dynamo/dealermon/sites.php @@ -171,16 +171,19 @@ function single_rrd_to_array($rrd,$rrdpath){ $replicaname1 = str_replace('.rrd', '', $replicaname); $replicaname_explode = explode("_", $replicaname1, 2); $replicaname2 = $replicaname_explode[1]; + $replicatograph = str_replace('/', "+",$_REQUEST['replicaname']); + $replicatograph = ltrim($replicatograph, '+'); - if ($replicaname2 != str_replace(' ', "+",$_REQUEST['replicaname'])) + + if ($replicaname2 != $replicatograph) continue; - $replicadata = single_rrd_to_array($replicaname, $sitename); + $replicadata = single_rrd_to_array($replicaname, $sitename); $ratio = array(); for($j = 0; $j < count($replicadata[2]); $j++){ - $ratio[] = $replicadata[1][$j]/$replicadata[2][$j]; + $ratio[] = $replicadata[1][$j]/$replicadata[2][$j] * 100; } $replicainfo = array('replica' => $replicaname1, 'time' => $replicadata[0], 'copied' => $replicadata[1], 'total' => $replicadata[2], 'ratio' => $ratio); $siteinfo['data'][] = $replicainfo; @@ -193,7 +196,7 @@ function single_rrd_to_array($rrd,$rrdpath){ } -if ( !(isset($_REQUEST['getSiteCSVs'])) ){ +if ( !(isset($_REQUEST['norm'])) ){ $html = file_get_contents(__DIR__ . '/csvs.html');