File Coverage

lib/Mojo/IOLoop/ReadWriteProcess/CGroup/v1/Freezer.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 3 0.0
total 14 17 82.3


line stmt bran cond sub pod time code
1             package Mojo::IOLoop::ReadWriteProcess::CGroup::v1::Freezer;
2              
3 15     15   103 use Mojo::Base -base;
  15         43  
  15         89  
4              
5             use constant {
6 15         3206 STATE_INTERFACE => 'freezer.state',
7             SELF_FREEZING_INTERFACE => 'freezer.self_freezing',
8             PARENT_FREEZING_INTERFACE => 'freezer.parent_freezing',
9 15     15   2812 };
  15         30  
10              
11             has cgroup => sub { Mojo::IOLoop::ReadWriteProcess::CGroup::v1->new };
12              
13 2     2 0 1746 sub state { shift->cgroup->_setget(STATE_INTERFACE, @_) }
14 1     1 0 200 sub self_freezing { shift->cgroup->_list(SELF_FREEZING_INTERFACE) }
15 1     1 0 223 sub parent_freezing { shift->cgroup->_list(PARENT_FREEZING_INTERFACE) }
16              
17             1;
18              
19             =encoding utf-8
20              
21             =head1 NAME
22              
23             Mojo::IOLoop::ReadWriteProcess::CGroup::v1::Freezer - CGroups v1 Freezer Controller.
24              
25             =head1 SYNOPSIS
26              
27             use Mojo::IOLoop::ReadWriteProcess::CGroup::v1;
28              
29             my $cgroup = Mojo::IOLoop::ReadWriteProcess::CGroup::v1->new( name => "test" );
30              
31             $cgroup->freezer->state('FROZEN');
32              
33             =head1 DESCRIPTION
34              
35             This module uses features that are only available on Linux,
36             and requires cgroups and capability for unshare syscalls to achieve pid isolation.
37              
38             =head1 METHODS
39              
40             L inherits all methods from L and implements
41             the following new ones.
42              
43             =head1 LICENSE
44              
45             Copyright (C) Ettore Di Giacinto.
46              
47             This library is free software; you can redistribute it and/or modify
48             it under the same terms as Perl itself.
49              
50             =head1 AUTHOR
51              
52             Ettore Di Giacinto Eedigiacinto@suse.comE
53              
54             =cut