Changeset e7e6b89902c5db31aaaab043f4ae2a67a3211a36
- Timestamp:
- 05/22/08 19:37:36
(5 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
| r75fdd0c |
re7e6b89 |
|
| 3 | 3 | |
|---|
| 4 | 4 | require_once('Reconnoiter_amLine_Driver.php'); |
|---|
| | 5 | global $graph_settings; |
|---|
| | 6 | require_once('graph_settings.inc'); |
|---|
| 5 | 7 | |
|---|
| 6 | 8 | $uuid = $_GET['id']; //'cfe2aad7-71e5-400b-8418-a6d5834a0386'; |
|---|
| … | … | |
| 15 | 17 | } |
|---|
| 16 | 18 | |
|---|
| 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); |
|---|
| 20 | 28 | $driver->addChangeSet($uuid, 'alias'); |
|---|
| 21 | 29 | $driver->calcPercentile(95); |
|---|
| r0795344 |
re7e6b89 |
|
| 3 | 3 | |
|---|
| 4 | 4 | require_once('Reconnoiter_amLine_Driver.php'); |
|---|
| | 5 | global $graph_settings; |
|---|
| | 6 | require_once('graph_settings.inc'); |
|---|
| 5 | 7 | |
|---|
| 6 | 8 | $start = $_GET['start']; |
|---|
| 7 | 9 | if(!$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)); |
|---|
| 9 | 11 | } |
|---|
| 10 | 12 | $end = $_GET['end']; |
|---|
| 11 | 13 | if(!$end) { |
|---|
| 12 | | $end = strftime("%Y-%m-%d %H:%M:%S", time()); |
|---|
| | 14 | $end = strftime("%Y-%m-%d %H:%M:%S-00", time()); |
|---|
| 13 | 15 | } |
|---|
| 14 | 16 | |
|---|
| 15 | 17 | $driver = new Reconnoiter_amLine_Driver($start, $end, isset($_GET['cnt']) ? $_GET['cnt'] : 400); |
|---|
| 16 | 18 | |
|---|
| 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; |
|---|
| | 20 | foreach(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, |
|---|
| 19 | 22 | $matches); |
|---|
| | 23 | $settings = $graph_settings[$i++]; |
|---|
| | 24 | if($matches[3] == '~') $settings['expression'] = '$this->bw($value)'; |
|---|
| | 25 | $settings['axis'] = ($matches[2] == 'l') ? 'left' : 'right'; |
|---|
| 20 | 26 | 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); |
|---|
| 22 | 28 | 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); |
|---|
| 24 | 30 | else |
|---|
| 25 | | $driver->addChangeSet($matches[2], $matches[3]); |
|---|
| | 31 | $driver->addChangeSet($matches[4], $matches[5]); |
|---|
| 26 | 32 | } |
|---|
| 27 | 33 | |
|---|
| … | … | |
| 41 | 47 | <min><?php print ($driver->min() > 0) ? '0' : '' ?></min> |
|---|
| 42 | 48 | <max><?php print ($driver->max() < 0) ? '0' : '' ?></max> |
|---|
| 43 | | <unit><?php print $driver->autounit() ?></unit> |
|---|
| 44 | 49 | </y_left> |
|---|
| 45 | 50 | </values> |
|---|
| r156a0c5 |
re7e6b89 |
|
| 21 | 21 | <ul> |
|---|
| 22 | 22 | <?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> |
|---|
| 24 | 24 | <?php } ?> |
|---|
| 25 | 25 | </ul> |
|---|
| rc33606c |
re7e6b89 |
|
| 6 | 6 | function graph_attrs() { |
|---|
| 7 | 7 | return array( |
|---|
| 8 | | 'gid','title','color','fill_color','fill_alpha','color_hover', |
|---|
| | 8 | 'axis', 'gid','title','color','fill_color','fill_alpha','color_hover', |
|---|
| 9 | 9 | 'balloon_color','balloon_alpha','balloon_text_color','balloon_text', |
|---|
| 10 | 10 | 'bullet','bullet_size','bullet_color','visible_in_legend','selected' |
|---|