Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
show stats for all reports on page /recent
  • Loading branch information
FROGGS committed Nov 3, 2014
1 parent 7ed6c59 commit 476f600
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app.pl
Expand Up @@ -115,19 +115,19 @@
get '/recent' => sub {
my $sth = $dbh.prepare('SELECT id,grade,distname,distauth,distver,compver,backend,osname,osver,arch
FROM reports
ORDER BY id DESC
LIMIT 100');
ORDER BY id DESC');
$sth.execute;
my @reports;
my @osnames = <linux mswin32 darwin netbsd openbsd freebsd solaris>;
my %stats;
my int $i = 0;
while $sth.fetchrow_hashref -> $/ {
%stats{$<compver>}{$<osname>}{$<backend>}{$<grade>}++;
@osnames.push: $<osname> unless $<osname> ~~ any @osnames;

$<distver> = '0' if $<distver> eq '*';
$<breadcrumb> = '/recent';
@reports.push: recent-line($/)
@reports.push: recent-line($/) unless $i++ > 100;
}
for @osnames -> $osname {
for %stats.keys -> $compver is copy {
Expand Down

0 comments on commit 476f600

Please sign in to comment.