index 2ae68eaf85fe6173773247dcb06e556555a1bdaf..c9b7dd80f08fa379c1cbe4ec947a1665e7d65d6e 100644 (file)
'{$memory_usage}','{$cpu_load}','{$info}')";
sqlite_query($query, $res);
}
'{$memory_usage}','{$cpu_load}','{$info}')";
sqlite_query($query, $res);
}
-
+
+
+ /*! \brief |
+ * @param |
+ * @return |
+ */
+ static function dumpTables($from = NULL, $to = NULL)
+ {
+ // Get database connection
+ $TABLE_NAME = stats::$tableName;
+ $handle = stats::getDatabaseHandle();
+ if(!$handle) return;
+
+ // Build up filter to limit dumped entries to the given range.
+ $tim = "";
+ if($from != NULL){
+ $from = sqlite_escape_string($from);
+ $tim.= "AND TIMESTAMP >= '{$from}' ";
+ }
+ if($to != NULL){
+ $to = sqlite_escape_string($to);
+ $tim.= "AND TIMESTAMP <= '{$to}' ";
+ }
+ $tim = preg_replace("/^AND /"," WHERE ",$tim);
+
+ // Create Filter and start query
+ $filter = "SELECT * FROM {$TABLE_NAME}{$tim}";
+ $ret = sqlite_array_query($filter, $handle, SQLITE_ASSOC);
+ return($ret);
+ }
+
/*! \brief |
* @param |
/*! \brief |
* @param |
*/
static function show()
{
*/
static function show()
{
+
+ stats::dumpTables();
+
+ return;
+
$res = stats::getDatabaseHandle();
# stats::dropTable($res);
if(!$res) return;
$res = stats::getDatabaseHandle();
# stats::dropTable($res);
if(!$res) return;
SELECT PLUGIN, RENDER_TIME AS RM
FROM {$TABLE_NAME}
GROUP BY PLUGIN
SELECT PLUGIN, RENDER_TIME AS RM
FROM {$TABLE_NAME}
GROUP BY PLUGIN
+ ORDER BY RM DESC
+ LIMIT 10
";
$ret = sqlite_query($query, $res);
";
$ret = sqlite_query($query, $res);