- or download this
my $perfdbh = DBI->connect("DBI:mysql:database=$database;host=$dbhost"
+, "******", "******", {RaiseError => 1, AutoCommit => 1}) or die $DBI
+::errstr;
- or download this
my $statement = "select $columns{$database} from $perftable where $que
+ry";
my ($days, $latest, $maxcpu, $avgcpu, $minfreemem, $avgfreemem) = ($pe
+rfdbh->selectrow_array($statement));
- or download this
my ($days, $latest, $maxcpu, $avgcpu, $minfreemem, $avgfreemem) = ($pe
+rfdbh->selectrow_array("
select $columns{$database}
from $perftable
where $query"));
- or download this
mysql> select ( count(*) / 288 ), max(date), max(usrpercent+nicepercen
+t+syspercent+wiopercent), avg(usrpercent+nicepercent+syspercent+wiope
+rcent), max(memused - memcache), avg(memused - memcache) from SERVER
+where epoch >= (select max(epoch)-3456000 from SERVER) and (time <= '
+09:00' or time >= '17:00');
+--------------------+-----------+------------------------------------
+---------------+---------------------------------------------------+-
+------------------------+-------------------------+
...
| 0.0000 | NULL |
+ NULL | NULL |
+ NULL | NULL |
+--------------------+-----------+------------------------------------
+---------------+---------------------------------------------------+-
+------------------------+-------------------------+
1 row in set (0.01 sec)