query("delete from hlstats_sql_web_profile");
$db->query("delete from hlstats_sql_daemon_profile");
die("Stats reset.");
}
print("
Web performance
");
print("top queries by # of times run
origin | count | total time | avg time |
");
$result = $db->query("select *, (run_time/run_count) as avg_rt from hlstats_sql_web_profile order by run_count desc limit 20");
while ($rowdata = $db->fetch_array($result)) {
print("$rowdata[source] | $rowdata[run_count] | $rowdata[run_time] | $rowdata[avg_rt] |
");
}
print("
");
print("top queries by total time taken
origin | count | total time | avg time |
");
$result = $db->query("select *, (run_time/run_count) as avg_rt from hlstats_sql_web_profile order by run_time desc limit 20");
while ($rowdata = $db->fetch_array($result)) {
print("$rowdata[source] | $rowdata[run_count] | $rowdata[run_time] | $rowdata[avg_rt] |
");
}
print("
");
print("top queries by avg runtime
origin | count | total time | avg time |
");
$result = $db->query("select *, (run_time/run_count) as avg_rt from hlstats_sql_web_profile order by avg_rt desc limit 20");
while ($rowdata = $db->fetch_array($result)) {
print("$rowdata[source] | $rowdata[run_count] | $rowdata[run_time] | $rowdata[avg_rt] |
");
}
print("
");
print("
");
print("Daemon performance
");
print("top queries by # of times run
origin | count | total time | avg time |
");
$result = $db->query("select *, (run_time/run_count) as avg_rt from hlstats_sql_daemon_profile order by run_count desc limit 20");
while ($rowdata = $db->fetch_array($result)) {
print("$rowdata[source] | $rowdata[run_count] | $rowdata[run_time] | $rowdata[avg_rt] |
");
}
print("
");
print("top queries by total time taken
origin | count | total time | avg time |
");
$result = $db->query("select *, (run_time/run_count) as avg_rt from hlstats_sql_daemon_profile order by run_time desc limit 20");
while ($rowdata = $db->fetch_array($result)) {
print("$rowdata[source] | $rowdata[run_count] | $rowdata[run_time] | $rowdata[avg_rt] |
");
}
print("
");
print("top queries by avg runtime
origin | count | total time | avg time |
");
$result = $db->query("select *, (run_time/run_count) as avg_rt from hlstats_sql_daemon_profile order by avg_rt desc limit 20");
while ($rowdata = $db->fetch_array($result)) {
print("$rowdata[source] | $rowdata[run_count] | $rowdata[run_time] | $rowdata[avg_rt] |
");
}
print("
");
?>