summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fe52ec4)
raw | patch | inline | side by side (parent: fe52ec4)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Aug 2010 11:21:23 +0000 (11:21 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Aug 2010 11:21:23 +0000 (11:21 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19340 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/html/main.php | patch | blob | history | |
gosa-core/include/class_stats.inc | patch | blob | history |
index 4be9b39448dfff8d771305364060a6d84500d7bc..fe82c2cfedd14f17cebfa129531012397df514ad 100644 (file)
--- a/gosa-core/html/main.php
+++ b/gosa-core/html/main.php
/* Save start time */
$start = microtime();
+// Will be used in the "stats" plugin later, to be able calculate the elapsed render time.
+$overallRenderTimer = microtime(TRUE);
+
/* Basic setup, remove eventually registered sessions */
require_once ("../include/php_setup.inc");
require_once ("functions.inc");
index a043c4dc0a57365b377dcdb806aeb3c5af8126ab..dc2f00b3ab03b628c1a756909dee1ba775886082 100644 (file)
TIMESTAMP INTEGER,
MTIMESTAMP REAL,
DURATION REAL,
+ RENDER_TIME REAL,
AMOUNT INTEGER,
MEMORY_USAGE INTEGER,
CPU_LOAD FLOAT,
{
global $config;
global $clicks;
+ global $overallRenderTimer;
+
+ if(!isset($overallRenderTimer) || empty($overallRenderTimer)){
+ $renderTime = 0;
+ }else{
+ $renderTime = microtime(TRUE) - $overallRenderTimer;
+
+ // Now set the overallRenderTimer to the current timestamp - else
+ // we will not be able to sum up the render time in a single SQL statement.
+ $overallRenderTimer = microtime(TRUE);
+
+ }
+
$type = sqlite_escape_string($type);
$plugin = sqlite_escape_string($plugin);
$action = sqlite_escape_string($action);
$uuid = $config->getGOsaUUID();
$amount = sqlite_escape_string($amount);
$duration = sqlite_escape_string($duration);
+ $renderTime = sqlite_escape_string($renderTime);
$info = sqlite_escape_string($info);
$clicks = sqlite_escape_string($clicks);
$memory_usage = sqlite_escape_string(stats::get_memory_usage());
$TABLE_NAME = 'stats';
$query = "
INSERT INTO {$TABLE_NAME}
- (ACTID, TYPE, PLUGIN, CATEGORY, ACTION, UUID, MTIMESTAMP, TIMESTAMP, AMOUNT, DURATION, MEMORY_USAGE, CPU_LOAD, INFO)
+ (ACTID, TYPE, PLUGIN, CATEGORY, ACTION, UUID, MTIMESTAMP, TIMESTAMP,
+ AMOUNT, DURATION, RENDER_TIME, MEMORY_USAGE, CPU_LOAD, INFO)
VALUES
('{$clicks}','{$type}','{$plugin}','{$category}','{$action}','{$uuid}',
- '{$mtimestamp}','{$timestamp}','{$amount}','{$duration}','{$memory_usage}','{$cpu_load}','{$info}')";
+ '{$mtimestamp}','{$timestamp}','{$amount}','{$duration}','{$renderTime}',
+ '{$memory_usage}','{$cpu_load}','{$info}')";
sqlite_query($query, $res);
}