summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3aae842)
raw | patch | inline | side by side (parent: 3aae842)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 3 Aug 2010 08:37:47 +0000 (08:37 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 3 Aug 2010 08:37:47 +0000 (08:37 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19350 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_stats.inc | patch | blob | history |
index 09f9f9726330a35264fe659d50d90a632ea4a3bc..3f9a9d2c28554d54be3152c824928001125bfe0f 100644 (file)
'{$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} LIMIT 10";
+ $ret = sqlite_array_query($filter, $handle, SQLITE_ASSOC);
+ return($ret);
+ }
+
/*! \brief |
* @param |
*/
static function show()
{
+
+ stats::dumpTables();
+
+ return;
+
$res = stats::getDatabaseHandle();
# stats::dropTable($res);
if(!$res) return;