line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tapper::Schema::TestrunDB::ResultSet::TestrunScheduling; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TAPPER'; |
3
|
|
|
|
|
|
|
$Tapper::Schema::TestrunDB::ResultSet::TestrunScheduling::VERSION = '5.0.11'; |
4
|
7
|
|
|
7
|
|
18117
|
use 5.010; |
|
7
|
|
|
|
|
24
|
|
5
|
7
|
|
|
7
|
|
32
|
use strict; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
144
|
|
6
|
7
|
|
|
7
|
|
32
|
use warnings; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
156
|
|
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
32
|
use parent 'DBIx::Class::ResultSet'; |
|
7
|
|
|
|
|
30
|
|
|
7
|
|
|
|
|
35
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub non_scheduled_jobs |
12
|
|
|
|
|
|
|
{ |
13
|
0
|
|
|
0
|
1
|
|
shift->search({ status => "schedule" }); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub max_priority_seq { |
18
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $job_with_max_seq = $self->result_source->schema->resultset('TestrunScheduling')->search |
21
|
|
|
|
|
|
|
( |
22
|
|
|
|
|
|
|
{ prioqueue_seq => { '>', 0 } }, |
23
|
|
|
|
|
|
|
{ |
24
|
|
|
|
|
|
|
select => [ { max => 'prioqueue_seq' } ], |
25
|
|
|
|
|
|
|
as => [ 'max_seq' ], |
26
|
|
|
|
|
|
|
rows => 1, |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
)->first; |
29
|
0
|
0
|
0
|
|
|
|
return $job_with_max_seq->get_column('max_seq') if $job_with_max_seq and $job_with_max_seq->get_column('max_seq'); |
30
|
0
|
|
|
|
|
|
return 0; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub running_jobs |
35
|
|
|
|
|
|
|
{ |
36
|
0
|
|
|
0
|
1
|
|
shift->search({ status => "running" }); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub running { |
41
|
0
|
|
|
0
|
1
|
|
shift->search({ status => 'running' }); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=pod |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=encoding UTF-8 |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 NAME |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Tapper::Schema::TestrunDB::ResultSet::TestrunScheduling |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 non_scheduled_jobs |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Return due testruns. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 max_priority_seq |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Search for queue with highhest C<max_seq>. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 running_jobs |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Return all currently running testruns. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 running |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Get all running jobs. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
@return __PACKAGE__ object |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 AUTHORS |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=over 4 |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
AMD OSRC Tapper Team <tapper@amd64.org> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item * |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Tapper Team <tapper-ops@amazon.com> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=back |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This software is Copyright (c) 2019 by Advanced Micro Devices, Inc.. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This is free software, licensed under: |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
The (two-clause) FreeBSD License |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |