linux_stat 1.6.0 → 2.0.1
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 +130 -106
- data/bin/console +7 -1
- data/exe/linuxstat.rb +6 -0
- data/ext/procfs/extconf.rb +11 -0
- data/ext/procfs/loadavg_pid.h +11 -0
- data/ext/procfs/procfs.c +42 -0
- data/ext/procfs/stat.h +92 -0
- data/ext/procfs/statm.h +99 -0
- data/ext/procfs/uptime.h +12 -0
- data/lib/linux_stat.rb +4 -1
- data/lib/linux_stat/net.rb +5 -5
- data/lib/linux_stat/os.rb +6 -11
- data/lib/linux_stat/process.rb +17 -27
- data/lib/linux_stat/process_info.rb +67 -121
- data/lib/linux_stat/swap.rb +23 -7
- data/lib/linux_stat/version.rb +1 -1
- metadata +10 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1292d974695e1622fd5ca04cd91393b325a8acd4116727498b077b74b530aa6
|
4
|
+
data.tar.gz: ba39825500d32ebaafa6d0a6176901c34e9abc98ea747f6035f4731db9ed1818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ae4eed738ade10f5aa8202a6552c9a4e05d2e8ba22c6f2e6f2b8f5f59a38f057befe3f2b5cef4302917ba04477c21a5fedf34538cca32256dea55df408dcee5
|
7
|
+
data.tar.gz: 1569d7d670cb488b10fac97f0bfcf9c8e6c9ce3ff997524dc478e5a762e7806bbf84fb06e31f4c7376ef0c2f48e6b08f5f27671abdc5c7d54e041971ca17da64
|
data/README.md
CHANGED
@@ -16,11 +16,12 @@ Languages Used:
|
|
16
16
|
|
17
17
|
---
|
18
18
|
|
19
|
-
##
|
19
|
+
## Runtime Dependencies:
|
20
20
|
|
21
|
-
Any Linux distribution with Kernel 3.14+.
|
21
|
+
1. Kernel: Any Linux distribution with Kernel 3.14+.
|
22
|
+
2. Ruby: Ruby 2.3.0 and above.
|
22
23
|
|
23
|
-
## Dependencies:
|
24
|
+
## Build Dependencies:
|
24
25
|
+ You need to have the C compiler installed to be able to compile the C extensions.
|
25
26
|
On Arch Linux:
|
26
27
|
```
|
@@ -29,19 +30,14 @@ On Arch Linux:
|
|
29
30
|
|
30
31
|
On Debian based systems:
|
31
32
|
```
|
32
|
-
# apt install gcc build-essential
|
33
|
+
# apt install gcc build-essential ruby-dev
|
33
34
|
```
|
34
35
|
|
35
|
-
+ You
|
36
|
-
```
|
37
|
-
# apt install ruby-dev
|
38
|
-
```
|
39
|
-
|
40
|
-
+ Once your are done, and you can compile the C file, you can follow the installation!
|
36
|
+
+ You can remove the packages once the program is installed.
|
41
37
|
|
42
38
|
---
|
43
39
|
|
44
|
-
## Optional Dependencies
|
40
|
+
## Optional Runtime Dependencies
|
45
41
|
|
46
42
|
You need hwdata to decode vendor and product ids if you use LinuxStat::USB and/or LinuxStat::PCI
|
47
43
|
|
@@ -93,7 +89,7 @@ It's generated by linuxstat.rb command, which is available after the installatio
|
|
93
89
|
|
94
90
|
For ease of use, LinuxStat is also assigned to the LS constant.
|
95
91
|
|
96
|
-
|
92
|
+
#### LinuxStat::BIOS
|
97
93
|
```
|
98
94
|
# File: bios.rb | Line: 58
|
99
95
|
# Definition: def date
|
@@ -187,7 +183,7 @@ LinuxStat::Battery.technology()
|
|
187
183
|
# File: battery.rb | Line: 162
|
188
184
|
# Definition: def voltage_now
|
189
185
|
LinuxStat::Battery.voltage_now()
|
190
|
-
=> 12.
|
186
|
+
=> 12.538
|
191
187
|
|
192
188
|
```
|
193
189
|
|
@@ -211,7 +207,7 @@ LinuxStat::CPU.count_online()
|
|
211
207
|
# File: cpu.rb | Line: 199
|
212
208
|
# Definition: def cur_freq
|
213
209
|
LinuxStat::CPU.cur_freq()
|
214
|
-
=> {"cpu0"=>
|
210
|
+
=> {"cpu0"=>1980781, "cpu1"=>2000008, "cpu2"=>1760131, "cpu3"=>2000064}
|
215
211
|
|
216
212
|
# File: cpu.rb | Line: 267
|
217
213
|
# Definition: def governor
|
@@ -246,29 +242,29 @@ LinuxStat::CPU.online()
|
|
246
242
|
# File: cpu.rb | Line: 25
|
247
243
|
# Definition: def stat(sleep = ticks_to_ms_t5)
|
248
244
|
LinuxStat::CPU.stat(sleep)
|
249
|
-
=> {0=>
|
245
|
+
=> {0=>9.52, 1=>16.67, 2=>16.67, 3=>0.0, 4=>0.0}
|
250
246
|
|
251
247
|
# File: cpu.rb | Line: 65
|
252
248
|
# Definition: def total_usage(sleep = ticks_to_ms_t5)
|
253
249
|
LinuxStat::CPU.total_usage(sleep)
|
254
|
-
=>
|
250
|
+
=> 0.0
|
255
251
|
|
256
252
|
# File: cpu.rb | Line: 65
|
257
253
|
# Definition: def total_usage(sleep = ticks_to_ms_t5)
|
258
254
|
LinuxStat::CPU.usage(sleep)
|
259
|
-
=>
|
255
|
+
=> 5.0
|
260
256
|
|
261
257
|
# File: cpu.rb | Line: 25
|
262
258
|
# Definition: def stat(sleep = ticks_to_ms_t5)
|
263
259
|
LinuxStat::CPU.usages(sleep)
|
264
|
-
=> {0=>5.26, 1=>
|
260
|
+
=> {0=>5.26, 1=>20.0, 2=>0.0, 3=>0.0, 4=>0.0}
|
265
261
|
|
266
262
|
```
|
267
263
|
|
268
264
|
### LinuxStat::FS
|
269
265
|
```
|
270
266
|
LinuxStat::FS.stat(arg = "/")
|
271
|
-
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>
|
267
|
+
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>8714668, :block_avail_unpriv=>8714668, :inodes=>58612160, :free_inodes=>56817750, :filesystem_id=>2050, :mount_flags=>1024, :max_filename_length=>255}
|
272
268
|
|
273
269
|
```
|
274
270
|
|
@@ -277,22 +273,22 @@ LinuxStat::FS.stat(arg = "/")
|
|
277
273
|
# File: filesystem.rb | Line: 94
|
278
274
|
# Definition: def available(fs = ?..freeze)
|
279
275
|
LinuxStat::Filesystem.available(fs)
|
280
|
-
=>
|
276
|
+
=> 35695280128
|
281
277
|
|
282
278
|
# File: filesystem.rb | Line: 60
|
283
279
|
# Definition: def free(fs = ?..freeze)
|
284
280
|
LinuxStat::Filesystem.free(fs)
|
285
|
-
=>
|
281
|
+
=> 35695280128
|
286
282
|
|
287
283
|
# File: filesystem.rb | Line: 21
|
288
284
|
# Definition: def stat(fs = ?..freeze)
|
289
285
|
LinuxStat::Filesystem.stat(fs)
|
290
|
-
=> {:total=>119981191168, :free=>
|
286
|
+
=> {:total=>119981191168, :free=>35695280128, :used=>84285911040}
|
291
287
|
|
292
288
|
# File: filesystem.rb | Line: 110
|
293
289
|
# Definition: def stat_raw(fs = ?..freeze)
|
294
290
|
LinuxStat::Filesystem.stat_raw(fs)
|
295
|
-
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>
|
291
|
+
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>8714668, :block_avail_unpriv=>8714668, :inodes=>58612160, :free_inodes=>56817750, :filesystem_id=>2050, :mount_flags=>1024, :max_filename_length=>255}
|
296
292
|
|
297
293
|
# File: filesystem.rb | Line: 41
|
298
294
|
# Definition: def total(fs = ?..freeze)
|
@@ -302,7 +298,7 @@ LinuxStat::Filesystem.total(fs)
|
|
302
298
|
# File: filesystem.rb | Line: 75
|
303
299
|
# Definition: def used(fs = ?..freeze)
|
304
300
|
LinuxStat::Filesystem.used(fs)
|
305
|
-
=>
|
301
|
+
=> 84285911040
|
306
302
|
|
307
303
|
```
|
308
304
|
|
@@ -365,37 +361,37 @@ LinuxStat::Kernel.version()
|
|
365
361
|
# File: memory.rb | Line: 62
|
366
362
|
# Definition: def available
|
367
363
|
LinuxStat::Memory.available()
|
368
|
-
=>
|
364
|
+
=> 1155372
|
369
365
|
|
370
366
|
# File: memory.rb | Line: 52
|
371
367
|
# Definition: def free
|
372
368
|
LinuxStat::Memory.free()
|
373
|
-
=>
|
369
|
+
=> 261316
|
374
370
|
|
375
371
|
# File: memory.rb | Line: 93
|
376
372
|
# Definition: def percent_available
|
377
373
|
LinuxStat::Memory.percent_available()
|
378
|
-
=>
|
374
|
+
=> 30.12
|
379
375
|
|
380
376
|
# File: memory.rb | Line: 82
|
381
377
|
# Definition: def percent_used
|
382
378
|
LinuxStat::Memory.percent_used()
|
383
|
-
=> 88
|
379
|
+
=> 69.88
|
384
380
|
|
385
381
|
# File: memory.rb | Line: 13
|
386
382
|
# Definition: def stat
|
387
383
|
LinuxStat::Memory.stat()
|
388
|
-
=> {:total=>
|
384
|
+
=> {:total=>3836228, :used=>2680856, :available=>1155372, :percent_used=>69.88, :percent_available=>30.12}
|
389
385
|
|
390
386
|
# File: memory.rb | Line: 42
|
391
387
|
# Definition: def total
|
392
388
|
LinuxStat::Memory.total()
|
393
|
-
=>
|
389
|
+
=> 3836228
|
394
390
|
|
395
391
|
# File: memory.rb | Line: 72
|
396
392
|
# Definition: def used
|
397
393
|
LinuxStat::Memory.used()
|
398
|
-
=>
|
394
|
+
=> 2680856
|
399
395
|
|
400
396
|
```
|
401
397
|
|
@@ -404,7 +400,7 @@ LinuxStat::Memory.used()
|
|
404
400
|
# File: mounts.rb | Line: 181
|
405
401
|
# Definition: def device_stat(dev = root)
|
406
402
|
LinuxStat::Mounts.device_stat(dev)
|
407
|
-
=> {:mountpoint=>"/", :total=>119981191168, :free=>
|
403
|
+
=> {:mountpoint=>"/", :total=>119981191168, :free=>35695280128, :available=>35695280128, :used=>84285911040, :percent_used=>70.25, :percent_free=>29.75, :percent_available=>29.75}
|
408
404
|
|
409
405
|
# File: mounts.rb | Line: 139
|
410
406
|
# Definition: def devices_stat
|
@@ -414,17 +410,17 @@ LinuxStat::Mounts.devices_stat()
|
|
414
410
|
# File: mounts.rb | Line: 13
|
415
411
|
# Definition: def list
|
416
412
|
LinuxStat::Mounts.list()
|
417
|
-
=> ["proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0", "sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0", "dev /dev devtmpfs rw,nosuid,relatime,size=
|
413
|
+
=> ["proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0", "sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0", "dev /dev devtmpfs rw,nosuid,relatime,size=1892888k,nr_inodes=473222,mode=755 0 0", "run /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0", "...
|
418
414
|
|
419
415
|
# File: mounts.rb | Line: 22
|
420
416
|
# Definition: def list_devices
|
421
417
|
LinuxStat::Mounts.list_devices()
|
422
|
-
=> ["proc", "sys", "dev", "run", "/dev/sda2", "securityfs", "tmpfs", "devpts", "tmpfs", "cgroup2", "cgroup", "pstore", "none", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "systemd-1", "
|
418
|
+
=> ["proc", "sys", "dev", "run", "/dev/sda2", "securityfs", "tmpfs", "devpts", "tmpfs", "cgroup2", "cgroup", "pstore", "none", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "systemd-1", "hug...
|
423
419
|
|
424
420
|
# File: mounts.rb | Line: 111
|
425
421
|
# Definition: def list_devices_mount_point
|
426
422
|
LinuxStat::Mounts.list_devices_mount_point()
|
427
|
-
=> {"proc"=>"/proc", "sys"=>"/sys", "dev"=>"/dev", "run"=>"/run", "/dev/sda2"=>"/", "securityfs"=>"/sys/kernel/security", "tmpfs"=>"/run/user/1000", "devpts"=>"/dev/pts", "cgroup2"=>"/sys/fs/cgroup/unified", "cgroup"=>"/sys/fs/cgroup/
|
423
|
+
=> {"proc"=>"/proc", "sys"=>"/sys", "dev"=>"/dev", "run"=>"/run", "/dev/sda2"=>"/", "securityfs"=>"/sys/kernel/security", "tmpfs"=>"/run/user/1000", "devpts"=>"/dev/pts", "cgroup2"=>"/sys/fs/cgroup/unified", "cgroup"=>"/sys/fs/cgroup/perf_event", "pstore...
|
428
424
|
|
429
425
|
# File: mounts.rb | Line: 82
|
430
426
|
# Definition: def mount_point(dev = root)
|
@@ -458,7 +454,7 @@ LinuxStat::Mounts.tmpfs()
|
|
458
454
|
# File: net.rb | Line: 86
|
459
455
|
# Definition: def usage(interval = 0.1)
|
460
456
|
LinuxStat::Net.current_usage(interval)
|
461
|
-
=> {:received=>
|
457
|
+
=> {:received=>2805500.0, :transmitted=>127290.0}
|
462
458
|
|
463
459
|
# File: net.rb | Line: 12
|
464
460
|
# Definition: def ipv4_private
|
@@ -468,22 +464,22 @@ LinuxStat::Net.ipv4_private()
|
|
468
464
|
# File: net.rb | Line: 27
|
469
465
|
# Definition: def total_bytes
|
470
466
|
LinuxStat::Net.total_bytes()
|
471
|
-
=> {:received=>
|
467
|
+
=> {:received=>1312151997, :transmitted=>81641336}
|
472
468
|
|
473
469
|
# File: net.rb | Line: 45
|
474
470
|
# Definition: def total_bytes_received
|
475
471
|
LinuxStat::Net.total_bytes_received()
|
476
|
-
=>
|
472
|
+
=> 1312151997
|
477
473
|
|
478
474
|
# File: net.rb | Line: 58
|
479
475
|
# Definition: def total_bytes_transmitted
|
480
476
|
LinuxStat::Net.total_bytes_transmitted()
|
481
|
-
=>
|
477
|
+
=> 81641336
|
482
478
|
|
483
479
|
# File: net.rb | Line: 86
|
484
480
|
# Definition: def usage(interval = 0.1)
|
485
481
|
LinuxStat::Net.usage(interval)
|
486
|
-
=> {:received=>
|
482
|
+
=> {:received=>2971440.0, :transmitted=>80020.0}
|
487
483
|
|
488
484
|
```
|
489
485
|
|
@@ -509,10 +505,10 @@ LinuxStat::OS.distribution()
|
|
509
505
|
LinuxStat::OS.hostname()
|
510
506
|
=> "archlinux"
|
511
507
|
|
512
|
-
# File: os.rb | Line:
|
508
|
+
# File: os.rb | Line: 202
|
513
509
|
# Definition: def loadavg
|
514
510
|
LinuxStat::OS.loadavg()
|
515
|
-
=> {1=>
|
511
|
+
=> {1=>2.78173828125, 5=>2.96923828125, 15=>2.40185546875}
|
516
512
|
|
517
513
|
# File: os.rb | Line: 35
|
518
514
|
# Definition: def lsb_release
|
@@ -534,15 +530,20 @@ LinuxStat::OS.nodename()
|
|
534
530
|
LinuxStat::OS.os_release()
|
535
531
|
=> {:NAME=>"Arch Linux", :PRETTY_NAME=>"Arch Linux", :ID=>"arch", :BUILD_ID=>"rolling", :ANSI_COLOR=>"38;2;23;147;209", :HOME_URL=>"https://www.archlinux.org/", :DOCUMENTATION_URL=>"https://wiki.archlinux.org/", :SUPPORT_URL=>"https://bbs.archlinux.org/"...
|
536
532
|
|
537
|
-
# File: os.rb | Line:
|
533
|
+
# File: os.rb | Line: 146
|
538
534
|
# Definition: def uptime
|
539
535
|
LinuxStat::OS.uptime()
|
540
|
-
=> {:hour=>
|
536
|
+
=> {:hour=>5, :minute=>33, :second=>59.77}
|
541
537
|
|
542
|
-
# File: os.rb | Line:
|
538
|
+
# File: os.rb | Line: 174
|
539
|
+
# Definition: def uptime_f
|
540
|
+
LinuxStat::OS.uptime_f()
|
541
|
+
=> 20039.77
|
542
|
+
|
543
|
+
# File: os.rb | Line: 185
|
543
544
|
# Definition: def uptime_i
|
544
545
|
LinuxStat::OS.uptime_i()
|
545
|
-
=>
|
546
|
+
=> 20040
|
546
547
|
|
547
548
|
# File: os.rb | Line: 84
|
548
549
|
# Definition: def version
|
@@ -594,23 +595,33 @@ LinuxStat::PCI.initialize_hwdata()
|
|
594
595
|
```
|
595
596
|
# File: prettify_bytes.rb | Line: 49
|
596
597
|
# Definition: def convert_binary(n, precision: 2)
|
597
|
-
LinuxStat::PrettifyBytes.convert_binary(n =
|
598
|
-
=> "
|
598
|
+
LinuxStat::PrettifyBytes.convert_binary(n = 388183402613652, precision:)
|
599
|
+
=> "353.05 tebibytes"
|
599
600
|
|
600
601
|
# File: prettify_bytes.rb | Line: 26
|
601
602
|
# Definition: def convert_decimal(n, precision: 2)
|
602
|
-
LinuxStat::PrettifyBytes.convert_decimal(n =
|
603
|
-
=> "
|
603
|
+
LinuxStat::PrettifyBytes.convert_decimal(n = 937555692903085, precision:)
|
604
|
+
=> "937.56 terabytes"
|
604
605
|
|
605
606
|
# File: prettify_bytes.rb | Line: 97
|
606
607
|
# Definition: def convert_short_binary(n, precision: 2)
|
607
|
-
LinuxStat::PrettifyBytes.convert_short_binary(n =
|
608
|
-
=> "
|
608
|
+
LinuxStat::PrettifyBytes.convert_short_binary(n = 542625870963586, precision:)
|
609
|
+
=> "493.52 TiB"
|
609
610
|
|
610
611
|
# File: prettify_bytes.rb | Line: 72
|
611
612
|
# Definition: def convert_short_decimal(n, precision: 2)
|
612
|
-
LinuxStat::PrettifyBytes.convert_short_decimal(n =
|
613
|
-
=> "
|
613
|
+
LinuxStat::PrettifyBytes.convert_short_decimal(n = 861937756585891, precision:)
|
614
|
+
=> "861.94 TB"
|
615
|
+
|
616
|
+
```
|
617
|
+
|
618
|
+
### LinuxStat::ProcFS
|
619
|
+
```
|
620
|
+
LinuxStat::ProcFS.last_pid()
|
621
|
+
=> 12587
|
622
|
+
|
623
|
+
LinuxStat::ProcFS.uptime_f()
|
624
|
+
=> 20039.98
|
614
625
|
|
615
626
|
```
|
616
627
|
|
@@ -624,34 +635,39 @@ LinuxStat::Process.cmdlines()
|
|
624
635
|
# File: process.rb | Line: 29
|
625
636
|
# Definition: def count
|
626
637
|
LinuxStat::Process.count()
|
627
|
-
=>
|
638
|
+
=> 190
|
628
639
|
|
629
|
-
# File: process.rb | Line:
|
640
|
+
# File: process.rb | Line: 120
|
630
641
|
# Definition: def idle
|
631
642
|
LinuxStat::Process.idle()
|
632
|
-
=> [3, 4, 6, 9, 12, 23, 30, 37, 39, 49, 102, 103, 104, 106, 107, 108, 109, 110, 117, 118,
|
643
|
+
=> [3, 4, 6, 9, 12, 23, 30, 37, 39, 49, 102, 103, 104, 106, 107, 108, 109, 110, 117, 118, 119, 121, 131, 134, 135, 140, 165, 167, 170, 171, 175, 180, 181, 182, 183, 184, 185, 186, 188, 225, 232, 234, 270, 415, 419, 422, 10749, 11032, 11078, 11124, 11128,...
|
644
|
+
|
645
|
+
# File: process.rb | Line: 160
|
646
|
+
# Definition: def last_pid
|
647
|
+
LinuxStat::Process.last_pid()
|
648
|
+
=> 12587
|
633
649
|
|
634
650
|
# File: process.rb | Line: 11
|
635
651
|
# Definition: def list
|
636
652
|
LinuxStat::Process.list()
|
637
|
-
=> [1, 2, 3, 4, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 46, 47, 48, 49, 50, 51, 52, 102, 103, 104, 106, 107, 108, 109, 110, 112, 114, 115, 117, 118,
|
653
|
+
=> [1, 2, 3, 4, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 46, 47, 48, 49, 50, 51, 52, 102, 103, 104, 106, 107, 108, 109, 110, 112, 114, 115, 117, 118, 119, 121, 131, 134,...
|
638
654
|
|
639
655
|
# File: process.rb | Line: 36
|
640
656
|
# Definition: def names
|
641
657
|
LinuxStat::Process.names()
|
642
658
|
=> {1=>"systemd", 2=>"kthreadd", 3=>"rcu_gp", 4=>"rcu_par_gp", 6=>"kworker/0:0H-kblockd", 9=>"mm_percpu_wq", 10=>"ksoftirqd/0", 11=>"rcuc/0", 12=>"rcu_preempt", 13=>"rcub/0", 14=>"migration/0", 15=>"idle_inject/0", 16=>"cpuhp/0", 17=>"cpuhp/1", 18=>"idle...
|
643
659
|
|
644
|
-
# File: process.rb | Line:
|
660
|
+
# File: process.rb | Line: 138
|
645
661
|
# Definition: def running
|
646
662
|
LinuxStat::Process.running()
|
647
|
-
=> [
|
663
|
+
=> [12583]
|
648
664
|
|
649
665
|
# File: process.rb | Line: 111
|
650
666
|
# Definition: def sleeping
|
651
667
|
LinuxStat::Process.sleeping()
|
652
|
-
=> [1, 2, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 38, 40, 41, 42, 46, 47, 48, 50, 51, 52, 112, 114, 115,
|
668
|
+
=> [1, 2, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 38, 40, 41, 42, 46, 47, 48, 50, 51, 52, 112, 114, 115, 164, 166, 189, 217, 233, 235, 307, 310, 311, 312, 313, 418, 420, 421, 424, 426, 429, 444, 447, 450, 481,...
|
653
669
|
|
654
|
-
# File: process.rb | Line:
|
670
|
+
# File: process.rb | Line: 147
|
655
671
|
# Definition: def stopped
|
656
672
|
LinuxStat::Process.stopped()
|
657
673
|
=> []
|
@@ -661,7 +677,7 @@ LinuxStat::Process.stopped()
|
|
661
677
|
LinuxStat::Process.types()
|
662
678
|
=> {1=>:sleeping, 2=>:sleeping, 3=>:idle, 4=>:idle, 6=>:idle, 9=>:idle, 10=>:sleeping, 11=>:sleeping, 12=>:idle, 13=>:sleeping, 14=>:sleeping, 15=>:sleeping, 16=>:sleeping, 17=>:sleeping, 18=>:sleeping, 19=>:sleeping, 20=>:sleeping, 21=>:sleeping, 23=>:i...
|
663
679
|
|
664
|
-
# File: process.rb | Line:
|
680
|
+
# File: process.rb | Line: 129
|
665
681
|
# Definition: def zombie
|
666
682
|
LinuxStat::Process.zombie()
|
667
683
|
=> []
|
@@ -680,27 +696,27 @@ LinuxStat::ProcessInfo.cmdline(pid)
|
|
680
696
|
LinuxStat::ProcessInfo.command_name(pid)
|
681
697
|
=> "ruby"
|
682
698
|
|
683
|
-
# File: process_info.rb | Line:
|
699
|
+
# File: process_info.rb | Line: 654
|
684
700
|
# Definition: def nproc(pid = $$)
|
685
701
|
LinuxStat::ProcessInfo.count_cpu(pid)
|
686
702
|
=> 4
|
687
703
|
|
688
|
-
# File: process_info.rb | Line:
|
704
|
+
# File: process_info.rb | Line: 280
|
689
705
|
# Definition: def cpu_stat(pid: $$, sleep: ticks_to_ms_t5)
|
690
706
|
LinuxStat::ProcessInfo.cpu_stat(pid:, sleep:)
|
691
|
-
=> {:cpu_usage=>0.0, :threads=>
|
707
|
+
=> {:cpu_usage=>0.0, :threads=>0, :last_executed_cpu=>0}
|
692
708
|
|
693
|
-
# File: process_info.rb | Line:
|
709
|
+
# File: process_info.rb | Line: 340
|
694
710
|
# Definition: def cpu_usage(pid: $$, sleep: ticks_to_ms_t5)
|
695
711
|
LinuxStat::ProcessInfo.cpu_usage(pid:, sleep:)
|
696
712
|
=> 0.0
|
697
713
|
|
698
|
-
# File: process_info.rb | Line:
|
714
|
+
# File: process_info.rb | Line: 496
|
699
715
|
# Definition: def gid(pid = $$)
|
700
716
|
LinuxStat::ProcessInfo.gid(pid)
|
701
717
|
=> {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
|
702
718
|
|
703
|
-
# File: process_info.rb | Line:
|
719
|
+
# File: process_info.rb | Line: 462
|
704
720
|
# Definition: def last_executed_cpu(pid = $$)
|
705
721
|
LinuxStat::ProcessInfo.last_executed_cpu(pid)
|
706
722
|
=> 1
|
@@ -708,24 +724,24 @@ LinuxStat::ProcessInfo.last_executed_cpu(pid)
|
|
708
724
|
# File: process_info.rb | Line: 151
|
709
725
|
# Definition: def mem_stat(pid = $$)
|
710
726
|
LinuxStat::ProcessInfo.mem_stat(pid)
|
711
|
-
=> {:memory=>
|
727
|
+
=> {:memory=>24576000, :virtual_memory=>96206848, :resident_memory=>30736384, :shared_memory=>6160384}
|
712
728
|
|
713
|
-
# File: process_info.rb | Line:
|
729
|
+
# File: process_info.rb | Line: 171
|
714
730
|
# Definition: def memory(pid = $$)
|
715
731
|
LinuxStat::ProcessInfo.memory(pid)
|
716
|
-
=>
|
732
|
+
=> 24576.0
|
717
733
|
|
718
|
-
# File: process_info.rb | Line:
|
734
|
+
# File: process_info.rb | Line: 624
|
719
735
|
# Definition: def nice(pid = $$)
|
720
736
|
LinuxStat::ProcessInfo.nice(pid)
|
721
737
|
=> 0
|
722
738
|
|
723
|
-
# File: process_info.rb | Line:
|
739
|
+
# File: process_info.rb | Line: 654
|
724
740
|
# Definition: def nproc(pid = $$)
|
725
741
|
LinuxStat::ProcessInfo.nproc(pid)
|
726
742
|
=> 4
|
727
743
|
|
728
|
-
# File: process_info.rb | Line:
|
744
|
+
# File: process_info.rb | Line: 517
|
729
745
|
# Definition: def owner(pid = $$)
|
730
746
|
LinuxStat::ProcessInfo.owner(pid)
|
731
747
|
=> "sourav"
|
@@ -735,37 +751,42 @@ LinuxStat::ProcessInfo.owner(pid)
|
|
735
751
|
LinuxStat::ProcessInfo.process_name(pid)
|
736
752
|
=> "linuxstat.rb"
|
737
753
|
|
738
|
-
# File: process_info.rb | Line:
|
754
|
+
# File: process_info.rb | Line: 213
|
739
755
|
# Definition: def resident_memory(pid = $$)
|
740
756
|
LinuxStat::ProcessInfo.resident_memory(pid)
|
741
|
-
=>
|
757
|
+
=> 30736.384
|
742
758
|
|
743
|
-
# File: process_info.rb | Line:
|
759
|
+
# File: process_info.rb | Line: 586
|
744
760
|
# Definition: def running_time(pid = $$)
|
745
761
|
LinuxStat::ProcessInfo.running_time(pid)
|
746
|
-
=> 1.
|
762
|
+
=> 1.02
|
747
763
|
|
748
|
-
# File: process_info.rb | Line:
|
764
|
+
# File: process_info.rb | Line: 234
|
765
|
+
# Definition: def shared_memory(pid = $$)
|
766
|
+
LinuxStat::ProcessInfo.shared_memory(pid)
|
767
|
+
=> 6160.384
|
768
|
+
|
769
|
+
# File: process_info.rb | Line: 567
|
749
770
|
# Definition: def start_time(pid = $$)
|
750
771
|
LinuxStat::ProcessInfo.start_time(pid)
|
751
|
-
=> 2021-01
|
772
|
+
=> 2021-02-01 16:58:34 +0530
|
752
773
|
|
753
|
-
# File: process_info.rb | Line:
|
774
|
+
# File: process_info.rb | Line: 539
|
754
775
|
# Definition: def start_time_epoch(pid = $$)
|
755
776
|
LinuxStat::ProcessInfo.start_time_epoch(pid)
|
756
|
-
=>
|
777
|
+
=> 1612178914
|
757
778
|
|
758
|
-
# File: process_info.rb | Line:
|
779
|
+
# File: process_info.rb | Line: 611
|
759
780
|
# Definition: def state(pid = $$)
|
760
781
|
LinuxStat::ProcessInfo.state(pid)
|
761
782
|
=> "R"
|
762
783
|
|
763
|
-
# File: process_info.rb | Line:
|
784
|
+
# File: process_info.rb | Line: 392
|
764
785
|
# Definition: def thread_usage(pid: $$, sleep: ticks_to_ms_t5)
|
765
786
|
LinuxStat::ProcessInfo.thread_usage(pid:, sleep:)
|
766
787
|
=> 0.0
|
767
788
|
|
768
|
-
# File: process_info.rb | Line:
|
789
|
+
# File: process_info.rb | Line: 441
|
769
790
|
# Definition: def threads(pid = $$)
|
770
791
|
LinuxStat::ProcessInfo.threads(pid)
|
771
792
|
=> 1
|
@@ -773,17 +794,17 @@ LinuxStat::ProcessInfo.threads(pid)
|
|
773
794
|
# File: process_info.rb | Line: 30
|
774
795
|
# Definition: def total_io(pid = $$)
|
775
796
|
LinuxStat::ProcessInfo.total_io(pid)
|
776
|
-
=> {:read_bytes=>
|
797
|
+
=> {:read_bytes=>1245184, :write_bytes=>0}
|
777
798
|
|
778
|
-
# File: process_info.rb | Line:
|
799
|
+
# File: process_info.rb | Line: 472
|
779
800
|
# Definition: def uid(pid = $$)
|
780
801
|
LinuxStat::ProcessInfo.uid(pid)
|
781
802
|
=> {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
|
782
803
|
|
783
|
-
# File: process_info.rb | Line:
|
804
|
+
# File: process_info.rb | Line: 192
|
784
805
|
# Definition: def virtual_memory(pid = $$)
|
785
806
|
LinuxStat::ProcessInfo.virtual_memory(pid)
|
786
|
-
=>
|
807
|
+
=> 96206.848
|
787
808
|
|
788
809
|
```
|
789
810
|
|
@@ -797,32 +818,32 @@ LinuxStat::Swap.any?()
|
|
797
818
|
# File: swap.rb | Line: 81
|
798
819
|
# Definition: def available
|
799
820
|
LinuxStat::Swap.available()
|
800
|
-
=>
|
821
|
+
=> 3856636
|
801
822
|
|
802
823
|
# File: swap.rb | Line: 70
|
803
824
|
# Definition: def free
|
804
825
|
LinuxStat::Swap.free()
|
805
|
-
=>
|
826
|
+
=> 3856636
|
806
827
|
|
807
828
|
# File: swap.rb | Line: 10
|
808
829
|
# Definition: def list
|
809
830
|
LinuxStat::Swap.list()
|
810
|
-
=> {"/dev/zram0"=>[:partition, 4194300,
|
831
|
+
=> {"/dev/zram0"=>[:partition, 4194300, 337664, -2]}
|
811
832
|
|
812
833
|
# File: swap.rb | Line: 116
|
813
834
|
# Definition: def percent_available
|
814
835
|
LinuxStat::Swap.percent_available()
|
815
|
-
=>
|
836
|
+
=> 91.95
|
816
837
|
|
817
838
|
# File: swap.rb | Line: 102
|
818
839
|
# Definition: def percent_used
|
819
840
|
LinuxStat::Swap.percent_used()
|
820
|
-
=>
|
841
|
+
=> 8.05
|
821
842
|
|
822
843
|
# File: swap.rb | Line: 34
|
823
844
|
# Definition: def stat
|
824
845
|
LinuxStat::Swap.stat()
|
825
|
-
=> {:total=>4194300, :used=>
|
846
|
+
=> {:total=>4194300, :used=>337664, :available=>3856636, :percent_used=>8.05, :percent_available=>91.95}
|
826
847
|
|
827
848
|
# File: swap.rb | Line: 59
|
828
849
|
# Definition: def total
|
@@ -832,7 +853,7 @@ LinuxStat::Swap.total()
|
|
832
853
|
# File: swap.rb | Line: 93
|
833
854
|
# Definition: def used
|
834
855
|
LinuxStat::Swap.used()
|
835
|
-
=>
|
856
|
+
=> 337664
|
836
857
|
|
837
858
|
```
|
838
859
|
|
@@ -906,28 +927,31 @@ LinuxStat::Sysinfo.freehigh()
|
|
906
927
|
=> 0
|
907
928
|
|
908
929
|
LinuxStat::Sysinfo.freeram()
|
909
|
-
=>
|
930
|
+
=> 251408384
|
910
931
|
|
911
932
|
LinuxStat::Sysinfo.freeswap()
|
912
|
-
=>
|
933
|
+
=> 3949195264
|
913
934
|
|
914
935
|
LinuxStat::Sysinfo.loads()
|
915
|
-
=> [
|
936
|
+
=> [2.78173828125, 2.96923828125, 2.40185546875]
|
916
937
|
|
917
938
|
LinuxStat::Sysinfo.sharedram()
|
918
|
-
=>
|
939
|
+
=> 606461952
|
940
|
+
|
941
|
+
LinuxStat::Sysinfo.stat()
|
942
|
+
=> {:totalram=>3928297472, :freeram=>251408384, :sharedram=>606461952, :bufferram=>4096, :totalswap=>4294963200, :freeswap=>3949195264, :totalhigh=>0, :freehigh=>0, :uptime=>20041, :loads=>[2.78173828125, 2.96923828125, 2.40185546875]}
|
919
943
|
|
920
944
|
LinuxStat::Sysinfo.totalhigh()
|
921
945
|
=> 0
|
922
946
|
|
923
947
|
LinuxStat::Sysinfo.totalram()
|
924
|
-
=>
|
948
|
+
=> 3928297472
|
925
949
|
|
926
950
|
LinuxStat::Sysinfo.totalswap()
|
927
951
|
=> 4294963200
|
928
952
|
|
929
953
|
LinuxStat::Sysinfo.uptime()
|
930
|
-
=>
|
954
|
+
=> 20041
|
931
955
|
|
932
956
|
```
|
933
957
|
|
@@ -946,12 +970,12 @@ LinuxStat::Thermal.count_sensors()
|
|
946
970
|
# File: thermal.rb | Line: 41
|
947
971
|
# Definition: def fans
|
948
972
|
LinuxStat::Thermal.fans()
|
949
|
-
=> [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Processor Fan", :rpm=>
|
973
|
+
=> [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Processor Fan", :rpm=>2785}]
|
950
974
|
|
951
975
|
# File: thermal.rb | Line: 23
|
952
976
|
# Definition: def temperatures
|
953
977
|
LinuxStat::Thermal.temperatures()
|
954
|
-
=> [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"SODIMM", :temperature=>
|
978
|
+
=> [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"SODIMM", :temperature=>34.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"CPU", :temperature=>43.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Ambi...
|
955
979
|
|
956
980
|
```
|
957
981
|
|
@@ -970,7 +994,7 @@ LinuxStat::USB.count_devices()
|
|
970
994
|
# File: usb.rb | Line: 49
|
971
995
|
# Definition: def devices_stat(hwdata: true)
|
972
996
|
LinuxStat::USB.devices_stat(hwdata:)
|
973
|
-
=> [{:path=>"/sys/bus/usb/devices/1-1.2/", :id=>"04d9:1203", :vendor_id=>"04d9", :product_id=>"1203", :bus_num=>1, :dev_num=>
|
997
|
+
=> [{:path=>"/sys/bus/usb/devices/1-1.2/", :id=>"04d9:1203", :vendor_id=>"04d9", :product_id=>"1203", :bus_num=>1, :dev_num=>7, :hwdata=>{:vendor=>"Holtek Semiconductor, Inc.", :product=>"Keyboard"}, :authorized=>true, :b_max_power=>"100mA", :b_max_packe...
|
974
998
|
|
975
999
|
# File: usb.rb | Line: 179
|
976
1000
|
# Definition: def hwdata_file
|