19 define(
"TITLE_DASHBOARD_STATISTICS", _(
"Statistics Dashboard"));
30 function __construct()
32 $this->Name =
"dashboard-statistics";
33 $this->Title = TITLE_DASHBOARD_STATISTICS;
34 $this->MenuList =
"Admin::Dashboards::Statistics";
36 parent::__construct();
37 $this->
dbManager = $GLOBALS[
'container']->get(
'db.manager');
45 $query =
"SELECT ag.agent_name,ag.agent_desc,count(jq.*) AS fired_jobs ";
46 $query.=
"FROM agent ag LEFT OUTER JOIN jobqueue jq ON (jq.jq_type = ag.agent_name) ";
47 $query.=
"GROUP BY ag.agent_name,ag.agent_desc ORDER BY fired_jobs DESC;";
49 $rows = $this->
dbManager->getRows($query);
51 $V =
"<table border=1>";
52 $V .=
"<tr><th>".(
"AgentName").
"</th><th>"._(
"Description").
"</th><th>"._(
"Number of jobs").
"</th></tr>";
54 foreach ($rows as $agData) {
55 $V .=
"<tr><td>".$agData[
'agent_name'].
"</td><td>".$agData[
'agent_desc'].
"</td><td align='right'>".$agData[
'fired_jobs'].
"</td></tr>";
63 public function Output()
65 $V =
"<h1> Statistics </h1>";
66 $V .=
"<table style='width: 100%;' border=0>\n";
69 $V .=
"<td class='dashboard'>";
70 $text = _(
"Jobs Sumary");
71 $V .=
"<h2>$text</h2>\n";
#define PLUGIN_DB_ADMIN
Plugin requires admin level permission on DB.
CountAllJobs()
Lists number of ever quequed jobs per job type (agent)..
fo_dbManager * dbManager
fo_dbManager object
This is the Plugin class. All plugins should: