Skip to content

Commit db2e0b5

Browse files
authored
Merge pull request #20 from maierbenedikt/production
Graph function for individual replica transfer
2 parents 5a27036 + aef9989 commit db2e0b5

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

web/html/dynamo/dynamo/dealermon/sites.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,19 @@ function single_rrd_to_array($rrd,$rrdpath){
171171
$replicaname1 = str_replace('.rrd', '', $replicaname);
172172
$replicaname_explode = explode("_", $replicaname1, 2);
173173
$replicaname2 = $replicaname_explode[1];
174+
$replicatograph = str_replace('/', "+",$_REQUEST['replicaname']);
175+
$replicatograph = ltrim($replicatograph, '+');
174176

175-
if ($replicaname2 != str_replace(' ', "+",$_REQUEST['replicaname']))
177+
178+
if ($replicaname2 != $replicatograph)
176179

177180
continue;
178-
$replicadata = single_rrd_to_array($replicaname, $sitename);
181+
$replicadata = single_rrd_to_array($replicaname, $sitename);
179182

180183
$ratio = array();
181184

182185
for($j = 0; $j < count($replicadata[2]); $j++){
183-
$ratio[] = $replicadata[1][$j]/$replicadata[2][$j];
186+
$ratio[] = $replicadata[1][$j]/$replicadata[2][$j] * 100;
184187
}
185188
$replicainfo = array('replica' => $replicaname1, 'time' => $replicadata[0], 'copied' => $replicadata[1], 'total' => $replicadata[2], 'ratio' => $ratio);
186189
$siteinfo['data'][] = $replicainfo;
@@ -193,7 +196,7 @@ function single_rrd_to_array($rrd,$rrdpath){
193196
}
194197

195198

196-
if ( !(isset($_REQUEST['getSiteCSVs'])) ){
199+
if ( !(isset($_REQUEST['norm'])) ){
197200

198201

199202
$html = file_get_contents(__DIR__ . '/csvs.html');

0 commit comments

Comments
 (0)