linux_stat 1.4.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +195 -104
- data/bin/console +7 -1
- data/exe/linuxstat.rb +8 -1
- data/ext/fs_stat/fs_stat.c +10 -10
- data/ext/nproc/nproc.c +2 -2
- 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 +98 -0
- data/ext/procfs/statm.h +109 -0
- data/ext/procfs/uptime.h +12 -0
- data/ext/sysconf/extconf.rb +1 -1
- data/ext/sysconf/sysconf.c +27 -27
- data/ext/sysinfo/extconf.rb +11 -0
- data/ext/sysinfo/sysinfo.c +177 -0
- data/ext/utsname/utsname.c +1 -1
- data/lib/linux_stat.rb +10 -4
- data/lib/linux_stat/battery.rb +8 -1
- data/lib/linux_stat/memory.rb +13 -3
- data/lib/linux_stat/net.rb +5 -5
- data/lib/linux_stat/os.rb +56 -9
- data/lib/linux_stat/process.rb +17 -27
- data/lib/linux_stat/process_info.rb +102 -121
- data/lib/linux_stat/swap.rb +36 -9
- data/lib/linux_stat/version.rb +1 -1
- metadata +13 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7af04643c6d2b3886048d2f8e454b6aaea3646a7aca28e46af44bb67e8ecb3f
|
4
|
+
data.tar.gz: fba61371d7ab4169e6c187a81bba56c8016d848afea9b2c6d5a8b2ffd30fb9bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33272ae30466df860dd3330cdbac62031a9f1022f6854577c83330705cb2ec5c3b2864cac88d1e5823c2d756e1866496fef01e3ef77f26e8e82dd71d14a7ad1a
|
7
|
+
data.tar.gz: 1004e9136ce2b252a7c4ce2f408dcaa4558dd1d4219edc61a049ead3456ab571a7b17058663462136858372659855b894c578c15f0099d84ae2a99ed8d30824e
|
data/README.md
CHANGED
@@ -16,7 +16,12 @@ Languages Used:
|
|
16
16
|
|
17
17
|
---
|
18
18
|
|
19
|
-
## Dependencies:
|
19
|
+
## Runtime Dependencies:
|
20
|
+
|
21
|
+
1. Kernel: Any Linux distribution with Kernel 3.14+.
|
22
|
+
2. Ruby: Ruby 2.3.0 and above.
|
23
|
+
|
24
|
+
## Build Dependencies:
|
20
25
|
+ You need to have the C compiler installed to be able to compile the C extensions.
|
21
26
|
On Arch Linux:
|
22
27
|
```
|
@@ -25,19 +30,14 @@ On Arch Linux:
|
|
25
30
|
|
26
31
|
On Debian based systems:
|
27
32
|
```
|
28
|
-
# apt install gcc build-essential
|
33
|
+
# apt install gcc build-essential ruby-dev
|
29
34
|
```
|
30
35
|
|
31
|
-
+ You
|
32
|
-
```
|
33
|
-
# apt install ruby-dev
|
34
|
-
```
|
35
|
-
|
36
|
-
+ 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.
|
37
37
|
|
38
38
|
---
|
39
39
|
|
40
|
-
## Optional Dependencies
|
40
|
+
## Optional Runtime Dependencies
|
41
41
|
|
42
42
|
You need hwdata to decode vendor and product ids if you use LinuxStat::USB and/or LinuxStat::PCI
|
43
43
|
|
@@ -89,7 +89,6 @@ It's generated by linuxstat.rb command, which is available after the installatio
|
|
89
89
|
|
90
90
|
For ease of use, LinuxStat is also assigned to the LS constant.
|
91
91
|
|
92
|
-
### LinuxStat::BIOS
|
93
92
|
### LinuxStat::BIOS
|
94
93
|
```
|
95
94
|
# File: bios.rb | Line: 58
|
@@ -136,7 +135,7 @@ LinuxStat::Battery.charge_full_wh()
|
|
136
135
|
LinuxStat::Battery.charging?()
|
137
136
|
=> true
|
138
137
|
|
139
|
-
# File: battery.rb | Line:
|
138
|
+
# File: battery.rb | Line: 193
|
140
139
|
# Definition: def devices_stat
|
141
140
|
LinuxStat::Battery.devices_stat()
|
142
141
|
=> {:AC=>{:type=>"Mains", :online=>1}, :BAT0=>{:model=>"DELL CYMGM77", :manufacturer=>"Samsung SDI", :type=>"Battery", :status=>"Full", :capacity=>100, :voltage_min_design=>11.4, :charge_full_design=>3.684, :charge_full_design_wh=>42.0, :voltage_now=>12....
|
@@ -184,7 +183,7 @@ LinuxStat::Battery.technology()
|
|
184
183
|
# File: battery.rb | Line: 162
|
185
184
|
# Definition: def voltage_now
|
186
185
|
LinuxStat::Battery.voltage_now()
|
187
|
-
=> 12.
|
186
|
+
=> 12.627
|
188
187
|
|
189
188
|
```
|
190
189
|
|
@@ -208,7 +207,7 @@ LinuxStat::CPU.count_online()
|
|
208
207
|
# File: cpu.rb | Line: 199
|
209
208
|
# Definition: def cur_freq
|
210
209
|
LinuxStat::CPU.cur_freq()
|
211
|
-
=> {"cpu0"=>
|
210
|
+
=> {"cpu0"=>2000001, "cpu1"=>2000003, "cpu2"=>2000010, "cpu3"=>1999999}
|
212
211
|
|
213
212
|
# File: cpu.rb | Line: 267
|
214
213
|
# Definition: def governor
|
@@ -243,29 +242,29 @@ LinuxStat::CPU.online()
|
|
243
242
|
# File: cpu.rb | Line: 25
|
244
243
|
# Definition: def stat(sleep = ticks_to_ms_t5)
|
245
244
|
LinuxStat::CPU.stat(sleep)
|
246
|
-
=> {0=>
|
245
|
+
=> {0=>38.89, 1=>20.0, 2=>33.33, 3=>25.0, 4=>100.0}
|
247
246
|
|
248
247
|
# File: cpu.rb | Line: 65
|
249
248
|
# Definition: def total_usage(sleep = ticks_to_ms_t5)
|
250
249
|
LinuxStat::CPU.total_usage(sleep)
|
251
|
-
=>
|
250
|
+
=> 45.0
|
252
251
|
|
253
252
|
# File: cpu.rb | Line: 65
|
254
253
|
# Definition: def total_usage(sleep = ticks_to_ms_t5)
|
255
254
|
LinuxStat::CPU.usage(sleep)
|
256
|
-
=>
|
255
|
+
=> 47.37
|
257
256
|
|
258
257
|
# File: cpu.rb | Line: 25
|
259
258
|
# Definition: def stat(sleep = ticks_to_ms_t5)
|
260
259
|
LinuxStat::CPU.usages(sleep)
|
261
|
-
=> {0=>
|
260
|
+
=> {0=>44.44, 1=>20.0, 2=>20.0, 3=>20.0, 4=>100.0}
|
262
261
|
|
263
262
|
```
|
264
263
|
|
265
264
|
### LinuxStat::FS
|
266
265
|
```
|
267
266
|
LinuxStat::FS.stat(arg = "/")
|
268
|
-
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>
|
267
|
+
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>7715553, :block_avail_unpriv=>7715553, :inodes=>58612160, :free_inodes=>56766199, :filesystem_id=>2050, :mount_flags=>1024, :max_filename_length=>255}
|
269
268
|
|
270
269
|
```
|
271
270
|
|
@@ -274,22 +273,22 @@ LinuxStat::FS.stat(arg = "/")
|
|
274
273
|
# File: filesystem.rb | Line: 94
|
275
274
|
# Definition: def available(fs = ?..freeze)
|
276
275
|
LinuxStat::Filesystem.available(fs)
|
277
|
-
=>
|
276
|
+
=> 31602905088
|
278
277
|
|
279
278
|
# File: filesystem.rb | Line: 60
|
280
279
|
# Definition: def free(fs = ?..freeze)
|
281
280
|
LinuxStat::Filesystem.free(fs)
|
282
|
-
=>
|
281
|
+
=> 31602905088
|
283
282
|
|
284
283
|
# File: filesystem.rb | Line: 21
|
285
284
|
# Definition: def stat(fs = ?..freeze)
|
286
285
|
LinuxStat::Filesystem.stat(fs)
|
287
|
-
=> {:total=>119981191168, :free=>
|
286
|
+
=> {:total=>119981191168, :free=>31602905088, :used=>88378286080}
|
288
287
|
|
289
288
|
# File: filesystem.rb | Line: 110
|
290
289
|
# Definition: def stat_raw(fs = ?..freeze)
|
291
290
|
LinuxStat::Filesystem.stat_raw(fs)
|
292
|
-
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>
|
291
|
+
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>7715553, :block_avail_unpriv=>7715553, :inodes=>58612160, :free_inodes=>56766199, :filesystem_id=>2050, :mount_flags=>1024, :max_filename_length=>255}
|
293
292
|
|
294
293
|
# File: filesystem.rb | Line: 41
|
295
294
|
# Definition: def total(fs = ?..freeze)
|
@@ -299,7 +298,7 @@ LinuxStat::Filesystem.total(fs)
|
|
299
298
|
# File: filesystem.rb | Line: 75
|
300
299
|
# Definition: def used(fs = ?..freeze)
|
301
300
|
LinuxStat::Filesystem.used(fs)
|
302
|
-
=>
|
301
|
+
=> 88378286080
|
303
302
|
|
304
303
|
```
|
305
304
|
|
@@ -359,35 +358,40 @@ LinuxStat::Kernel.version()
|
|
359
358
|
|
360
359
|
### LinuxStat::Memory
|
361
360
|
```
|
362
|
-
# File: memory.rb | Line:
|
361
|
+
# File: memory.rb | Line: 62
|
363
362
|
# Definition: def available
|
364
363
|
LinuxStat::Memory.available()
|
365
|
-
=>
|
364
|
+
=> 310424
|
365
|
+
|
366
|
+
# File: memory.rb | Line: 52
|
367
|
+
# Definition: def free
|
368
|
+
LinuxStat::Memory.free()
|
369
|
+
=> 278680
|
366
370
|
|
367
|
-
# File: memory.rb | Line:
|
371
|
+
# File: memory.rb | Line: 93
|
368
372
|
# Definition: def percent_available
|
369
373
|
LinuxStat::Memory.percent_available()
|
370
|
-
=> 8.
|
374
|
+
=> 8.09
|
371
375
|
|
372
|
-
# File: memory.rb | Line:
|
376
|
+
# File: memory.rb | Line: 82
|
373
377
|
# Definition: def percent_used
|
374
378
|
LinuxStat::Memory.percent_used()
|
375
|
-
=> 91.
|
379
|
+
=> 91.91
|
376
380
|
|
377
381
|
# File: memory.rb | Line: 13
|
378
382
|
# Definition: def stat
|
379
383
|
LinuxStat::Memory.stat()
|
380
|
-
=> {:total=>
|
384
|
+
=> {:total=>3836236, :used=>3525820, :available=>310416, :percent_used=>91.91, :percent_available=>8.09}
|
381
385
|
|
382
386
|
# File: memory.rb | Line: 42
|
383
387
|
# Definition: def total
|
384
388
|
LinuxStat::Memory.total()
|
385
|
-
=>
|
389
|
+
=> 3836236
|
386
390
|
|
387
|
-
# File: memory.rb | Line:
|
391
|
+
# File: memory.rb | Line: 72
|
388
392
|
# Definition: def used
|
389
393
|
LinuxStat::Memory.used()
|
390
|
-
=>
|
394
|
+
=> 3525820
|
391
395
|
|
392
396
|
```
|
393
397
|
|
@@ -396,7 +400,7 @@ LinuxStat::Memory.used()
|
|
396
400
|
# File: mounts.rb | Line: 181
|
397
401
|
# Definition: def device_stat(dev = root)
|
398
402
|
LinuxStat::Mounts.device_stat(dev)
|
399
|
-
=> {:mountpoint=>"/", :total=>119981191168, :free=>
|
403
|
+
=> {:mountpoint=>"/", :total=>119981191168, :free=>31602905088, :available=>31602905088, :used=>88378286080, :percent_used=>73.66, :percent_free=>26.34, :percent_available=>26.34}
|
400
404
|
|
401
405
|
# File: mounts.rb | Line: 139
|
402
406
|
# Definition: def devices_stat
|
@@ -406,12 +410,12 @@ LinuxStat::Mounts.devices_stat()
|
|
406
410
|
# File: mounts.rb | Line: 13
|
407
411
|
# Definition: def list
|
408
412
|
LinuxStat::Mounts.list()
|
409
|
-
=> ["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=1892892k,nr_inodes=473223,mode=755 0 0", "run /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0", "...
|
410
414
|
|
411
415
|
# File: mounts.rb | Line: 22
|
412
416
|
# Definition: def list_devices
|
413
417
|
LinuxStat::Mounts.list_devices()
|
414
|
-
=> ["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...
|
415
419
|
|
416
420
|
# File: mounts.rb | Line: 111
|
417
421
|
# Definition: def list_devices_mount_point
|
@@ -441,7 +445,7 @@ LinuxStat::Mounts.root_mount_options()
|
|
441
445
|
# File: mounts.rb | Line: 58
|
442
446
|
# Definition: def tmpfs
|
443
447
|
LinuxStat::Mounts.tmpfs()
|
444
|
-
=> {"/dev/shm"=>"tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0", "/sys/fs/cgroup"=>"tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755 0 0", "/
|
448
|
+
=> {"/dev/shm"=>"tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0", "/sys/fs/cgroup"=>"tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755 0 0", "/cache"=>"tmpfs /cache tmpfs rw,nosuid,nodev,relatime,size=2097152k 0 0", "/ramdisk...
|
445
449
|
|
446
450
|
```
|
447
451
|
|
@@ -460,17 +464,17 @@ LinuxStat::Net.ipv4_private()
|
|
460
464
|
# File: net.rb | Line: 27
|
461
465
|
# Definition: def total_bytes
|
462
466
|
LinuxStat::Net.total_bytes()
|
463
|
-
=> {:received=>
|
467
|
+
=> {:received=>850558466, :transmitted=>187230758}
|
464
468
|
|
465
469
|
# File: net.rb | Line: 45
|
466
470
|
# Definition: def total_bytes_received
|
467
471
|
LinuxStat::Net.total_bytes_received()
|
468
|
-
=>
|
472
|
+
=> 850558466
|
469
473
|
|
470
474
|
# File: net.rb | Line: 58
|
471
475
|
# Definition: def total_bytes_transmitted
|
472
476
|
LinuxStat::Net.total_bytes_transmitted()
|
473
|
-
=>
|
477
|
+
=> 187230758
|
474
478
|
|
475
479
|
# File: net.rb | Line: 86
|
476
480
|
# Definition: def usage(interval = 0.1)
|
@@ -501,6 +505,11 @@ LinuxStat::OS.distribution()
|
|
501
505
|
LinuxStat::OS.hostname()
|
502
506
|
=> "archlinux"
|
503
507
|
|
508
|
+
# File: os.rb | Line: 202
|
509
|
+
# Definition: def loadavg
|
510
|
+
LinuxStat::OS.loadavg()
|
511
|
+
=> {1=>4.5693359375, 5=>3.85400390625, 15=>3.53515625}
|
512
|
+
|
504
513
|
# File: os.rb | Line: 35
|
505
514
|
# Definition: def lsb_release
|
506
515
|
LinuxStat::OS.lsb_release()
|
@@ -521,10 +530,20 @@ LinuxStat::OS.nodename()
|
|
521
530
|
LinuxStat::OS.os_release()
|
522
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/"...
|
523
532
|
|
524
|
-
# File: os.rb | Line:
|
533
|
+
# File: os.rb | Line: 146
|
525
534
|
# Definition: def uptime
|
526
535
|
LinuxStat::OS.uptime()
|
527
|
-
=> {:hour=>
|
536
|
+
=> {:hour=>16, :minute=>52, :second=>3.39}
|
537
|
+
|
538
|
+
# File: os.rb | Line: 174
|
539
|
+
# Definition: def uptime_f
|
540
|
+
LinuxStat::OS.uptime_f()
|
541
|
+
=> 60723.39
|
542
|
+
|
543
|
+
# File: os.rb | Line: 185
|
544
|
+
# Definition: def uptime_i
|
545
|
+
LinuxStat::OS.uptime_i()
|
546
|
+
=> 60724
|
528
547
|
|
529
548
|
# File: os.rb | Line: 84
|
530
549
|
# Definition: def version
|
@@ -576,23 +595,33 @@ LinuxStat::PCI.initialize_hwdata()
|
|
576
595
|
```
|
577
596
|
# File: prettify_bytes.rb | Line: 49
|
578
597
|
# Definition: def convert_binary(n, precision: 2)
|
579
|
-
LinuxStat::PrettifyBytes.convert_binary(n =
|
580
|
-
=> "
|
598
|
+
LinuxStat::PrettifyBytes.convert_binary(n = 630454817180687, precision:)
|
599
|
+
=> "573.40 tebibytes"
|
581
600
|
|
582
601
|
# File: prettify_bytes.rb | Line: 26
|
583
602
|
# Definition: def convert_decimal(n, precision: 2)
|
584
|
-
LinuxStat::PrettifyBytes.convert_decimal(n =
|
585
|
-
=> "
|
603
|
+
LinuxStat::PrettifyBytes.convert_decimal(n = 42077508120898, precision:)
|
604
|
+
=> "42.08 terabytes"
|
586
605
|
|
587
606
|
# File: prettify_bytes.rb | Line: 97
|
588
607
|
# Definition: def convert_short_binary(n, precision: 2)
|
589
|
-
LinuxStat::PrettifyBytes.convert_short_binary(n =
|
590
|
-
=> "
|
608
|
+
LinuxStat::PrettifyBytes.convert_short_binary(n = 363689812033137, precision:)
|
609
|
+
=> "330.77 TiB"
|
591
610
|
|
592
611
|
# File: prettify_bytes.rb | Line: 72
|
593
612
|
# Definition: def convert_short_decimal(n, precision: 2)
|
594
|
-
LinuxStat::PrettifyBytes.convert_short_decimal(n =
|
595
|
-
=> "
|
613
|
+
LinuxStat::PrettifyBytes.convert_short_decimal(n = 119056846159316, precision:)
|
614
|
+
=> "119.06 TB"
|
615
|
+
|
616
|
+
```
|
617
|
+
|
618
|
+
### LinuxStat::ProcFS
|
619
|
+
```
|
620
|
+
LinuxStat::ProcFS.last_pid()
|
621
|
+
=> 34902
|
622
|
+
|
623
|
+
LinuxStat::ProcFS.uptime_f()
|
624
|
+
=> 60723.68
|
596
625
|
|
597
626
|
```
|
598
627
|
|
@@ -606,34 +635,39 @@ LinuxStat::Process.cmdlines()
|
|
606
635
|
# File: process.rb | Line: 29
|
607
636
|
# Definition: def count
|
608
637
|
LinuxStat::Process.count()
|
609
|
-
=>
|
638
|
+
=> 216
|
610
639
|
|
611
|
-
# File: process.rb | Line:
|
640
|
+
# File: process.rb | Line: 120
|
612
641
|
# Definition: def idle
|
613
642
|
LinuxStat::Process.idle()
|
614
|
-
=> [3, 4, 6, 9, 12, 23, 30, 37, 39, 49, 102, 103, 104, 106, 107, 108, 109, 110, 117, 118, 119, 121, 131, 134, 140,
|
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, 140, 177, 179, 182, 183, 186, 192, 193, 194, 195, 196, 197, 198, 199, 243, 245, 294, 461, 493, 517, 9197, 16346, 16347, 16348, 16349, 16350, 163...
|
644
|
+
|
645
|
+
# File: process.rb | Line: 160
|
646
|
+
# Definition: def last_pid
|
647
|
+
LinuxStat::Process.last_pid()
|
648
|
+
=> 34902
|
615
649
|
|
616
650
|
# File: process.rb | Line: 11
|
617
651
|
# Definition: def list
|
618
652
|
LinuxStat::Process.list()
|
619
|
-
=> [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,
|
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,...
|
620
654
|
|
621
655
|
# File: process.rb | Line: 36
|
622
656
|
# Definition: def names
|
623
657
|
LinuxStat::Process.names()
|
624
|
-
=> {1=>"systemd", 2=>"kthreadd", 3=>"rcu_gp", 4=>"rcu_par_gp", 6=>"kworker/0:0H
|
658
|
+
=> {1=>"systemd", 2=>"kthreadd", 3=>"rcu_gp", 4=>"rcu_par_gp", 6=>"kworker/0:0H", 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_inject/...
|
625
659
|
|
626
|
-
# File: process.rb | Line:
|
660
|
+
# File: process.rb | Line: 138
|
627
661
|
# Definition: def running
|
628
662
|
LinuxStat::Process.running()
|
629
|
-
=> [
|
663
|
+
=> [16203, 27259, 34902]
|
630
664
|
|
631
665
|
# File: process.rb | Line: 111
|
632
666
|
# Definition: def sleeping
|
633
667
|
LinuxStat::Process.sleeping()
|
634
|
-
=> [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,
|
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, 176, 178, 200, 228, 244, 246, 322, 325, 326, 327, 328, 389, 390, 391, 392, 409, 411, 415, 479, 535, 537,...
|
635
669
|
|
636
|
-
# File: process.rb | Line:
|
670
|
+
# File: process.rb | Line: 147
|
637
671
|
# Definition: def stopped
|
638
672
|
LinuxStat::Process.stopped()
|
639
673
|
=> []
|
@@ -643,7 +677,7 @@ LinuxStat::Process.stopped()
|
|
643
677
|
LinuxStat::Process.types()
|
644
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...
|
645
679
|
|
646
|
-
# File: process.rb | Line:
|
680
|
+
# File: process.rb | Line: 129
|
647
681
|
# Definition: def zombie
|
648
682
|
LinuxStat::Process.zombie()
|
649
683
|
=> []
|
@@ -662,52 +696,62 @@ LinuxStat::ProcessInfo.cmdline(pid)
|
|
662
696
|
LinuxStat::ProcessInfo.command_name(pid)
|
663
697
|
=> "ruby"
|
664
698
|
|
665
|
-
# File: process_info.rb | Line:
|
699
|
+
# File: process_info.rb | Line: 654
|
666
700
|
# Definition: def nproc(pid = $$)
|
667
701
|
LinuxStat::ProcessInfo.count_cpu(pid)
|
668
702
|
=> 4
|
669
703
|
|
670
|
-
# File: process_info.rb | Line:
|
704
|
+
# File: process_info.rb | Line: 280
|
671
705
|
# Definition: def cpu_stat(pid: $$, sleep: ticks_to_ms_t5)
|
672
706
|
LinuxStat::ProcessInfo.cpu_stat(pid:, sleep:)
|
673
|
-
=> {:cpu_usage=>0.0, :threads=>
|
707
|
+
=> {:cpu_usage=>0.0, :threads=>0, :last_executed_cpu=>0}
|
708
|
+
|
709
|
+
# File: process_info.rb | Line: 664
|
710
|
+
# Definition: def cpu_time(pid = $$)
|
711
|
+
LinuxStat::ProcessInfo.cpu_time(pid)
|
712
|
+
=> 0
|
713
|
+
|
714
|
+
# File: process_info.rb | Line: 677
|
715
|
+
# Definition: def cpu_times(pid = $$)
|
716
|
+
LinuxStat::ProcessInfo.cpu_times(pid)
|
717
|
+
=> {:hour=>0, :minute=>0, :second=>0}
|
674
718
|
|
675
|
-
# File: process_info.rb | Line:
|
719
|
+
# File: process_info.rb | Line: 340
|
676
720
|
# Definition: def cpu_usage(pid: $$, sleep: ticks_to_ms_t5)
|
677
721
|
LinuxStat::ProcessInfo.cpu_usage(pid:, sleep:)
|
678
|
-
=>
|
722
|
+
=> 0.0
|
679
723
|
|
680
|
-
# File: process_info.rb | Line:
|
724
|
+
# File: process_info.rb | Line: 496
|
681
725
|
# Definition: def gid(pid = $$)
|
682
726
|
LinuxStat::ProcessInfo.gid(pid)
|
683
727
|
=> {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
|
684
728
|
|
685
|
-
# File: process_info.rb | Line:
|
729
|
+
# File: process_info.rb | Line: 462
|
686
730
|
# Definition: def last_executed_cpu(pid = $$)
|
687
731
|
LinuxStat::ProcessInfo.last_executed_cpu(pid)
|
688
|
-
=>
|
732
|
+
=> 1
|
689
733
|
|
690
734
|
# File: process_info.rb | Line: 151
|
691
735
|
# Definition: def mem_stat(pid = $$)
|
692
736
|
LinuxStat::ProcessInfo.mem_stat(pid)
|
693
|
-
=> {:memory=>
|
737
|
+
=> {:memory=>24821760, :virtual_memory=>96198656, :resident_memory=>30973952, :shared_memory=>6152192}
|
694
738
|
|
695
|
-
# File: process_info.rb | Line:
|
739
|
+
# File: process_info.rb | Line: 171
|
696
740
|
# Definition: def memory(pid = $$)
|
697
741
|
LinuxStat::ProcessInfo.memory(pid)
|
698
|
-
=>
|
742
|
+
=> 24821.76
|
699
743
|
|
700
|
-
# File: process_info.rb | Line:
|
744
|
+
# File: process_info.rb | Line: 624
|
701
745
|
# Definition: def nice(pid = $$)
|
702
746
|
LinuxStat::ProcessInfo.nice(pid)
|
703
747
|
=> 0
|
704
748
|
|
705
|
-
# File: process_info.rb | Line:
|
749
|
+
# File: process_info.rb | Line: 654
|
706
750
|
# Definition: def nproc(pid = $$)
|
707
751
|
LinuxStat::ProcessInfo.nproc(pid)
|
708
752
|
=> 4
|
709
753
|
|
710
|
-
# File: process_info.rb | Line:
|
754
|
+
# File: process_info.rb | Line: 517
|
711
755
|
# Definition: def owner(pid = $$)
|
712
756
|
LinuxStat::ProcessInfo.owner(pid)
|
713
757
|
=> "sourav"
|
@@ -717,37 +761,42 @@ LinuxStat::ProcessInfo.owner(pid)
|
|
717
761
|
LinuxStat::ProcessInfo.process_name(pid)
|
718
762
|
=> "linuxstat.rb"
|
719
763
|
|
720
|
-
# File: process_info.rb | Line:
|
764
|
+
# File: process_info.rb | Line: 213
|
721
765
|
# Definition: def resident_memory(pid = $$)
|
722
766
|
LinuxStat::ProcessInfo.resident_memory(pid)
|
723
|
-
=>
|
767
|
+
=> 30973.952
|
724
768
|
|
725
|
-
# File: process_info.rb | Line:
|
769
|
+
# File: process_info.rb | Line: 586
|
726
770
|
# Definition: def running_time(pid = $$)
|
727
771
|
LinuxStat::ProcessInfo.running_time(pid)
|
728
772
|
=> 1.19
|
729
773
|
|
730
|
-
# File: process_info.rb | Line:
|
774
|
+
# File: process_info.rb | Line: 234
|
775
|
+
# Definition: def shared_memory(pid = $$)
|
776
|
+
LinuxStat::ProcessInfo.shared_memory(pid)
|
777
|
+
=> 6152.192
|
778
|
+
|
779
|
+
# File: process_info.rb | Line: 567
|
731
780
|
# Definition: def start_time(pid = $$)
|
732
781
|
LinuxStat::ProcessInfo.start_time(pid)
|
733
|
-
=> 2021-
|
782
|
+
=> 2021-02-06 04:32:07 +0530
|
734
783
|
|
735
|
-
# File: process_info.rb | Line:
|
784
|
+
# File: process_info.rb | Line: 539
|
736
785
|
# Definition: def start_time_epoch(pid = $$)
|
737
786
|
LinuxStat::ProcessInfo.start_time_epoch(pid)
|
738
|
-
=>
|
787
|
+
=> 1612566127
|
739
788
|
|
740
|
-
# File: process_info.rb | Line:
|
789
|
+
# File: process_info.rb | Line: 611
|
741
790
|
# Definition: def state(pid = $$)
|
742
791
|
LinuxStat::ProcessInfo.state(pid)
|
743
792
|
=> "R"
|
744
793
|
|
745
|
-
# File: process_info.rb | Line:
|
794
|
+
# File: process_info.rb | Line: 392
|
746
795
|
# Definition: def thread_usage(pid: $$, sleep: ticks_to_ms_t5)
|
747
796
|
LinuxStat::ProcessInfo.thread_usage(pid:, sleep:)
|
748
797
|
=> 0.0
|
749
798
|
|
750
|
-
# File: process_info.rb | Line:
|
799
|
+
# File: process_info.rb | Line: 441
|
751
800
|
# Definition: def threads(pid = $$)
|
752
801
|
LinuxStat::ProcessInfo.threads(pid)
|
753
802
|
=> 1
|
@@ -755,17 +804,17 @@ LinuxStat::ProcessInfo.threads(pid)
|
|
755
804
|
# File: process_info.rb | Line: 30
|
756
805
|
# Definition: def total_io(pid = $$)
|
757
806
|
LinuxStat::ProcessInfo.total_io(pid)
|
758
|
-
=> {:read_bytes=>
|
807
|
+
=> {:read_bytes=>0, :write_bytes=>0}
|
759
808
|
|
760
|
-
# File: process_info.rb | Line:
|
809
|
+
# File: process_info.rb | Line: 472
|
761
810
|
# Definition: def uid(pid = $$)
|
762
811
|
LinuxStat::ProcessInfo.uid(pid)
|
763
812
|
=> {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
|
764
813
|
|
765
|
-
# File: process_info.rb | Line:
|
814
|
+
# File: process_info.rb | Line: 192
|
766
815
|
# Definition: def virtual_memory(pid = $$)
|
767
816
|
LinuxStat::ProcessInfo.virtual_memory(pid)
|
768
|
-
=>
|
817
|
+
=> 96198.656
|
769
818
|
|
770
819
|
```
|
771
820
|
|
@@ -776,40 +825,45 @@ LinuxStat::ProcessInfo.virtual_memory(pid)
|
|
776
825
|
LinuxStat::Swap.any?()
|
777
826
|
=> true
|
778
827
|
|
779
|
-
# File: swap.rb | Line:
|
828
|
+
# File: swap.rb | Line: 84
|
780
829
|
# Definition: def available
|
781
830
|
LinuxStat::Swap.available()
|
782
|
-
=>
|
831
|
+
=> 2800844
|
832
|
+
|
833
|
+
# File: swap.rb | Line: 73
|
834
|
+
# Definition: def free
|
835
|
+
LinuxStat::Swap.free()
|
836
|
+
=> 2800844
|
783
837
|
|
784
838
|
# File: swap.rb | Line: 10
|
785
839
|
# Definition: def list
|
786
840
|
LinuxStat::Swap.list()
|
787
|
-
=> {"/dev/zram0"=>[:partition, 4194300,
|
841
|
+
=> {"/dev/zram0"=>[:partition, 4194300, 1393456, -2]}
|
788
842
|
|
789
|
-
# File: swap.rb | Line:
|
843
|
+
# File: swap.rb | Line: 127
|
790
844
|
# Definition: def percent_available
|
791
845
|
LinuxStat::Swap.percent_available()
|
792
|
-
=>
|
846
|
+
=> 66.78
|
793
847
|
|
794
|
-
# File: swap.rb | Line:
|
848
|
+
# File: swap.rb | Line: 107
|
795
849
|
# Definition: def percent_used
|
796
850
|
LinuxStat::Swap.percent_used()
|
797
|
-
=>
|
851
|
+
=> 33.22
|
798
852
|
|
799
853
|
# File: swap.rb | Line: 34
|
800
854
|
# Definition: def stat
|
801
855
|
LinuxStat::Swap.stat()
|
802
|
-
=> {:total=>4194300, :used=>
|
856
|
+
=> {:total=>4194300, :used=>1393456, :available=>2800844, :percent_used=>33.22, :percent_available=>66.78}
|
803
857
|
|
804
|
-
# File: swap.rb | Line:
|
858
|
+
# File: swap.rb | Line: 62
|
805
859
|
# Definition: def total
|
806
860
|
LinuxStat::Swap.total()
|
807
861
|
=> 4194300
|
808
862
|
|
809
|
-
# File: swap.rb | Line:
|
863
|
+
# File: swap.rb | Line: 98
|
810
864
|
# Definition: def used
|
811
865
|
LinuxStat::Swap.used()
|
812
|
-
=>
|
866
|
+
=> 1393456
|
813
867
|
|
814
868
|
```
|
815
869
|
|
@@ -874,6 +928,43 @@ LinuxStat::Sysconf.tty_name_max()
|
|
874
928
|
|
875
929
|
```
|
876
930
|
|
931
|
+
### LinuxStat::Sysinfo
|
932
|
+
```
|
933
|
+
LinuxStat::Sysinfo.bufferram()
|
934
|
+
=> 4096
|
935
|
+
|
936
|
+
LinuxStat::Sysinfo.freehigh()
|
937
|
+
=> 0
|
938
|
+
|
939
|
+
LinuxStat::Sysinfo.freeram()
|
940
|
+
=> 281231360
|
941
|
+
|
942
|
+
LinuxStat::Sysinfo.freeswap()
|
943
|
+
=> 2868064256
|
944
|
+
|
945
|
+
LinuxStat::Sysinfo.loads()
|
946
|
+
=> [4.5693359375, 3.85400390625, 3.53515625]
|
947
|
+
|
948
|
+
LinuxStat::Sysinfo.sharedram()
|
949
|
+
=> 694075392
|
950
|
+
|
951
|
+
LinuxStat::Sysinfo.stat()
|
952
|
+
=> {:totalram=>3928305664, :freeram=>281231360, :sharedram=>694075392, :bufferram=>4096, :totalswap=>4294963200, :freeswap=>2868064256, :totalhigh=>0, :freehigh=>0, :uptime=>60724, :loads=>[4.5693359375, 3.85400390625, 3.53515625]}
|
953
|
+
|
954
|
+
LinuxStat::Sysinfo.totalhigh()
|
955
|
+
=> 0
|
956
|
+
|
957
|
+
LinuxStat::Sysinfo.totalram()
|
958
|
+
=> 3928305664
|
959
|
+
|
960
|
+
LinuxStat::Sysinfo.totalswap()
|
961
|
+
=> 4294963200
|
962
|
+
|
963
|
+
LinuxStat::Sysinfo.uptime()
|
964
|
+
=> 60724
|
965
|
+
|
966
|
+
```
|
967
|
+
|
877
968
|
### LinuxStat::Thermal
|
878
969
|
```
|
879
970
|
# File: thermal.rb | Line: 59
|
@@ -889,12 +980,12 @@ LinuxStat::Thermal.count_sensors()
|
|
889
980
|
# File: thermal.rb | Line: 41
|
890
981
|
# Definition: def fans
|
891
982
|
LinuxStat::Thermal.fans()
|
892
|
-
=> [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Processor Fan", :rpm=>
|
983
|
+
=> [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Processor Fan", :rpm=>2686}]
|
893
984
|
|
894
985
|
# File: thermal.rb | Line: 23
|
895
986
|
# Definition: def temperatures
|
896
987
|
LinuxStat::Thermal.temperatures()
|
897
|
-
=> [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"SODIMM", :temperature=>
|
988
|
+
=> [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"SODIMM", :temperature=>36.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"CPU", :temperature=>50.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Ambi...
|
898
989
|
|
899
990
|
```
|
900
991
|
|
@@ -903,17 +994,17 @@ LinuxStat::Thermal.temperatures()
|
|
903
994
|
# File: usb.rb | Line: 139
|
904
995
|
# Definition: def count
|
905
996
|
LinuxStat::USB.count()
|
906
|
-
=>
|
997
|
+
=> 11
|
907
998
|
|
908
999
|
# File: usb.rb | Line: 139
|
909
1000
|
# Definition: def count
|
910
1001
|
LinuxStat::USB.count_devices()
|
911
|
-
=>
|
1002
|
+
=> 11
|
912
1003
|
|
913
1004
|
# File: usb.rb | Line: 49
|
914
1005
|
# Definition: def devices_stat(hwdata: true)
|
915
1006
|
LinuxStat::USB.devices_stat(hwdata:)
|
916
|
-
=> [{:path=>"/sys/bus/usb/devices/1-1.2/", :id=>"04d9:1203", :vendor_id=>"04d9", :product_id=>"1203", :bus_num=>1, :dev_num=>
|
1007
|
+
=> [{:path=>"/sys/bus/usb/devices/1-1.2/", :id=>"04d9:1203", :vendor_id=>"04d9", :product_id=>"1203", :bus_num=>1, :dev_num=>20, :hwdata=>{:vendor=>"Holtek Semiconductor, Inc.", :product=>"Keyboard"}, :authorized=>true, :b_max_power=>"100mA", :b_max_pack...
|
917
1008
|
|
918
1009
|
# File: usb.rb | Line: 179
|
919
1010
|
# Definition: def hwdata_file
|