Last active
December 12, 2015 03:39
-
-
Save d3zorg/4709026 to your computer and use it in GitHub Desktop.
simple mysql profiler with built-in mysql tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
mysql_query("set profiling_history_size=100"); | |
mysql_query("set profiling=1"); | |
# | |
# your queries here | |
# | |
$rs = mysql_query("show profiles"); | |
while($rd = mysql_fetch_object($rs)) | |
{ | |
echo $rd->Query_ID.' - '.round($rd->Duration,4) * 1000 .' ms - '.$rd->Query.'<br />'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment