blib/lib/App/Netdisco/DB/Result/Virtual/PollerPerformance.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 17 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package App::Netdisco::DB::Result::Virtual::PollerPerformance;
2  
3 use strict;
4 use warnings;
5  
6 use base 'DBIx::Class::Core';
7  
8 __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
9  
10 __PACKAGE__->table('poller_performance');
11 __PACKAGE__->result_source_instance->is_virtual(1);
12 __PACKAGE__->result_source_instance->view_definition(<<ENDSQL
13 SELECT action,
14 to_char( entered, 'YYYY-MM-DD HH24:MI:SS' ) AS entered_stamp,
15 COUNT( device ) AS number,
16 MIN( started ) AS start,
17 MAX( finished ) AS end,
18 justify_interval(
19 extract ( epoch FROM( max( finished ) - min( started ) ) )
20 * interval '1 second'
21 ) AS elapsed
22 FROM admin
23 WHERE action IN ( 'discover', 'macsuck', 'arpnip', 'nbtstat' )
24 GROUP BY action, to_char( entered, 'YYYY-MM-DD HH24:MI' ), entered
25 HAVING count( device ) > 1
26 AND SUM( CASE WHEN status = 'queued' THEN 1 ELSE 0 END ) = 0
27 ORDER BY entered_stamp DESC, elapsed DESC
28 LIMIT 30
29 ENDSQL
30 );
31  
32 __PACKAGE__->add_columns(
33 "action",
34 { data_type => "text", is_nullable => 1 },
35 "entered_stamp",
36 { data_type => "text", is_nullable => 1 },
37 "number",
38 { data_type => "integer", is_nullable => 1 },
39 "start",
40 { data_type => "timestamp", is_nullable => 1 },
41 "end",
42 { data_type => "timestamp", is_nullable => 1 },
43 "elapsed",
44 { data_type => "interval", is_nullable => 1 },
45 );
46  
47 1;