Пример #1
0
 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("&nbsp;&nbsp;Inserting: ", $profiler->get("INS")));
         system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message("&nbsp;&nbsp;Updating: ", $profiler->get("UPD")));
         system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message("&nbsp;&nbsp;Selecting: ", $profiler->get("SEL")));
         system_base_Cache::benchmark_message(system_base_Cache::format_profiler_message("&nbsp;&nbsp;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);
 }