[[v5:performance:index|Index]]\\ ====== Performance Monitoring ====== ===== Description ===== ADOdb contains a number of performance monitoring tools, such as query logging, hardware performance, and caching statistics. In order to use performance monitoring, the driver must be one of those specified below. == Supported Drivers == The following databases support performance monitoring * [[v5:database:ibm_db2|IBM DB2]] * [[v5:database:informix|Informix]] * [[v5:database:microsoft_sql_server|Microsoft SQL Server]] * [[v5:database:mysql|MySQL]] * [[v5:database:oracle|Oracle]] * [[v5:database:postgresql|PostgreSQL]] ===== Setup ===== To add performance monitoring to the ADOdb system make a call to the ''newPerfMonitor'' method. --------------------- $db = newAdoConnection('db2'); $db->connect('','user','password','database'); /* * Initialize the performance monitoring module */ $perf = NewPerfMonitor($db); ===== Features ===== ==== User Interface ==== A simple user interface to the performance monitoring tools is provided through the [[v5:performance:ui|UI()]] method. ==== Query Logging ==== | [[v5:performance:logsql|logSql()]] | Enables or disables the logging functionality | | [[v5:performance:expensivesql|expensiveSql()]] | Returns an analysis of expensive SQL statements from acquired data | | [[v5:performance:suspicioussql|suspiciousSql()]] | Returns an analysis of suspicious SQL statements from acquired data | | [[v5:performance:invalidsql|invalidSql()]] | Returns an analysis of invalid SQL statements from acquired data | | [[v5:performance:clearsql|clearSql()]] | Empties the SQL logging table | ==== CPU and Other Performance Indicators ==== | [[v5:performance:healthcheck|healthCheck()]] | Executes a basic database health check and returns a HTML table | | [[v5:performance:healthcheckcli]] | Executes a basic database health check and reports to the console | | [[v5:performance:cpuload|cpuLoad()]] | Returns information about CPU utilization |