fileset => $arg->{fileset},
where => $arg->{where},
regexwhere => $arg->{regexwhere},
- replace => $arg->{replace},
+# replace => $arg->{replace},
priority => $arg->{priority},
bootstrap => $filename);
)");
} else { # postgresql have distinct with more than one criteria...
$bvfs->dbh_do("CREATE TABLE b2$$ AS (
-SELECT DISTINCT ON (PathId, FilenameId) JobId, FileIndex
- FROM btemp
- ORDER BY PathId, FilenameId, JobId DESC
- HAVING FileIndex > 0
+SELECT JobId, FileIndex
+FROM (
+ SELECT DISTINCT ON (PathId, FilenameId) JobId, FileIndex
+ FROM btemp
+ ORDER BY PathId, FilenameId, JobId DESC
+ ) AS T
+ WHERE FileIndex > 0
)");
}
age => $arg->{age});
}
}
+} elsif ($action eq 'group_stats') {
+ $bweb->display_group_stats();
} elsif ($action eq 'group_stats') {
$bweb->display_group_stats(age => $arg->{age});
<ul>
<li><a href="bweb.pl?action=graph"> Statistics </a>
<li><a href="btime.pl"> Backup Timing </a>
+ <li><a href="bweb.pl?action=group_stats"> Groups </a>
<!-- <li><a href="bperf.pl"> Perfs </a> -->
</ul>
</li>
--- /dev/null
+<br/>
+ <div class='titlediv'>
+ <h1 class='newstitle'> Statistics (<TMPL_VAR label>)</h1>
+ </div>
+ <div class='bodydiv'>
+<form action='?'>
+ <table id='id<TMPL_VAR ID>'></table>
+</form>
+ </div>
+
+<script type="text/javascript" language="JavaScript">
+var header = new Array("Name", "Nb Jobs", "Nb Bytes", "Nb Bytes", "Nb Files", "Nb Resto");
+
+var data = new Array();
+
+<TMPL_LOOP stats>
+data.push(
+ new Array( "<TMPL_VAR name>",
+ "<TMPL_VAR nb_job>",
+ human_size(<TMPL_VAR nb_byte>),
+ <TMPL_VAR nb_byte>,
+ "<TMPL_VAR nb_file>",
+ "<TMPL_VAR nb_resto>"
+ )
+) ;
+</TMPL_LOOP>
+nrsTable.setup(
+{
+ table_name: "id<TMPL_VAR ID>",
+ table_header: header,
+ table_data: data,
+ up_icon: up_icon,
+ down_icon: down_icon,
+ prev_icon: prev_icon,
+ next_icon: next_icon,
+ rew_icon: rew_icon,
+ fwd_icon: fwd_icon,
+// natural_compare: false,
+ even_cell_color: even_cell_color,
+ odd_cell_color: odd_cell_color,
+ header_color: header_color,
+ page_nav: true,
+// disable_sorting: new Array(1),
+ rows_per_page: rows_per_page
+}
+);
+</script>
<li><a href="bweb.pl?action=job_group">Jobs by group</a>
<li><a href="bweb.pl?action=overview">Jobs overview</a>
<li><a href="bweb.pl?action=missing">Missing Jobs</a>
- <li><a href="bweb.pl?action=job">Últimos Jobs</a> </li>
- <li><a href="bweb.pl?action=running">Jobs en Ejecución</a>
- <li><a href="bweb.pl?action=next_job">Próximos Jobs</a> </li>
- <li><a href="bweb.pl?action=restore" title="Launch brestore">Recuperación</a> </li>
+ <li><a href="bweb.pl?action=job">Últimos Jobs</a> </li>
+ <li><a href="bweb.pl?action=running">Jobs en Ejecución</a>
+ <li><a href="bweb.pl?action=next_job">Próximos Jobs</a> </li>
+ <li><a href="bweb.pl?action=restore" title="Launch brestore">Recuperación</a> </li>
<li><a href="/bweb/bresto.html" title="Try bresto">Web Restore</a> </li>
</ul>
</li>
</TMPL_LOOP>
</ul>
</li>
- <li><a href="bweb.pl?action=graph"> Estadísticas </a>
+ <li><a href="bweb.pl?action=graph"> Estadísticas </a>
<ul>
- <li><a href="bweb.pl?action=graph"> Estadísticas </a>
+ <li><a href="bweb.pl?action=graph"> Estadísticas </a>
<li><a href="btime.pl"> Backup Timing </a>
+ <li><a href="bweb.pl?action=group_stats"> Groupes </a>
<!-- <li><a href="bperf.pl"> Perfs </a> -->
</ul>
</li>
- <li> <a href="bweb.pl?action=view_conf"> Configuración </a>
+ <li> <a href="bweb.pl?action=view_conf"> Configuración </a>
<TMPL_IF enable_security>
- <ul> <li> <a href="bweb.pl?action=view_conf"> Configuración </a>
+ <ul> <li> <a href="bweb.pl?action=view_conf"> Configuración </a>
<li> <a href="bweb.pl?action=users"> Manage users </a>
</ul>
</TMPL_IF>
--- /dev/null
+<br/>
+ <div class='titlediv'>
+ <h1 class='newstitle'> Estadísticas (<TMPL_VAR label>)</h1>
+ </div>
+ <div class='bodydiv'>
+<form action='?'>
+ <table id='id<TMPL_VAR ID>'></table>
+</form>
+ </div>
+
+<script type="text/javascript" language="JavaScript">
+var header = new Array("Nombre", "Nb Jobs", "Nb Bytes", "Nb Bytes", "Nb Files", "Nb Resto");
+
+var data = new Array();
+
+<TMPL_LOOP stats>
+data.push(
+ new Array( "<TMPL_VAR name>",
+ "<TMPL_VAR nb_job>",
+ human_size(<TMPL_VAR nb_byte>),
+ <TMPL_VAR nb_byte>,
+ "<TMPL_VAR nb_file>",
+ "<TMPL_VAR nb_resto>"
+ )
+) ;
+</TMPL_LOOP>
+nrsTable.setup(
+{
+ table_name: "id<TMPL_VAR ID>",
+ table_header: header,
+ table_data: data,
+ up_icon: up_icon,
+ down_icon: down_icon,
+ prev_icon: prev_icon,
+ next_icon: next_icon,
+ rew_icon: rew_icon,
+ fwd_icon: fwd_icon,
+// natural_compare: false,
+ even_cell_color: even_cell_color,
+ odd_cell_color: odd_cell_color,
+ header_color: header_color,
+ page_nav: true,
+// disable_sorting: new Array(1),
+ rows_per_page: rows_per_page
+}
+);
+</script>
<script type="text/javascript" language="JavaScript">
if (navigator.appName == 'Konqueror') {
- alert("Désolé, bweb fonctionne seulement avec mozilla.");
+ alert("Désolé, bweb fonctionne seulement avec mozilla.");
}
if ('Accueil' == ('_' + '_Main_' + '_')) {
document.write("<font color='red'>Update your configuration to use the correct tpl directory (You are using devel tpl)</font>");
</li>
<li style="padding: 0.25em 2em;">Jobs
<ul>
- <li><a href="bweb.pl?action=run_job">Jobs définis</a>
+ <li><a href="bweb.pl?action=run_job">Jobs définis</a>
<li><a href="bweb.pl?action=job_group">Jobs par groupe</a>
<li><a href="bweb.pl?action=overview">Jobs overview</a>
- <li><a href="bweb.pl?action=missing">Missing Jobs</a>
+ <li><a href="bweb.pl?action=missing">Jobs absents</a>
<li><a href="bweb.pl?action=job">Historique</a> </li>
<li><a href="bweb.pl?action=running">Jobs en cours</a>
<li><a href="bweb.pl?action=next_job">Prochains jobs</a> </li>
<li><a href="/bweb/bresto.html" title="Try bresto">Web Restore</a> </li>
</ul>
</li>
- <li style="padding: 0.25em 2em;">Médias
+ <li style="padding: 0.25em 2em;">Médias
<ul>
- <li><a href="bweb.pl?action=pool">Pools de média</a> </li>
+ <li><a href="bweb.pl?action=pool">Pools de média</a> </li>
<li><a href="bweb.pl?action=location">Localisations</a> </li>
<li><a href="bweb.pl?action=media">Tous les Medias</a><hr></li>
<li><a href="bweb.pl?action=add_media">Ajouter des Medias</a><hr></li>
<ul>
<li><a href="bweb.pl?action=graph"> Statistiques </a>
<li><a href="btime.pl"> Backup Timing </a>
+ <li><a href="bweb.pl?action=group_stats"> Groupes </a>
<!-- <li><a href="bperf.pl"> Perfs </a> -->
</ul>
</li>
--- /dev/null
+<br/>
+ <div class='titlediv'>
+ <h1 class='newstitle'> Statistiques (<TMPL_VAR label>)</h1>
+ </div>
+ <div class='bodydiv'>
+<form action='?'>
+ <table id='id<TMPL_VAR ID>'></table>
+</form>
+ </div>
+
+<script type="text/javascript" language="JavaScript">
+var header = new Array("Nom", "Nb Jobs", "Nb Bytes", "Nb Bytes", "Nb Fichiers", "Nb Resto");
+
+var data = new Array();
+
+<TMPL_LOOP stats>
+data.push(
+ new Array( "<TMPL_VAR name>",
+ "<TMPL_VAR nb_job>",
+ human_size(<TMPL_VAR nb_byte>),
+ <TMPL_VAR nb_byte>,
+ "<TMPL_VAR nb_file>",
+ "<TMPL_VAR nb_resto>"
+ )
+) ;
+</TMPL_LOOP>
+nrsTable.setup(
+{
+ table_name: "id<TMPL_VAR ID>",
+ table_header: header,
+ table_data: data,
+ up_icon: up_icon,
+ down_icon: down_icon,
+ prev_icon: prev_icon,
+ next_icon: next_icon,
+ rew_icon: rew_icon,
+ fwd_icon: fwd_icon,
+// natural_compare: false,
+ even_cell_color: even_cell_color,
+ odd_cell_color: odd_cell_color,
+ header_color: header_color,
+ page_nav: true,
+// disable_sorting: new Array(1),
+ rows_per_page: rows_per_page
+}
+);
+</script>
}
-sub display_group_stats
+sub _display_group_stats
{
my ($self, %arg) = @_ ;
"running_job.tpl") ;
}
+sub display_group_stats
+{
+ my ($self) = @_;
+ my $arg = $self->get_form('age', 'since');
+ return if $self->cant_do('r_view_stat');
+ my $filter = $self->get_client_group_filter();
+
+ my ($limit, $label) = $self->get_limit(%$arg);
+
+ my $query = "
+SELECT client_group_name AS name, nb_byte, nb_file, nb_job, 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)
+ JOIN client_group USING (client_group_id) $filter
+ WHERE JobStatus = 'T' AND Type IN ('M', 'B', 'g')
+ $limit
+ GROUP BY client_group_name ORDER BY client_group_name
+
+ ) AS T1 LEFT JOIN (
+
+ SELECT count(1) AS nb_resto, client_group_name
+ FROM job_old JOIN client_group_member USING (ClientId)
+ JOIN client_group USING (client_group_id)
+ WHERE JobStatus = 'T' AND Type = 'R'
+ $limit
+ GROUP BY client_group_name ORDER BY client_group_name
+
+ ) AS T2 USING (client_group_name)
+";
+ $self->debug($query);
+ my $all = $self->dbh_selectall_hashref($query, 'name') ;
+ $self->debug($all);
+
+ $self->display({ ID => $cur_id++,
+ label => $label,
+ Stats => [ values %$all ]},
+ "display_stats.tpl") ;
+}
+
# return the autochanger list to update
sub eject_media
{
+02Apr08
+ebl Add group statistics page
+
10Mar08
ebl Use lineal regression to guess backup progress (postgresql)
<ul>
<li><a href="bweb.pl?action=graph"> __Statistics__ </a>
<li><a href="btime.pl"> __Backup Timing__ </a>
+ <li><a href="bweb.pl?action=group_stats"> __Groups__ </a>
<!-- <li><a href="bperf.pl"> __Perfs__ </a> -->
</ul>
</li>
--- /dev/null
+<br/>
+ <div class='titlediv'>
+ <h1 class='newstitle'> __Statistics__ (<TMPL_VAR label>)</h1>
+ </div>
+ <div class='bodydiv'>
+<form action='?'>
+ <table id='id<TMPL_VAR ID>'></table>
+</form>
+ </div>
+
+<script type="text/javascript" language="JavaScript">
+var header = new Array("__Name__", "__Nb Jobs__", "__Nb Bytes__", "__Nb Bytes__", "__Nb Files__", "__Nb Resto__");
+
+var data = new Array();
+
+<TMPL_LOOP stats>
+data.push(
+ new Array( "<TMPL_VAR name>",
+ "<TMPL_VAR nb_job>",
+ human_size(<TMPL_VAR nb_byte>),
+ <TMPL_VAR nb_byte>,
+ "<TMPL_VAR nb_file>",
+ "<TMPL_VAR nb_resto>"
+ )
+) ;
+</TMPL_LOOP>
+nrsTable.setup(
+{
+ table_name: "id<TMPL_VAR ID>",
+ table_header: header,
+ table_data: data,
+ up_icon: up_icon,
+ down_icon: down_icon,
+ prev_icon: prev_icon,
+ next_icon: next_icon,
+ rew_icon: rew_icon,
+ fwd_icon: fwd_icon,
+// natural_compare: false,
+ even_cell_color: even_cell_color,
+ odd_cell_color: odd_cell_color,
+ header_color: header_color,
+ page_nav: true,
+// disable_sorting: new Array(1),
+ rows_per_page: rows_per_page
+}
+);
+</script>