Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: bc613aa7f7
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 62 lines (61 sloc) 1.415 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
<?php if ( !defined( 'HABARI_PATH' ) ) { die('No direct access'); } ?>
<?php
if (! isset($_GET['db_profile']) || ( !User::identify()->loggedin ) )
{
return;
}
else
{
?>
<style>
.prof_container {
margin: 10 100;
text-align: center;
border: solid 1px #999;
background-color: #f7f7f7;
padding: 15;
}
.prof_header {
font: 320% Arial, Helvetica;
color: #000;
text-align: left;
margin: 0 0 6 0;
padding: 0;
}
.prof_sql {
font: 240% monospace, Courier;
font-weight: bold;
text-align: left;
padding: 4 4 4 30;
margin: 4 100;
display: block;
}
.prof_time {
font: 180%/2.0 Verdana, Tahoma, sans;
color: red;
text-align: left;
}
</style>
<div class="prof_container">
<h1 class="prof_header"><?php _e('DB Profiling'); ?></h1>
<?php
$profiles = DB::get_profiles();
$total_time_querying = 0;
foreach ($profiles as $profile) {
?>
<div>
<code class="prof_sql"><?php echo $profile->query_text;?></code>
<div class="prof_time"><?php _e('Time to Execute:'); ?> <strong><?php echo $profile->total_time;?></strong></div>
<?php if (! empty($profile->backtrace)) {?>
<pre style="text-align: left;"><strong><?php _e('BACKTRACE:'); ?></strong><br><?php print_r($profile->backtrace);?></pre>
<?php }?>
</div>
<?php
  $total_time_querying+= $profile->total_time;
}
?>
<div class="prof_time_total"><?php _e('Total Time Executing Queries:'); ?> <?php echo $total_time_querying;?></div>
</div>
<?php
}
?>
Something went wrong with that request. Please try again.