Overview/Controller/API/Metrics/Workers.pm

filter: Statementstmt 28.5% 4 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 20.0% 1 / 5 Podpod 100% 2 / 2 totaltotal 33.3% 7 / 21 CC 1 SCAR 5.9
CC
1
Cov
29%
waittime
2.0
throughput
2.0
__ANON__
2.0
CRAP 1.8
« Overview/Controller/API/Metrics/Jobs.pm ↑ Summary Overview/Controller/Dashboard.pm »
1 package Mojolicious::Plugin::Minion::Overview::Controller::API::Metrics::Workers;
2 1 ▶use Mojo::Base 'Mojolicious::Controller';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 =head2 waittime
5  
6 Show waittime metrics for a worker
7  
8 =cut
9  
10 0 ▶sub waittime {
Subroutine waittime: not called CC=1 SCAR=6.9
Pod documented
11 0 my $self = shift;
12
13 0 my $waittime = $self->app->minion_overview
14 ->date($self->session('minion_overview_date'))
15 ->worker_waittime_metrics($self->param('worker'));
16  
17 0 return $self->render(json => $waittime);
18 }
19  
20 =head2 throughput
21  
22 Show throughput metrics for a worker
23  
24 =cut
25  
26 0 ▶sub throughput {
Subroutine throughput: not called CC=1 SCAR=6.9
Pod documented
27 0 my $self = shift;
28  
29 0 my $throughput = $self->app->minion_overview
30 ->date($self->session('minion_overview_date'))
31 ->worker_throughput_metrics($self->param('worker'));
32  
33 0 ▶ my $finished = $throughput->grep(sub { $_->{ state } eq 'finished' });
Subroutine __ANON__: not called CC=1 SCAR=6.9
34 0 ▶ my $failed = $throughput->grep(sub { $_->{ state } eq 'failed' });
Subroutine __ANON__: not called CC=1 SCAR=6.9
35  
36 0 return $self->render(json => {
37 finished => $finished,
38 failed => $failed,
39 });
40 }
41  
42 1 1;
« Overview/Controller/API/Metrics/Jobs.pm ↑ Summary Overview/Controller/Dashboard.pm »