3 V4.20 22 Feb 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
4 Released under both BSD license and Lesser GPL library license.
5 Whenever there is any discrepancy between the two licenses,
6 the BSD license will take precedence. See License.txt.
7 Set tabs to 4 for best viewing.
9 Latest version is available at http://php.weblogs.com/
11 Library for basic performance monitoring and tuning
16 // Thx to Fernando Ortiz, mailto:fortiz#lacorona.com.mx
17 // With info taken from http://www.oninit.com/oninit/sysmaster/index.html
19 class perf_informix
extends adodb_perf
{
21 // Maximum size on varchar upto 9.30 255 chars
22 // better truncate varchar to 255 than char(4000) ?
23 var $createTableSQL = "CREATE TABLE adodb_logsql (
24 created datetime year to second NOT NULL,
25 sql0 varchar(250) NOT NULL,
26 sql1 varchar(255) NOT NULL,
27 params varchar(255) NOT NULL,
28 tracer varchar(255) NOT NULL,
29 timer decimal(16,6) NOT NULL
32 var $tablesSQL = "select a.tabname tablename, ti_nptotal*2 size_in_k, ti_nextns extents, ti_nrows records from systables c, sysmaster:systabnames a, sysmaster:systabinfo b where c.tabname not matches 'sys*' and c.partnum = a.partnum and c.partnum = b.ti_partnum";
34 var $settings = array(
36 'data cache hit ratio' => array('RATIOH',
37 "select round((1-(wt.value / (rd.value + wr.value)))*100,2)
38 from sysmaster:sysprofile wr, sysmaster:sysprofile rd, sysmaster:sysprofile wt
39 where rd.name = 'pagreads' and
40 wr.name = 'pagwrites' and
44 'data reads' => array('IO',
45 "select value from sysmaster:sysprofile where name='pagreads'",
48 'data writes' => array('IO',
49 "select value from sysmaster:sysprofile where name='pagwrites'",
53 'current connections' => array('SESS',
54 'select count(*) from sysmaster:syssessions',
55 'Number of sessions'),
61 function perf_informix(&$conn)