my $filter = $self->get_client_group_filter();
+ my $jobt = $self->get_stat_table();
+
my ($limit, $label) = $self->get_limit(%$arg);
my ($where, undef) = $self->get_param('client_groups', 'level');
my $query = "
-SELECT client_group_name AS name, nb_byte, nb_file, nb_job, nb_resto
+SELECT client_group_name AS name, nb_byte, nb_file, nb_job, nb_err, nb_resto
FROM (
SELECT sum(JobBytes) AS nb_byte,
sum(JobFiles) AS nb_file,
count(1) AS nb_job, client_group_name
- FROM job_old JOIN client_group_member USING (ClientId)
+ FROM $jobt AS Job JOIN client_group_member USING (ClientId)
JOIN client_group USING (client_group_id) $filter
WHERE JobStatus = 'T' AND Type IN ('M', 'B', 'g')
$where $limit
) AS T1 LEFT JOIN (
+ SELECT count(1) AS nb_err, client_group_name
+ FROM $jobt AS Job JOIN client_group_member USING (ClientId)
+ JOIN client_group USING (client_group_id)
+ WHERE JobStatus IN ('E','e','f','A') AND Type = 'B'
+ $where $limit
+ GROUP BY client_group_name ORDER BY client_group_name
+
+ ) AS T3 USING (client_group_name) LEFT JOIN (
+
SELECT count(1) AS nb_resto, client_group_name
- FROM job_old JOIN client_group_member USING (ClientId)
+ FROM $jobt AS Job JOIN client_group_member USING (ClientId)
JOIN client_group USING (client_group_id)
WHERE JobStatus = 'T' AND Type = 'R'
$where $limit
</div>
<script type="text/javascript" language="JavaScript">
-var header = new Array("__Name__", "__Nb Jobs__", "__Nb Bytes__", "__Nb Bytes__", "__Nb Files__", "__Nb Resto__");
+var header = new Array("__Name__", "__Nb Jobs__", "__Nb Err__", "__Ok Rate__", , "__Nb Resto__",
+ "__Nb Bytes__", "__Nb Bytes__", "__Nb Files__");
var data = new Array();
<TMPL_LOOP stats>
+
+var nb_job=<TMPL_IF nb_job><TMPL_VAR nb_job><TMPL_ELSE>0</TMPL_IF>;
+var nb_err=<TMPL_IF nb_err><TMPL_VAR nb_err><TMPL_ELSE>0</TMPL_IF>;
+var t_ok = (nb_job - nb_err)/(nb_job + 0.0001);
+
data.push(
new Array( "<TMPL_VAR name>",
- "<TMPL_VAR nb_job>",
+ nb_job,
+ nb_err,
+ t_ok.toFixed(2),
+ "<TMPL_VAR nb_resto>",
human_size(<TMPL_VAR nb_byte>),
<TMPL_VAR nb_byte>,
- "<TMPL_VAR nb_file>",
- "<TMPL_VAR nb_resto>"
+ "<TMPL_VAR nb_file>"
)
) ;
</TMPL_LOOP>
</select>
</td>
</tr>
+<TMPL_IF db_client_groups>
+<tr>
+ <td valign='top'>
+ <h2>__Groups__</h2>
+ <select name='client_group' size='10' class='formulaire' multiple>
+<TMPL_LOOP db_client_groups>
+ <option id= 'group_<TMPL_VAR name>'><TMPL_VAR name></option>
+</TMPL_LOOP>
+ </select>
+ </td>
+</tr>
+</TMPL_IF>
<tr>
<td> <h2> __Type__ </h2>
<select name='graph' class='formulaire'>
document.getElementById('imggraph').src='bgraph.pl?<TMPL_VAR url>'
</TMPL_IF>
+ <TMPL_LOOP qclient_groups>
+ document.getElementById('group_' + <TMPL_VAR name>).selected = true;
+ </TMPL_LOOP>
</script>