diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-29 15:11:29 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-29 15:11:29 +0000 |
| commit | 0ac765b12bd7141aa21318780e9daefad8faea39 (patch) | |
| tree | 60c7b25d514a2d19d4659f259f62f4c9cf9fb9b7 /frontends/php/include/classes/graph.inc.php | |
| parent | b889c85c093cc89ddf822e43dfed12ca240e6c03 (diff) | |
| download | zabbix-0ac765b12bd7141aa21318780e9daefad8faea39.tar.gz zabbix-0ac765b12bd7141aa21318780e9daefad8faea39.tar.xz zabbix-0ac765b12bd7141aa21318780e9daefad8faea39.zip | |
- make possible combination of FLOAT and UINT history in a graph (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2453 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes/graph.inc.php')
| -rw-r--r-- | frontends/php/include/classes/graph.inc.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/frontends/php/include/classes/graph.inc.php b/frontends/php/include/classes/graph.inc.php index b2460441..2ca55bc7 100644 --- a/frontends/php/include/classes/graph.inc.php +++ b/frontends/php/include/classes/graph.inc.php @@ -550,15 +550,14 @@ if($this->period<=24*3600) { - if($this->items[0]["value_type"] == ITEM_VALUE_TYPE_UINT64) $table="history_uint"; - else $table="history"; - $sql="select itemid,round(900*((clock+$z)%($p))/($p),0) as i,count(*) as count,avg(value) as avg,min(value) as min,max(value) as max,max(clock) as clock from $table where itemid in ($str) and clock>=".$this->from_time." and clock<=".$this->to_time." group by itemid,round(900*((clock+$z)%($p))/($p),0)"; +// $sql="select itemid,round(900*((clock+$z)%($p))/($p),0) as i,count(*) as count,avg(value) as avg,min(value) as min,max(value) as max,max(clock) as clock from history where itemid in ($str) and clock>=".$this->from_time." and clock<=".$this->to_time." group by itemid,round(900*((clock+$z)%($p))/($p),0)"; + $sql="select itemid,round(900*((clock+$z)%($p))/($p),0) as i,count(*) as count,avg(value) as avg,min(value) as min,max(value) as max,max(clock) as clock from history where itemid in ($str) and clock>=".$this->from_time." and clock<=".$this->to_time." group by itemid,round(900*((clock+$z)%($p))/($p),0) union select itemid,round(900*((clock+$z)%($p))/($p),0) as i,count(*) as count,avg(value) as avg,min(value) as min,max(value) as max,max(clock) as clock from history_uint where itemid in ($str) and clock>=".$this->from_time." and clock<=".$this->to_time." group by itemid,round(900*((clock+$z)%($p))/($p),0)"; } else { $sql="select itemid,round(900*((clock+$z)%($p))/($p),0) as i,sum(num) as count,avg(value_avg) as avg,min(value_min) as min,max(value_max) as max,max(clock) as clock from trends where itemid in ($str) and clock>=".$this->from_time." and clock<=".$this->to_time." group by itemid,round(900*((clock+$z)%($p))/($p),0)"; } -// echo $sql; +// echo "<br>",$sql,"<br>"; $result=DBselect($sql); while($row=DBfetch($result)) |
