Show
Ignore:
Timestamp:
05/22/08 19:37:36 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1211485056 +0000
git-parent:

[3263a9a9eb67fb8bf1cbe77d3661ef26ce2fcc87]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1211485056 +0000
Message:

sweep, cleaning up graphs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ui/web/htdocs/bw_settings.php

    r75fdd0c re7e6b89  
    33 
    44require_once('Reconnoiter_amLine_Driver.php'); 
     5global $graph_settings; 
     6require_once('graph_settings.inc'); 
    57 
    68$uuid = $_GET['id']; //'cfe2aad7-71e5-400b-8418-a6d5834a0386'; 
     
    1517} 
    1618 
    17 $driver = new Reconnoiter_amLine_Driver($start, $end, isset($_GET['cnt']) ? $_GET['cnt'] : 400); 
    18 $driver->addDataSet($uuid, 'inoctets', true, '$value * 8', array('expression' => "0 - $math")); 
    19 $driver->addDataSet($uuid, 'outoctets', true, '$value * 8', array('expression' => "$math")); 
     19$driver = new Reconnoiter_amLine_Driver($start, $end, 
     20                                        isset($_GET['cnt']) ? $_GET['cnt'] : 400); 
     21$i = 0; 
     22$settings = $graph_settings[$i++]; 
     23$settings['expression'] = "0 - $math"; 
     24$driver->addDataSet($uuid, 'inoctets', true, '$value * 8', $settings); 
     25$settings = $graph_settings[$i++]; 
     26$settings['expression'] = "$math"; 
     27$driver->addDataSet($uuid, 'outoctets', true, '$value * 8', $settings); 
    2028$driver->addChangeSet($uuid, 'alias'); 
    2129$driver->calcPercentile(95); 
  • ui/web/htdocs/generic_settings.php

    r0795344 re7e6b89  
    33 
    44require_once('Reconnoiter_amLine_Driver.php'); 
     5global $graph_settings; 
     6require_once('graph_settings.inc'); 
    57 
    68$start = $_GET['start']; 
    79if(!$start) { 
    8   $start = strftime("%Y-%m-%d %H:%M:%S", time() - (7*86400)); 
     10  $start = strftime("%Y-%m-%d %H:%M:%S-00", time() - (7*86400)); 
    911} 
    1012$end = $_GET['end']; 
    1113if(!$end) { 
    12   $end = strftime("%Y-%m-%d %H:%M:%S", time()); 
     14  $end = strftime("%Y-%m-%d %H:%M:%S-00", time()); 
    1315} 
    1416 
    1517$driver = new Reconnoiter_amLine_Driver($start, $end, isset($_GET['cnt']) ? $_GET['cnt'] : 400); 
    1618 
    17 foreach(split(",", $_GET['metric']) as $m) { 
    18   preg_match('/^(d|n|t)-([0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})-(.*)$/', $m, 
     19$i = 0; 
     20foreach(split(";", $_GET['metric']) as $m) { 
     21  preg_match('/^(d|n|t)(l|r)(~|-)([0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})-(.*)$/', $m, 
    1922             $matches); 
     23  $settings = $graph_settings[$i++]; 
     24  if($matches[3] == '~') $settings['expression'] = '$this->bw($value)'; 
     25  $settings['axis'] = ($matches[2] == 'l') ? 'left' : 'right'; 
    2026  if($matches[1] == 'n') 
    21     $driver->addDataSet($matches[2], $matches[3], 'false', null, array('expression' => '$this->bw($value)')); 
     27    $driver->addDataSet($matches[4], $matches[5], 'false', null, $settings); 
    2228  else if($matches[1] == 'd') 
    23     $driver->addDataSet($matches[2], $matches[3], 'true', null, array('expression' => '$this->bw($value)')); 
     29    $driver->addDataSet($matches[4], $matches[5], 'true', null, $settings); 
    2430  else 
    25     $driver->addChangeSet($matches[2], $matches[3]); 
     31    $driver->addChangeSet($matches[4], $matches[5]); 
    2632} 
    2733 
     
    4147  <min><?php print ($driver->min() > 0) ? '0' : '' ?></min> 
    4248  <max><?php print ($driver->max() < 0) ? '0' : '' ?></max> 
    43   <unit><?php print $driver->autounit() ?></unit> 
    4449 </y_left> 
    4550</values> 
  • ui/web/htdocs/index.php

    r156a0c5 re7e6b89  
    2121      <ul> 
    2222        <?php foreach($check['numeric'] as $n) { ?> 
    23         <li><a href="generic_graph.php?metric=n-<?php print $check['id'] ?>-<?php print $n ?>&cnt=1400"><?php print $n ?></a></li> 
     23        <li><a href="generic_graph.php?metric=nl-<?php print $check['id'] ?>-<?php print $n ?>&cnt=1400"><?php print $n ?></a></li> 
    2424        <?php } ?> 
    2525      </ul> 
  • ui/web/lib/Reconnoiter_amCharts_Driver.php

    rc33606c re7e6b89  
    66  function graph_attrs() { 
    77    return array( 
    8       'gid','title','color','fill_color','fill_alpha','color_hover', 
     8      'axis', 'gid','title','color','fill_color','fill_alpha','color_hover', 
    99      'balloon_color','balloon_alpha','balloon_text_color','balloon_text', 
    1010      'bullet','bullet_size','bullet_color','visible_in_legend','selected'