linux_stat 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +227 -46
- data/bin/linuxstat.rb +3 -1
- data/ext/fs_stat/extconf.rb +7 -0
- data/ext/fs_stat/fs_stat.c +31 -0
- data/ext/sysconf/extconf.rb +7 -0
- data/ext/sysconf/sysconf.c +53 -0
- data/ext/utsname/extconf.rb +7 -0
- data/ext/utsname/utsname.c +49 -0
- data/lib/linux_stat.rb +11 -5
- data/lib/linux_stat/battery.rb +2 -2
- data/lib/linux_stat/bios.rb +10 -6
- data/lib/linux_stat/cpu.rb +31 -6
- data/lib/linux_stat/filesystem.rb +92 -0
- data/lib/linux_stat/kernel.rb +17 -6
- data/lib/linux_stat/memory.rb +8 -2
- data/lib/linux_stat/mounts.rb +64 -0
- data/lib/linux_stat/os.rb +27 -8
- data/lib/linux_stat/process_info.rb +310 -0
- data/lib/linux_stat/swap.rb +6 -1
- data/lib/linux_stat/version.rb +1 -1
- metadata +16 -5
- data/Gemfile +0 -5
data/lib/linux_stat/swap.rb
CHANGED
@@ -21,6 +21,7 @@ module LinuxStat
|
|
21
21
|
|
22
22
|
# Show aggregated used and available swap.
|
23
23
|
# The values are in kilobytes.
|
24
|
+
#
|
24
25
|
# The return type is Hash.
|
25
26
|
# If the info isn't available, the return type is an empty Hash.
|
26
27
|
def stat
|
@@ -44,6 +45,7 @@ module LinuxStat
|
|
44
45
|
|
45
46
|
# Show total amount of swap.
|
46
47
|
# The value is in kilobytes.
|
48
|
+
#
|
47
49
|
# The return type is a Integer but if the info isn't available, it will return nil.
|
48
50
|
def total
|
49
51
|
return nil unless swaps_readable?
|
@@ -52,6 +54,7 @@ module LinuxStat
|
|
52
54
|
|
53
55
|
# Show total amount of available swap.
|
54
56
|
# The value is in kilobytes.
|
57
|
+
#
|
55
58
|
# The return type is a Integer but if the info isn't available, it will return nil.
|
56
59
|
def available
|
57
60
|
return nil unless swaps_readable?
|
@@ -61,6 +64,7 @@ module LinuxStat
|
|
61
64
|
|
62
65
|
# Show total amount of used swap.
|
63
66
|
# The value is in kilobytes.
|
67
|
+
#
|
64
68
|
# The return type is a Integer but if the info isn't available, it will return nil.
|
65
69
|
def used
|
66
70
|
return nil unless swaps_readable?
|
@@ -79,7 +83,8 @@ module LinuxStat
|
|
79
83
|
values_t[-1].sum.*(100).fdiv(total).round(2)
|
80
84
|
end
|
81
85
|
|
82
|
-
#
|
86
|
+
# Shows the percentage of swap available.
|
87
|
+
#
|
83
88
|
# The return type is a Float but if the info isn't available, it will return nil.
|
84
89
|
def percent_available
|
85
90
|
return nil unless swaps_readable?
|
data/lib/linux_stat/version.rb
CHANGED
metadata
CHANGED
@@ -1,37 +1,48 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linux_stat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sourav Goswami
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Efficient linux system reporting gem. Linux Only | Efficient | Reliable
|
14
14
|
email:
|
15
15
|
- souravgoswami@protonmail.com
|
16
16
|
executables: []
|
17
|
-
extensions:
|
17
|
+
extensions:
|
18
|
+
- ext/fs_stat/extconf.rb
|
19
|
+
- ext/sysconf/extconf.rb
|
20
|
+
- ext/utsname/extconf.rb
|
18
21
|
extra_rdoc_files:
|
19
22
|
- README.md
|
20
23
|
files:
|
21
|
-
- Gemfile
|
22
24
|
- README.md
|
23
25
|
- bin/console
|
24
26
|
- bin/linuxstat.rb
|
25
27
|
- bin/setup
|
28
|
+
- ext/fs_stat/extconf.rb
|
29
|
+
- ext/fs_stat/fs_stat.c
|
30
|
+
- ext/sysconf/extconf.rb
|
31
|
+
- ext/sysconf/sysconf.c
|
32
|
+
- ext/utsname/extconf.rb
|
33
|
+
- ext/utsname/utsname.c
|
26
34
|
- lib/linux_stat.rb
|
27
35
|
- lib/linux_stat/battery.rb
|
28
36
|
- lib/linux_stat/bios.rb
|
29
37
|
- lib/linux_stat/cpu.rb
|
38
|
+
- lib/linux_stat/filesystem.rb
|
30
39
|
- lib/linux_stat/kernel.rb
|
31
40
|
- lib/linux_stat/memory.rb
|
41
|
+
- lib/linux_stat/mounts.rb
|
32
42
|
- lib/linux_stat/net.rb
|
33
43
|
- lib/linux_stat/os.rb
|
34
44
|
- lib/linux_stat/process.rb
|
45
|
+
- lib/linux_stat/process_info.rb
|
35
46
|
- lib/linux_stat/swap.rb
|
36
47
|
- lib/linux_stat/version.rb
|
37
48
|
homepage: https://github.com/Souravgoswami/linux_stat/
|
@@ -56,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
67
|
- !ruby/object:Gem::Version
|
57
68
|
version: '0'
|
58
69
|
requirements: []
|
59
|
-
rubygems_version: 3.1.
|
70
|
+
rubygems_version: 3.1.4
|
60
71
|
signing_key:
|
61
72
|
specification_version: 4
|
62
73
|
summary: Efficient linux system reporting gem
|