summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6a3998d)
raw | patch | inline | side by side (parent: 6a3998d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Aug 2010 10:54:46 +0000 (10:54 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Aug 2010 10:54:46 +0000 (10:54 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19337 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_stats.inc | patch | blob | history |
index e2d64986c57e73df1ad188e36c3164687182138f..06cf3f85ae0f07707528ae173e728caa8270606a 100644 (file)
DURATION REAL,
AMOUNT INTEGER,
MEMORY_USAGE INTEGER,
- CPU_LOAD FLOAT
+ CPU_LOAD FLOAT,
+ INFO BLOB
)";
$ret = sqlite_query($query, $res);
}
- static function log($type, $plugin, $category, $action, $amount = 1, $duration = 0)
+ static function log($type, $plugin, $category, $action, $amount = 1, $duration = 0, $info ='')
{
global $config;
global $clicks;
$uuid = $config->getGOsaUUID();
$amount = sqlite_escape_string($amount);
$duration = sqlite_escape_string($duration);
+ $info = sqlite_escape_string($info);
$clicks = sqlite_escape_string($clicks);
$memory_usage = sqlite_escape_string(stats::get_memory_usage());
$cpu_load = sqlite_escape_string(stats::get_cpu_load());
$TABLE_NAME = 'stats';
$query = "
INSERT INTO {$TABLE_NAME}
- (ACTID, TYPE, PLUGIN, CATEGORY, ACTION, UUID, MTIMESTAMP, TIMESTAMP, AMOUNT, DURATION, MEMORY_USAGE, CPU_LOAD)
+ (ACTID, TYPE, PLUGIN, CATEGORY, ACTION, UUID, MTIMESTAMP, TIMESTAMP, AMOUNT, DURATION, MEMORY_USAGE, CPU_LOAD, INFO)
VALUES
('{$clicks}','{$type}','{$plugin}','{$category}','{$action}','{$uuid}',
- '{$mtimestamp}','{$timestamp}','{$amount}','{$duration}','{$memory_usage}','{$cpu_load}')";
+ '{$mtimestamp}','{$timestamp}','{$amount}','{$duration}','{$memory_usage}','{$cpu_load}','{$info}')";
sqlite_query($query, $res);
}
echo "------ \n";
$query = "
- SELECT SUM(DURATION) AS DUR, PLUGIN
+ SELECT SUM(DURATION) AS DUR, PLUGIN, UUID
FROM {$TABLE_NAME}
WHERE plugin != 'LDAP'
- GROUP BY PLUGIN
+ GROUP BY PLUGIN, UUID
ORDER BY DUR DESC LIMIT 10";
$ret = sqlite_query($query, $res);
echo "------ \n";
$query = "
- SELECT COUNT(ACTION) as CNT, ACTION, PLUGIN
+ SELECT COUNT(ACTION) as CNT, ACTION, PLUGIN, UUID
FROM {$TABLE_NAME}
WHERE TYPE = 'plugin'
AND PLUGIN != 'LDAP'
AND ACTION = 'open'
- GROUP BY ACTION,PLUGIN
+ GROUP BY ACTION,PLUGIN, UUID
ORDER BY CNT DESC LIMIT 5";
$ret = sqlite_query($query, $res);