summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e2dbfc)
raw | patch | inline | side by side (parent: 4e2dbfc)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 13 Aug 2010 15:40:02 +0000 (15:40 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 13 Aug 2010 15:40:02 +0000 (15:40 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19395 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/generic/statistics/class_statistics.inc | patch | blob | history |
diff --git a/gosa-core/plugins/generic/statistics/class_statistics.inc b/gosa-core/plugins/generic/statistics/class_statistics.inc
index a0a81ccdef20203c7f836e7d9bf6e69292e85a62..c3fa0645b21fc0785f1e287c9f1ba7e38e4b87e2 100644 (file)
// First try to retrieve values via RPC
if ($this->config->get_cfg_value("core","gosaRpcServer") != ""){
- $res = $this->rpcHandle->getInstanceStats();
+
+
+ $days = 40;
+ $interval = 1;
+ $start = time() - ($days*86400);
+ $stop = time();
+
+ $res = $this->rpcHandle->getInstanceStats($start,$stop,'day',$interval);
if(!$this->rpcHandle->success()){
msg_dialog::display(_("Error"),msgPool::rpcError($this->rpcHandle->get_error()),ERROR_DIALOG);
}
// --------
// Get most used categories, but only eight at once.
- arsort($res['category_count']);
- $mostUsedCategories = array_slice($res['category_count'],0,8);
+ arsort($res['actionsPerCategory']);
+ $mostUsedCategories = array_slice($res['actionsPerCategory'],0,8);
// Dataset definition
$DataSet = new pData;
$dates = array();
$max = 0;
- foreach($res['action_per_date'] as $id => $data){
+ foreach($res['actionsPerInterval'] as $id => $data){
$category = $data['category'];
$date = $data['date'];
$tmp[$category][$date] = $data['count'];
$dates[$date] = $date;
}
- $dMin = min($dates);
- $dMax = max($dates);
- for($i = $dMin; $i < $dMax; $i += (24*60*60)){
- if(!in_array($i,$dates)) $dates[$i] = $i;
- }
$dates = array_values($dates);
sort($dates);
foreach($tmp as $category => $data){
- reset($dates);
- foreach($dates as $date){
- if(!isset($tmp[$category][$date])){
- $tmp[$category][$date] = 0;
- }
- }
ksort($tmp[$category]);
-
$DataSet2->AddPoint($tmp[$category], $category);
$DataSet2->SetSerieName(_($category), $category);
}
-
$DataSet2->AddAllSeries();
$tmp = array();
$Test2->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the cubic curve graph
-# $Test2->drawBarGraph($DataSet2->GetData(),$DataSet2->GetDataDescription(),TRUE);
-# $Test2->drawLineGraph($DataSet2->GetData(),$DataSet2->GetDataDescription(),TRUE);
+ #$Test2->drawBarGraph($DataSet2->GetData(),$DataSet2->GetDataDescription(),TRUE);
+ #$Test2->drawLineGraph($DataSet2->GetData(),$DataSet2->GetDataDescription(),TRUE);
$Test2->drawFilledLineGraph($DataSet2->GetData(),$DataSet2->GetDataDescription(),50,TRUE);
// Finish the graph