line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::IOLoop::ReadWriteProcess::CGroup::v2::CPU; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
93
|
use Mojo::Base -base; |
|
15
|
|
|
|
|
33
|
|
|
15
|
|
|
|
|
91
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use constant { |
6
|
15
|
|
|
|
|
4517
|
STAT_INTERFACE => 'cpu.stat', |
7
|
|
|
|
|
|
|
WEIGHT_INTERFACE => 'cpu.weight', |
8
|
|
|
|
|
|
|
WEIGHT_NICE_INTERFACE => 'cpu.weight.nice', |
9
|
|
|
|
|
|
|
MAX_INTERFACE => 'cpu.max', |
10
|
15
|
|
|
15
|
|
2894
|
}; |
|
15
|
|
|
|
|
31
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has cgroup => sub { Mojo::IOLoop::ReadWriteProcess::CGroup::v2->new }; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
0
|
190
|
sub stat { shift->cgroup->_list(STAT_INTERFACE) } |
15
|
2
|
|
|
2
|
0
|
1106
|
sub weight { shift->cgroup->_setget(WEIGHT_INTERFACE, @_) } |
16
|
2
|
|
|
2
|
0
|
1042
|
sub weight_nice { shift->cgroup->_setget(WEIGHT_NICE_INTERFACE, @_) } |
17
|
2
|
|
|
2
|
0
|
13
|
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 |