home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / perf-informix.inc.php < prev    next >
Encoding:
PHP Script  |  2004-03-20  |  2.0 KB  |  68 lines

  1. <?php
  2. /* 
  3. V4.21 20 Mar 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.
  8.   
  9.   Latest version is available at http://php.weblogs.com/
  10.   
  11.   Library for basic performance monitoring and tuning 
  12.   
  13. */
  14.  
  15. //
  16. // Thx to  Fernando Ortiz, mailto:fortiz#lacorona.com.mx
  17. // With info taken from http://www.oninit.com/oninit/sysmaster/index.html
  18. //
  19. class perf_informix extends adodb_perf{
  20.  
  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
  30.     )";
  31.     
  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";
  33.     
  34.     var $settings = array(
  35.     'Ratios',
  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
  41.         wt.name = 'buffwts'",
  42.         '=WarnCacheRatio'),
  43.     'IO',
  44.         'data reads' => array('IO',
  45.         "select value from sysmaster:sysprofile where name='pagreads'",
  46.         'Page reads'),
  47.         
  48.         'data writes' => array('IO',
  49.         "select value from sysmaster:sysprofile where name='pagwrites'",
  50.         'Page writes'),
  51.     
  52.     'Connections',
  53.         'current connections' => array('SESS',
  54.         'select count(*) from sysmaster:syssessions',
  55.         'Number of sessions'),
  56.     
  57.     false
  58.     
  59.     );
  60.     
  61.     function perf_informix(&$conn)
  62.     {
  63.         $this->conn =& $conn;
  64.     }
  65.  
  66. }
  67. ?>
  68.