Changeset 1443


Ignore:
Timestamp:
10/31/15 16:01:52 (9 years ago)
Author:
nanardon
Message:

Use realtime statistics

Location:
trunk/LATMOS-Accounts-Web
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Json/Stat.pm

    r1441 r1443  
    22use Moose; 
    33use namespace::autoclean; 
     4use POSIX; 
    45 
    56BEGIN { extends 'Catalyst::Controller'; } 
     
    2930    my $ostat = $base->get_object('stat', $statname) or return; 
    3031 
    31     my $res = $ostat->getStat or return; 
     32    my $res = $ostat->compute or return; 
    3233 
    3334    $c->stash->{data} = [ map { [ $_, $res->{$_} +0 ] } sort { $res->{$b} <=> $res->{$a} } keys %$res ]; 
     
    4243 
    4344    my $data = $ostat->getAllStat or return; 
    44     my $res = $ostat->getStat or return; 
     45 
     46    my $res = $ostat->compute or return; 
    4547 
    4648    my $graph = { 
     
    5658            push(@{ $lines{$val} }, [ $date, $data->{$date}{$val} + 0 ]); 
    5759        } 
     60    } 
     61 
     62    my $date = POSIX::strftime('%Y-%m-%d', localtime); 
     63    foreach my $val (sort keys %$res) { 
     64        push(@{ $lines{$val} }, [ $date , $res->{$val} + 0 ]); 
    5865    } 
    5966 
  • trunk/LATMOS-Accounts-Web/root/html/stat/index.tt

    r1442 r1443  
    106106                cursor:{ 
    107107                    zoom:true, 
     108                    tooltipLocation:'sw', 
    108109                    looseZoom: true 
    109110                }, 
Note: See TracChangeset for help on using the changeset viewer.