line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::IOLoop::ReadWriteProcess::CGroup::v2::CPU; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
103
|
use Mojo::Base -base; |
|
15
|
|
|
|
|
29
|
|
|
15
|
|
|
|
|
81
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use constant { |
6
|
15
|
|
|
|
|
4606
|
STAT_INTERFACE => 'cpu.stat', |
7
|
|
|
|
|
|
|
WEIGHT_INTERFACE => 'cpu.weight', |
8
|
|
|
|
|
|
|
WEIGHT_NICE_INTERFACE => 'cpu.weight.nice', |
9
|
|
|
|
|
|
|
MAX_INTERFACE => 'cpu.max', |
10
|
15
|
|
|
15
|
|
2510
|
}; |
|
15
|
|
|
|
|
42
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has cgroup => sub { Mojo::IOLoop::ReadWriteProcess::CGroup::v2->new }; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
0
|
178
|
sub stat { shift->cgroup->_list(STAT_INTERFACE) } |
15
|
2
|
|
|
2
|
0
|
942
|
sub weight { shift->cgroup->_setget(WEIGHT_INTERFACE, @_) } |
16
|
2
|
|
|
2
|
0
|
1336
|
sub weight_nice { shift->cgroup->_setget(WEIGHT_NICE_INTERFACE, @_) } |
17
|
2
|
|
|
2
|
0
|
11
|
sub max { shift->cgroup->_setget(MAX_INTERFACE, @_) } |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=encoding utf-8 |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Mojo::IOLoop::ReadWriteProcess::CGroup::v2::CPU - CGroups v2 CPU Controller |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SYNOPSIS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
use Mojo::IOLoop::ReadWriteProcess::CGroup::v2; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $cgroup = Mojo::IOLoop::ReadWriteProcess::CGroup::v2->new( name => "test" ); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
$cgroup->cpu->stat; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 DESCRIPTION |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
This module uses features that are only available on Linux kernels. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 METHODS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
L inherits all methods from L and implements |
42
|
|
|
|
|
|
|
the following new ones. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 LICENSE |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Copyright (C) Ettore Di Giacinto. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
49
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 AUTHOR |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Ettore Di Giacinto Eedigiacinto@suse.comE |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |