Code

Updated dumpTable function
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 20 Aug 2010 06:51:31 +0000 (06:51 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 20 Aug 2010 06:51:31 +0000 (06:51 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19415 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_stats.inc

index 0a4c474a0b0ddc2299ba7bc4b3e83bc303fdac6e..b311baf0f454130e1e34c4240d10e040749ba01c 100644 (file)
@@ -287,9 +287,21 @@ class stats
         $handle = stats::getDatabaseHandle($filename);
         if(!$handle) return;        
 
+        $query = 
+            "  SELECT ".
+            "      TYPE, PLUGIN, CATEGORY, ACTION, ".
+            "      UUID, DATE(TIMESTAMP, 'unixepoch') as date, ".
+            "      AVG(DURATION), AVG(RENDER_TIME), SUM(AMOUNT), ".
+            "      AVG(MEMORY_USAGE), AVG(CPU_LOAD), INFO ".
+            "  FROM ".
+            "      stats ".
+            "  GROUP BY ".
+            "      TYPE, PLUGIN, CATEGORY, ACTION, UUID, date, INFO ".
+            "  ORDER BY ".
+            "      ID ";
+
         // Create Filter and start query
-        $filter = "SELECT * FROM {$TABLE_NAME} ORDER BY ID";
-        $ret = sqlite_array_query($filter, $handle, SQLITE_ASSOC);
+        $ret = sqlite_array_query($query, $handle, SQLITE_ASSOC);
         return($ret);
     }