change to use Virtual table for Poller Performance report

This commit is contained in:
Oliver Gorwits
2013-11-03 11:41:02 +00:00
parent 42e5568370
commit 4c2b0f93dc
3 changed files with 48 additions and 25 deletions

View File

@@ -13,26 +13,7 @@ register_admin_task({
});
ajax '/ajax/content/admin/performance' => require_role admin => sub {
my $set = schema('netdisco')->resultset('Admin')
->search({
action => { -in => [qw/discover macsuck arpnip/] },
}, {
columns => [
'action', 'entered',
{ entered_stamp => \"to_char(entered, 'YYYY-MM-DD HH24:MI:SS')" },
],
select => [
{ count => 'device', -as => 'number' },
{ min => 'started', -as => 'start' },
{ max => 'finished', -as => 'end' },
\"justify_interval(extract(epoch from (max(finished) - min(started))) * interval '1 second') AS elapsed",
],
as => [qw/ number start end elapsed /],
group_by => [qw/ action entered /],
having => \'count(device) > 1',
order_by => { -desc => [qw/ entered elapsed /] },
rows => 50,
});
my $set = schema('netdisco')->resultset('Virtual::PollerPerformance');
content_type('text/html');
template 'ajax/admintask/performance.tt', {