swapus 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/swapus.rb +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd627060d211deac61186300e2e4c7f4aaf31438
|
4
|
+
data.tar.gz: da688dab64de2919e83c83a2adae75bd3b41a00e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7d6c15dd7ae7f385ac1eb53cd633b3755fed21827b14ca11335f39692c43b85697790120b9ea99c371fbe3026bcb49be17cacb18cfbe9e07cede5e6d1a06779
|
7
|
+
data.tar.gz: 68e9dffe909cc20d9f055e1e6dc07b9ceba26bb704e24ac214a6c0c63c9e5895d5832a1b579f8dfcee1c564d5fc7c9554fb54d63a01ac20f9c4ff9512afd9b2c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Swapus
|
2
|
-
[![Version](https://img.shields.io/badge/latest_version-1.1.
|
2
|
+
[![Version](https://img.shields.io/badge/latest_version-1.1.1-green.svg)](https://github.com/nishiki/swapus/releases)
|
3
3
|
[![Build Status](https://travis-ci.org/nishiki/swapus.svg?branch=master)](https://travis-ci.org/nishiki/swapus)
|
4
4
|
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/nishiki/swapus/blob/master/LICENSE)
|
5
5
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
data/lib/swapus.rb
CHANGED
@@ -25,11 +25,15 @@ class SwapUsage
|
|
25
25
|
|
26
26
|
def get_processes
|
27
27
|
Dir['/proc/[0-9]*'].map do |pid_dir|
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
begin
|
29
|
+
pid = File.basename(pid_dir).to_i
|
30
|
+
cmd = File.read("#{pid_dir}/cmdline").tr("\x00", ' ').strip
|
31
|
+
swap = File.read("#{pid_dir}/status")[/^VmSwap:\s+([0-9]+)\s+kB$/, 1].to_i
|
31
32
|
|
32
|
-
|
33
|
+
@processes[pid] = { cmd: cmd, swap: swap } if swap.positive?
|
34
|
+
rescue Errno::ENOENT
|
35
|
+
next
|
36
|
+
end
|
33
37
|
end
|
34
38
|
end
|
35
39
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swapus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrien Waksberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|