Révision 0a5f6adf
Docker Plugin
Ignore containers in weird state.
| plugins/docker/docker_memory | ||
|---|---|---|
| 66 | 66 |
$name =~ s/[-\+*\/\.]/_/g; |
| 67 | 67 |
# truncate container name with "," character. |
| 68 | 68 |
$name =~ s/,.*//g; |
| 69 |
open(my $file, '<', "/sys/fs/cgroup/memory/docker/$id/memory.usage_in_bytes") or die "Unable to open file, $!"; |
|
| 70 |
my $memory_bytes = <$file>; |
|
| 71 |
$memory_bytes =~ s/\s+$//; |
|
| 72 |
push @result, {'name'=>$name, 'memory_bytes'=>$memory_bytes};
|
|
| 69 |
if (open(my $file, '<', "/sys/fs/cgroup/memory/docker/$id/memory.usage_in_bytes")) |
|
| 70 |
{
|
|
| 71 |
my $memory_bytes = <$file>; |
|
| 72 |
$memory_bytes =~ s/\s+$//; |
|
| 73 |
push @result, {'name'=>$name, 'memory_bytes'=>$memory_bytes};
|
|
| 74 |
} |
|
| 73 | 75 |
} |
| 74 | 76 |
|
| 75 | 77 |
if (defined $ARGV[0] and $ARGV[0] eq "config") |
Formats disponibles : Unified diff