summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bece27b)
raw | patch | inline | side by side (parent: bece27b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Aug 2010 15:20:37 +0000 (15:20 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Aug 2010 15:20:37 +0000 (15:20 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19345 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_stats.inc | patch | blob | history |
index c8631ce2e0302cb3f93caf21c3d9525043868349..1629aeae674f3dcf7be0e95f6d2442de63c5c719 100644 (file)
static protected $lastHandle = NULL;
static protected $statsEnabled = FALSE;
+
+ static function prepareFloatForWriting($float){
+ return(floor($float * 1000));
+ }
+
+ static function prepareFloatForReading($int){
+ return($int / 1000);
+ }
+
static function getDatabaseHandle()
{
// Try to return last valid handle.
// Get database handle, if it is invalid (NULL) return without creating stats
$res = stats::getDatabaseHandle();
-# stats::dropTable($res);
+ stats::dropTable($res);
if(!$res) return;
// Ensure that 'clicks' and 'overallRenderTimer' are present and set correctly,
$overallRenderTimer = microtime(TRUE);
}
- // Enforce floating point values ...damn this sucks.
- $duration += 0.000001;
- $renderTime += 0.000001;
-
- $duration = sprintf("%0.6f",$duration);
- $renderTime = sprintf("%0.6f",$renderTime);
-
- $duration = preg_replace("/\./",",",$duration);
- $renderTime = preg_replace("/\./",",",$renderTime);
+ $duration = stats::prepareFloatForWriting($duration);
+ $renderTime = stats::prepareFloatForWriting($renderTime);
// Prepare values to be useable within a database
$uuid = $config->getGOsaUUID();
echo "------ \n";
$query = "
- SELECT PLUGIN, RENDER_TIME * 1000000 AS RM
+ SELECT PLUGIN, RENDER_TIME AS RM
FROM {$TABLE_NAME}
GROUP BY PLUGIN
";