summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/classes/graph.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-11-13 11:53:46 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-11-13 11:53:46 +0000
commit0877e5ce56b36b516107c117ea6859dffd463d85 (patch)
tree5daecebe9c20e601b2ceec3335449abde57a0c03 /frontends/php/include/classes/graph.inc.php
parent8c79e63b4f2d603ab31ce6db251536d030620f53 (diff)
downloadzabbix-0877e5ce56b36b516107c117ea6859dffd463d85.tar.gz
zabbix-0877e5ce56b36b516107c117ea6859dffd463d85.tar.xz
zabbix-0877e5ce56b36b516107c117ea6859dffd463d85.zip
- merged 3458:3460 from (branches/1.1.4) [fixed graphs] (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3461 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes/graph.inc.php')
-rw-r--r--frontends/php/include/classes/graph.inc.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/frontends/php/include/classes/graph.inc.php b/frontends/php/include/classes/graph.inc.php
index 753ce648..f7c2f751 100644
--- a/frontends/php/include/classes/graph.inc.php
+++ b/frontends/php/include/classes/graph.inc.php
@@ -40,6 +40,11 @@
define("GRAPH_TYPE_NORMAL", 0);
define("GRAPH_TYPE_STACKED", 1);
+ define('ZBX_MAX_TREND_DIFF', 3600);
+
+ define('ZBX_GRAPH_MAX_SKIP_CELL', 16);
+ define('ZBX_GRAPH_MAX_SKIP_DELAY', 4);
+
class Graph
{
var $period;
@@ -921,7 +926,7 @@
}
$sql_arr = array();
- if($this->period <= 24*3600)
+ if(($this->period / $this->sizeX) <= (ZBX_MAX_TREND_DIFF / ZBX_GRAPH_MAX_SKIP_CELL))
{
array_push($sql_arr,
'select itemid,round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0) as i,'.
@@ -1205,9 +1210,9 @@
$delay = $this->items[$item]["delay"];
if($cell > $delay)
- $draw = $diff < 16*$cell;
+ $draw = $diff < ZBX_GRAPH_MAX_SKIP_CELL * $cell;
else
- $draw = $diff < 4*$delay;
+ $draw = $diff < ZBX_GRAPH_MAX_SKIP_DELAY * $delay;
if($draw == false && $this->items[$item]["calc_type"] == GRAPH_ITEM_AGGREGATED)
$draw = $i - $j < 5;