3 V4.94 23 Jan 2007 (c) 2000-2007 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://adodb.sourceforge.net
11 Library for basic performance monitoring and tuning
15 // security - hide paths
16 if (!defined('ADODB_DIR')) die();
19 // Thx to Fernando Ortiz, mailto:fortiz#lacorona.com.mx
20 // With info taken from http://www.oninit.com/oninit/sysmaster/index.html
22 class perf_informix
extends adodb_perf
{
24 // Maximum size on varchar upto 9.30 255 chars
25 // better truncate varchar to 255 than char(4000) ?
26 var $createTableSQL = "CREATE TABLE adodb_logsql (
27 created datetime year to second NOT NULL,
28 sql0 varchar(250) NOT NULL,
29 sql1 varchar(255) NOT NULL,
30 params varchar(255) NOT NULL,
31 tracer varchar(255) NOT NULL,
32 timer decimal(16,6) NOT NULL
35 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";
37 var $settings = array(
39 'data cache hit ratio' => array('RATIOH',
40 "select round((1-(wt.value / (rd.value + wr.value)))*100,2)
41 from sysmaster:sysprofile wr, sysmaster:sysprofile rd, sysmaster:sysprofile wt
42 where rd.name = 'pagreads' and
43 wr.name = 'pagwrites' and
47 'data reads' => array('IO',
48 "select value from sysmaster:sysprofile where name='pagreads'",
51 'data writes' => array('IO',
52 "select value from sysmaster:sysprofile where name='pagwrites'",
56 'current connections' => array('SESS',
57 'select count(*) from sysmaster:syssessions',
58 'Number of sessions'),
64 function perf_informix(&$conn)