Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402]

   1  <?php
   2  /**
   3   * Library for basic performance monitoring and tuning
   4   *
   5   * This file is part of ADOdb, a Database Abstraction Layer library for PHP.
   6   *
   7   * @package ADOdb
   8   * @link https://adodb.org Project's web site and documentation
   9   * @link https://github.com/ADOdb/ADOdb Source code and issue tracker
  10   *
  11   * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause
  12   * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option,
  13   * any later version. This means you can use it in proprietary products.
  14   * See the LICENSE.md file distributed with this source code for details.
  15   * @license BSD-3-Clause
  16   * @license LGPL-2.1-or-later
  17   *
  18   * @copyright 2000-2013 John Lim
  19   * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community
  20   */
  21  
  22  // security - hide paths
  23  if (!defined('ADODB_DIR')) die();
  24  
  25  //
  26  // Thx to  Fernando Ortiz, mailto:fortiz#lacorona.com.mx
  27  // With info taken from http://www.oninit.com/oninit/sysmaster/index.html
  28  //
  29  class perf_informix extends adodb_perf{
  30  
  31  	 // Maximum size on varchar up to 9.30 255 chars
  32  	 // better truncate varchar to 255 than char(4000) ?
  33  	 var $createTableSQL = "CREATE TABLE adodb_logsql (
  34  	 	 created datetime year to second NOT NULL,
  35  	 	 sql0 varchar(250) NOT NULL,
  36  	 	 sql1 varchar(255) NOT NULL,
  37  	 	 params varchar(255) NOT NULL,
  38  	 	 tracer varchar(255) NOT NULL,
  39  	 	 timer decimal(16,6) NOT NULL
  40  	 )";
  41  
  42  	 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";
  43  
  44  	 var $settings = array(
  45  	 'Ratios',
  46  	 	 'data cache hit ratio' => array('RATIOH',
  47  	 	 "select round((1-(wt.value / (rd.value + wr.value)))*100,2)
  48  	 	 from sysmaster:sysprofile wr, sysmaster:sysprofile rd, sysmaster:sysprofile wt
  49  	 	 where rd.name = 'pagreads' and
  50  	 	 wr.name = 'pagwrites' and
  51  	 	 wt.name = 'buffwts'",
  52  	 	 '=WarnCacheRatio'),
  53  	 'IO',
  54  	 	 'data reads' => array('IO',
  55  	 	 "select value from sysmaster:sysprofile where name='pagreads'",
  56  	 	 'Page reads'),
  57  
  58  	 	 'data writes' => array('IO',
  59  	 	 "select value from sysmaster:sysprofile where name='pagwrites'",
  60  	 	 'Page writes'),
  61  
  62  	 'Connections',
  63  	 	 'current connections' => array('SESS',
  64  	 	 'select count(*) from sysmaster:syssessions',
  65  	 	 'Number of sessions'),
  66  
  67  	 false
  68  
  69  	 );
  70  
  71  	function __construct(&$conn)
  72  	 {
  73  	 	 $this->conn = $conn;
  74  	 }
  75  
  76  }