public function add_sql($t, $sql) { parent::add($t); if ($t >= $this->slow) { $this->slow_sql = $sql; } if ($t <= $this->fast) { $this->fast_sql = $sql; } return $this->time; }
static function set_stop_time($t) { system_base_Pcall::$stop_time = $t; }
static function add_benchmark_cache() { $profiler = system_base_Profiler::get_instance(); $stop_time = system_base_Profiler::stop(); system_base_Pcall::set_stop_time($stop_time); system_base_Cache::$profile_buffer->append("<table class='__table__'><tr>"); system_base_Cache::$profile_buffer->append("<th class='__100px__'>Function</th>"); system_base_Cache::$profile_buffer->append("<th class='__dcalls__'>Calls</th>"); system_base_Cache::$profile_buffer->append("<th class='__100px__'>Total</th>"); system_base_Cache::$profile_buffer->append("<th class='__100px__'>Fastest</th>"); system_base_Cache::$profile_buffer->append("<th class='__100px__'>Slowest</th>"); system_base_Cache::$profile_buffer->append("<th class='__pcent__'>%</th>"); system_base_Cache::$profile_buffer->append("<th class='__pcent__'>Avg.%</th>"); system_base_Cache::$profile_buffer->append("</tr>"); system_base_Cache::benchmark_message(system_base_Cache::format_profiler_t_total("Run time: ", $stop_time)); system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message("Base logic: ", $profiler->get("LOG"))); if (system_base_Cache::$profile_sql) { system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message("Connecting: ", $profiler->get("CON"))); system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message("Queries: ", $profiler->get("QUE"))); system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message(" Inserting: ", $profiler->get("INS"))); system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message(" Updating: ", $profiler->get("UPD"))); system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message(" Selecting: ", $profiler->get("SEL"))); system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message(" Deleting: ", $profiler->get("DEL"))); system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message("Preparing: ", $profiler->get("PRE"))); system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message("Executing: ", $profiler->get("EXE"))); system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message("Setting @?: ", $profiler->get("SET"))); system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message("Other: ", $profiler->get("OTH"))); } system_base_Cache::$profile_buffer->append("</table>"); if (system_base_Cache::$profile_sql) { system_base_Cache::explain_all(); } if (!system_base_Cache::$output_buffer->body_is_closed()) { system_base_Cache::$output_buffer->append("</body></html>"); } system_base_Cache::$output_buffer->insert_before("</body>", system_base_Cache::$profile_buffer->b); }