Changeset df2e366438418c6f91a256714a461d0642f7deb5

Show
Ignore:
Timestamp:
09/21/08 23:54:44 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1222041284 +0000
git-parent:

[9478c46796698a9d729f21764b5671a5acd1fbbe]

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

as hard as we try, we cannot replace the elegance of reverse polish notation. refs #22

Files:

Legend:

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

    r9478c46 rdf2e366  
    2020                                        isset($_GET['cnt']) ? $_GET['cnt'] : 400); 
    2121$i = 0; 
    22 $math = '$this->bw($value)'; 
     22$math = 'auto,2,round'; 
    2323if($view == "packets") { 
    2424  $settings = $graph_settings[$i++]; 
    25   $settings['expression'] = "0 - $math"; 
    26   $driver->addDataSet($uuid, 'inucastpkts', true, '$value', $settings); 
     25  $settings['expression'] = "$math,-1,*"; 
     26  $driver->addDataSet($uuid, 'inucastpkts', true, null, $settings); 
    2727  $settings = $graph_settings[$i++]; 
    2828  $settings['expression'] = "$math"; 
    29   $driver->addDataSet($uuid, 'outucastpkts', true, '$value', $settings); 
     29  $driver->addDataSet($uuid, 'outucastpkts', true, null, $settings); 
    3030} else { 
    3131  $settings = $graph_settings[$i++]; 
    32   $settings['expression'] = "0 - $math"; 
    33   $driver->addDataSet($uuid, 'inoctets', true, '$value * 8', $settings); 
     32  $settings['expression'] = "$math,-1,*"; 
     33  $driver->addDataSet($uuid, 'inoctets', true, '8,*', $settings); 
    3434  $settings = $graph_settings[$i++]; 
    3535  $settings['expression'] = "$math"; 
    36   $driver->addDataSet($uuid, 'outoctets', true, '$value * 8', $settings); 
     36  $driver->addDataSet($uuid, 'outoctets', true, '8,*', $settings); 
    3737  $driver->addChangeSet($uuid, 'alias'); 
    3838  $driver->calcPercentile(95); 
  • ui/web/htdocs/generic_settings.php

    r9478c46 rdf2e366  
    2525  if($matches[3] == '~') { 
    2626    $autounits = 1; 
    27     $settings['expression'] = '$this->autounits($value)'; 
     27    $settings['expression'] = 'auto'; 
    2828  } 
    2929  $settings['axis'] = ($matches[2] == 'l') ? 'left' : 'right'; 
     
    3333    $driver->addDataSet($matches[4], $matches[5], 'true', null, $settings); 
    3434  else if($matches[1] == 'D') { 
    35     $settings['expression'] = "((".$settings['expression']." > 0) ? (".$settings['expression'].") : 0)"; 
     35    $settings['expression'] = $settings['expression'].",0,max"; 
    3636    $driver->addDataSet($matches[4], $matches[5], 'true', null, $settings); 
    3737  } 
  • ui/web/lib/Reconnoiter_DataContainer.php

    r9478c46 rdf2e366  
    44require_once('Reconnoiter_DataSet.php'); 
    55require_once('Reconnoiter_ChangeSet.php'); 
     6require_once('Reconnoiter_RPN.php'); 
    67 
    7 class Reconnoiter_DataContainer
     8class Reconnoiter_DataContainer extends Reconnoiter_RPN
    89  protected $units = 0; 
    910  protected $start; 
  • ui/web/lib/Reconnoiter_DataSet.php

    rc33606c rdf2e366  
    11<?php 
    22 
    3 class Reconnoiter_DataSet { 
     3require_once('Reconnoiter_RPN.php'); 
     4 
     5class Reconnoiter_DataSet extends Reconnoiter_RPN { 
    46  public $data; 
    57  protected $expr; 
     
    1719  function data($ts, $attr = 'avg_value') { 
    1820    if(!$this->expr) return $this->data[$ts][$attr]; 
    19     $value = $this->data[$ts][$attr]; 
    20     eval("\$value = $this->expr;"); 
    21     return $value; 
     21    return $this->rpn_eval($this->data[$ts][$attr], $this->expr); 
    2222  } 
    2323} 
  • ui/web/lib/Reconnoiter_amCharts_Driver.php

    r6c1e4ca rdf2e366  
    7474    if($value != "") { 
    7575      if(isset($config['expression'])) { 
    76         $expr = $config['expression']; 
    77         eval("\$value = $expr;"); 
     76        $value = $this->rpn_eval($value, $config['expression']); 
    7877      } 
    7978    } 
  • ui/web/lib/Reconnoiter_amLine_Driver.php

    rc33606c rdf2e366  
    2222      if($value != "") { 
    2323        if(isset($config['expression'])) { 
    24           $expr = $config['expression']; 
    25           eval("\$value = $expr;"); 
     24          $value = $this->rpn_eval($value, $config['expression']); 
    2625        } 
    2726        $desc = $set->description($ts);