linux_stat 1.6.0 → 2.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2204620ae409ee97e9a3fb737bb2442ce2f60e2f8b1fe4473c31c441a3ae19ac
4
- data.tar.gz: f04b438fc002122865f56597bb39acdfc52fd19f25bf628a4db3a3f4afb09830
3
+ metadata.gz: aa2ee379e74b817dd795ceec02ddcdf67d49c2f0b2d37524906111c74ea40ccb
4
+ data.tar.gz: 540c6e1a9eef8b3596afe963b6387b107e8450ec879b7d96bd95ae271cced14a
5
5
  SHA512:
6
- metadata.gz: 3fec213db7635a5763bd6082da8cbe429b0c3bb2f227e242e9cf33da59bb381dc5f008edd1bf63da576c8ad4b39fe8f56f97efb9f4ff3a4ce9f8760253afc97f
7
- data.tar.gz: 6de48af0e03a1a91166d4cc5f438f38cc0662a9d4cbc948d663591abfcf078ddd751f5f9064362448ef76252d38eb85258a4abaa20ac88c07a6dbf28b23b762b
6
+ metadata.gz: a1501322abefbddf6261133be26decb9a117a568fd73c2f76825e425ea0d256aee0fc8d1c4b805edd05d062631453ff73339bea280a250906419aa6cae6e6d32
7
+ data.tar.gz: 592ce707540e60071feb3ac0ce9fedd3bf026c234921cf074acb2640e96ea3c8d90906287960253b5700b373b465e4ac344c0389e1e5651970336b2251033c93
data/README.md CHANGED
@@ -16,11 +16,12 @@ Languages Used:
16
16
 
17
17
  ---
18
18
 
19
- ## Requirements:
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 might also require ruby-dev in Debian based systems which provides support for ruby.h header file:
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
 
@@ -139,7 +135,7 @@ LinuxStat::Battery.charge_full_wh()
139
135
  LinuxStat::Battery.charging?()
140
136
  => true
141
137
 
142
- # File: battery.rb | Line: 186
138
+ # File: battery.rb | Line: 193
143
139
  # Definition: def devices_stat
144
140
  LinuxStat::Battery.devices_stat()
145
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....
@@ -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.583
186
+ => 12.531
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"=>2000010, "cpu1"=>1999584, "cpu2"=>2000137, "cpu3"=>2000033}
210
+ => {"cpu0"=>1969861, "cpu1"=>2000059, "cpu2"=>2000024, "cpu3"=>1949778}
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=>5.26, 1=>16.67, 2=>16.67, 3=>0.0, 4=>20.0}
245
+ => {0=>9.52, 1=>16.67, 2=>20.0, 3=>0.0, 4=>16.67}
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
- => 14.29
250
+ => 5.56
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
- => 10.0
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=>0.0, 2=>0.0, 3=>20.0, 4=>0.0}
260
+ => {0=>10.0, 1=>0.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=>6091459, :block_avail_unpriv=>6091459, :inodes=>50505784, :free_inodes=>48759601, :filesystem_id=>2050, :mount_flags=>1024, :max_filename_length=>255}
267
+ => {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>7498564, :block_avail_unpriv=>7498564, :inodes=>58612160, :free_inodes=>56765394, :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
- => 24950616064
276
+ => 30714118144
281
277
 
282
278
  # File: filesystem.rb | Line: 60
283
279
  # Definition: def free(fs = ?..freeze)
284
280
  LinuxStat::Filesystem.free(fs)
285
- => 24950616064
281
+ => 30714118144
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=>24950616064, :used=>95030575104}
286
+ => {:total=>119981191168, :free=>30714118144, :used=>89267073024}
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=>6091459, :block_avail_unpriv=>6091459, :inodes=>50505784, :free_inodes=>48759601, :filesystem_id=>2050, :mount_flags=>1024, :max_filename_length=>255}
291
+ => {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>7498564, :block_avail_unpriv=>7498564, :inodes=>58612160, :free_inodes=>56765394, :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
- => 95030575104
301
+ => 89267073024
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
- => 422660
364
+ => 595616
369
365
 
370
366
  # File: memory.rb | Line: 52
371
367
  # Definition: def free
372
368
  LinuxStat::Memory.free()
373
- => 237884
369
+ => 256356
374
370
 
375
371
  # File: memory.rb | Line: 93
376
372
  # Definition: def percent_available
377
373
  LinuxStat::Memory.percent_available()
378
- => 11.02
374
+ => 15.53
379
375
 
380
376
  # File: memory.rb | Line: 82
381
377
  # Definition: def percent_used
382
378
  LinuxStat::Memory.percent_used()
383
- => 88.98
379
+ => 84.47
384
380
 
385
381
  # File: memory.rb | Line: 13
386
382
  # Definition: def stat
387
383
  LinuxStat::Memory.stat()
388
- => {:total=>3836236, :used=>3413576, :available=>422660, :percent_used=>88.98, :percent_available=>11.02}
384
+ => {:total=>3836228, :used=>3240612, :available=>595616, :percent_used=>84.47, :percent_available=>15.53}
389
385
 
390
386
  # File: memory.rb | Line: 42
391
387
  # Definition: def total
392
388
  LinuxStat::Memory.total()
393
- => 3836236
389
+ => 3836228
394
390
 
395
391
  # File: memory.rb | Line: 72
396
392
  # Definition: def used
397
393
  LinuxStat::Memory.used()
398
- => 3413576
394
+ => 3240620
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=>24950616064, :available=>24950616064, :used=>95030575104, :percent_used=>79.2, :percent_free=>20.8, :percent_available=>20.8}
403
+ => {:mountpoint=>"/", :total=>119981191168, :free=>30714118144, :available=>30714118144, :used=>89267073024, :percent_used=>74.4, :percent_free=>25.6, :percent_available=>25.6}
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=1892892k,nr_inodes=473223,mode=755 0 0", "run /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0", "...
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", "mqu...
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", "deb...
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/pids", "pstore"=>"/s...
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/rdma", "pstore"=>"/s...
428
424
 
429
425
  # File: mounts.rb | Line: 82
430
426
  # Definition: def mount_point(dev = root)
@@ -449,7 +445,7 @@ LinuxStat::Mounts.root_mount_options()
449
445
  # File: mounts.rb | Line: 58
450
446
  # Definition: def tmpfs
451
447
  LinuxStat::Mounts.tmpfs()
452
- => {"/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...
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", "/ramdisk"=>"tmpfs /ramdisk tmpfs rw,nosuid,nodev,relatime,size=6291456k 0 0", "/tmp...
453
449
 
454
450
  ```
455
451
 
@@ -468,83 +464,88 @@ 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=>719043592, :transmitted=>70236574}
467
+ => {:received=>2371748196, :transmitted=>220748232}
472
468
 
473
469
  # File: net.rb | Line: 45
474
470
  # Definition: def total_bytes_received
475
471
  LinuxStat::Net.total_bytes_received()
476
- => 719043592
472
+ => 2371748196
477
473
 
478
474
  # File: net.rb | Line: 58
479
475
  # Definition: def total_bytes_transmitted
480
476
  LinuxStat::Net.total_bytes_transmitted()
481
- => 70236574
477
+ => 220748232
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=>0.0, :transmitted=>0.0}
482
+ => {:received=>820.0, :transmitted=>0.0}
487
483
 
488
484
  ```
489
485
 
490
486
  ### LinuxStat::OS
491
487
  ```
492
- # File: os.rb | Line: 129
488
+ # File: os.rb | Line: 133
493
489
  # Definition: def bits
494
490
  LinuxStat::OS.bits()
495
491
  => 64
496
492
 
497
- # File: os.rb | Line: 84
493
+ # File: os.rb | Line: 88
498
494
  # Definition: def version
499
495
  LinuxStat::OS.distrib_version()
500
496
  => "rolling"
501
497
 
502
- # File: os.rb | Line: 46
498
+ # File: os.rb | Line: 50
503
499
  # Definition: def distribution
504
500
  LinuxStat::OS.distribution()
505
501
  => "Arch Linux"
506
502
 
507
- # File: os.rb | Line: 117
503
+ # File: os.rb | Line: 121
508
504
  # Definition: def hostname
509
505
  LinuxStat::OS.hostname()
510
506
  => "archlinux"
511
507
 
512
- # File: os.rb | Line: 185
508
+ # File: os.rb | Line: 208
513
509
  # Definition: def loadavg
514
510
  LinuxStat::OS.loadavg()
515
- => {1=>0.56884765625, 5=>0.69482421875, 15=>0.9892578125}
511
+ => {1=>2.873046875, 5=>1.9189453125, 15=>1.396484375}
516
512
 
517
- # File: os.rb | Line: 35
513
+ # File: os.rb | Line: 39
518
514
  # Definition: def lsb_release
519
515
  LinuxStat::OS.lsb_release()
520
516
  => {:LSB_VERSION=>"1.4", :DISTRIB_ID=>"Arch", :DISTRIB_RELEASE=>"rolling", :DISTRIB_DESCRIPTION=>"Arch Linux"}
521
517
 
522
- # File: os.rb | Line: 100
518
+ # File: os.rb | Line: 104
523
519
  # Definition: def machine
524
520
  LinuxStat::OS.machine()
525
521
  => "x86_64"
526
522
 
527
- # File: os.rb | Line: 108
523
+ # File: os.rb | Line: 112
528
524
  # Definition: def nodename
529
525
  LinuxStat::OS.nodename()
530
526
  => "archlinux"
531
527
 
532
- # File: os.rb | Line: 19
528
+ # File: os.rb | Line: 23
533
529
  # Definition: def os_release
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: 144
533
+ # File: os.rb | Line: 150
538
534
  # Definition: def uptime
539
535
  LinuxStat::OS.uptime()
540
- => {:hour=>11, :minute=>17, :second=>5.68}
536
+ => {:hour=>16, :minute=>16, :second=>1, :jiffy=>430}
537
+
538
+ # File: os.rb | Line: 180
539
+ # Definition: def uptime_f
540
+ LinuxStat::OS.uptime_f()
541
+ => 58561.43
541
542
 
542
- # File: os.rb | Line: 168
543
+ # File: os.rb | Line: 191
543
544
  # Definition: def uptime_i
544
545
  LinuxStat::OS.uptime_i()
545
- => 40626
546
+ => 58562
546
547
 
547
- # File: os.rb | Line: 84
548
+ # File: os.rb | Line: 88
548
549
  # Definition: def version
549
550
  LinuxStat::OS.version()
550
551
  => "rolling"
@@ -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 = 137669164863821, precision:)
598
- => "125.21 tebibytes"
598
+ LinuxStat::PrettifyBytes.convert_binary(n = 55206562261629, precision:)
599
+ => "50.21 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 = 854792232966738, precision:)
603
- => "854.79 terabytes"
603
+ LinuxStat::PrettifyBytes.convert_decimal(n = 341141363483637, precision:)
604
+ => "341.14 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 = 502144293693829, precision:)
608
- => "456.70 TiB"
608
+ LinuxStat::PrettifyBytes.convert_short_binary(n = 175331196815015, precision:)
609
+ => "159.46 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 = 489879177525276, precision:)
613
- => "489.88 TB"
613
+ LinuxStat::PrettifyBytes.convert_short_decimal(n = 789625492086030, precision:)
614
+ => "789.63 TB"
615
+
616
+ ```
617
+
618
+ ### LinuxStat::ProcFS
619
+ ```
620
+ LinuxStat::ProcFS.last_pid()
621
+ => 52438
622
+
623
+ LinuxStat::ProcFS.uptime_f()
624
+ => 58561.65
614
625
 
615
626
  ```
616
627
 
@@ -619,39 +630,44 @@ LinuxStat::PrettifyBytes.convert_short_decimal(n = 489879177525276, precision:)
619
630
  # File: process.rb | Line: 57
620
631
  # Definition: def cmdlines
621
632
  LinuxStat::Process.cmdlines()
622
- => {1=>"/sbin/init", 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=>""...
633
+ => {1=>"/usr/lib/systemd/systemd --system --deserialize 63", 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=>""...
623
634
 
624
635
  # File: process.rb | Line: 29
625
636
  # Definition: def count
626
637
  LinuxStat::Process.count()
627
- => 209
638
+ => 212
628
639
 
629
- # File: process.rb | Line: 124
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, 120, 122, 131, 134, 140, 164, 166, 170, 171, 174, 176, 181, 182, 183, 184, 185, 186, 187, 189, 231, 234, 302, 417, 425, 13585, 20484, 20485, 20486, 20487, 20488, 20...
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, 165, 168, 170, 171, 175, 180, 181, 182, 183, 184, 185, 186, 187, 189, 231, 234, 275, 447, 502, 21751, 23896, 41972, 41973, 41974, 41975, 41...
644
+
645
+ # File: process.rb | Line: 160
646
+ # Definition: def last_pid
647
+ LinuxStat::Process.last_pid()
648
+ => 52438
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, 120, 122, 131, 134,...
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: 150
660
+ # File: process.rb | Line: 138
645
661
  # Definition: def running
646
662
  LinuxStat::Process.running()
647
- => [37551]
663
+ => [52438]
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, 163, 165, 190, 218, 233, 235, 342, 380, 382, 384, 385, 428, 429, 430, 432, 443, 447, 454, 483, 501, 504,...
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, 167, 188, 218, 233, 235, 308, 311, 362, 364, 365, 378, 379, 380, 381, 395, 398, 401, 465, 520, 522,...
653
669
 
654
- # File: process.rb | Line: 163
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: 137
680
+ # File: process.rb | Line: 129
665
681
  # Definition: def zombie
666
682
  LinuxStat::Process.zombie()
667
683
  => []
@@ -673,59 +689,69 @@ LinuxStat::Process.zombie()
673
689
  # File: process_info.rb | Line: 61
674
690
  # Definition: def cmdline(pid = $$)
675
691
  LinuxStat::ProcessInfo.cmdline(pid)
676
- => "/usr/bin/ruby /home/sourav/.gem/ruby/2.7.0/bin/linuxstat.rb -md"
692
+ => "/usr/bin/ruby /home/sourav/.gem/ruby/2.7.0/bin/linuxstat.rb --markdown"
677
693
 
678
694
  # File: process_info.rb | Line: 87
679
695
  # Definition: def command_name(pid = $$)
680
696
  LinuxStat::ProcessInfo.command_name(pid)
681
697
  => "ruby"
682
698
 
683
- # File: process_info.rb | Line: 708
699
+ # File: process_info.rb | Line: 608
684
700
  # Definition: def nproc(pid = $$)
685
701
  LinuxStat::ProcessInfo.count_cpu(pid)
686
702
  => 4
687
703
 
688
- # File: process_info.rb | Line: 284
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=>1, :last_executed_cpu=>1}
707
+ => {:cpu_usage=>0.0, :threads=>0, :last_executed_cpu=>0}
708
+
709
+ # File: process_info.rb | Line: 619
710
+ # Definition: def cpu_time(pid = $$)
711
+ LinuxStat::ProcessInfo.cpu_time(pid)
712
+ => 0.4399999976158142
713
+
714
+ # File: process_info.rb | Line: 634
715
+ # Definition: def cpu_times(pid = $$)
716
+ LinuxStat::ProcessInfo.cpu_times(pid)
717
+ => {:hour=>0, :minute=>0, :second=>0, :jiffy=>439}
692
718
 
693
- # File: process_info.rb | Line: 350
719
+ # File: process_info.rb | Line: 340
694
720
  # Definition: def cpu_usage(pid: $$, sleep: ticks_to_ms_t5)
695
721
  LinuxStat::ProcessInfo.cpu_usage(pid:, sleep:)
696
722
  => 0.0
697
723
 
698
- # File: process_info.rb | Line: 525
724
+ # File: process_info.rb | Line: 450
699
725
  # Definition: def gid(pid = $$)
700
726
  LinuxStat::ProcessInfo.gid(pid)
701
727
  => {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
702
728
 
703
- # File: process_info.rb | Line: 487
729
+ # File: process_info.rb | Line: 416
704
730
  # Definition: def last_executed_cpu(pid = $$)
705
731
  LinuxStat::ProcessInfo.last_executed_cpu(pid)
706
- => 1
732
+ => 3
707
733
 
708
734
  # File: process_info.rb | Line: 151
709
735
  # Definition: def mem_stat(pid = $$)
710
736
  LinuxStat::ProcessInfo.mem_stat(pid)
711
- => {:memory=>24842.24, :virtual_memory=>96256.0, :resident_memory=>30859.264}
737
+ => {:memory=>24735744, :virtual_memory=>96317440, :resident_memory=>30707712, :shared_memory=>5971968}
712
738
 
713
- # File: process_info.rb | Line: 184
739
+ # File: process_info.rb | Line: 171
714
740
  # Definition: def memory(pid = $$)
715
741
  LinuxStat::ProcessInfo.memory(pid)
716
- => 24842.24
742
+ => 24735.744
717
743
 
718
- # File: process_info.rb | Line: 672
744
+ # File: process_info.rb | Line: 578
719
745
  # Definition: def nice(pid = $$)
720
746
  LinuxStat::ProcessInfo.nice(pid)
721
747
  => 0
722
748
 
723
- # File: process_info.rb | Line: 708
749
+ # File: process_info.rb | Line: 608
724
750
  # Definition: def nproc(pid = $$)
725
751
  LinuxStat::ProcessInfo.nproc(pid)
726
752
  => 4
727
753
 
728
- # File: process_info.rb | Line: 546
754
+ # File: process_info.rb | Line: 471
729
755
  # Definition: def owner(pid = $$)
730
756
  LinuxStat::ProcessInfo.owner(pid)
731
757
  => "sourav"
@@ -735,37 +761,42 @@ LinuxStat::ProcessInfo.owner(pid)
735
761
  LinuxStat::ProcessInfo.process_name(pid)
736
762
  => "linuxstat.rb"
737
763
 
738
- # File: process_info.rb | Line: 234
764
+ # File: process_info.rb | Line: 213
739
765
  # Definition: def resident_memory(pid = $$)
740
766
  LinuxStat::ProcessInfo.resident_memory(pid)
741
- => 30859.264
767
+ => 30707.712
742
768
 
743
- # File: process_info.rb | Line: 621
769
+ # File: process_info.rb | Line: 540
744
770
  # Definition: def running_time(pid = $$)
745
771
  LinuxStat::ProcessInfo.running_time(pid)
746
- => 1.08
772
+ => 1.03
747
773
 
748
- # File: process_info.rb | Line: 602
774
+ # File: process_info.rb | Line: 234
775
+ # Definition: def shared_memory(pid = $$)
776
+ LinuxStat::ProcessInfo.shared_memory(pid)
777
+ => 5971.968
778
+
779
+ # File: process_info.rb | Line: 521
749
780
  # Definition: def start_time(pid = $$)
750
781
  LinuxStat::ProcessInfo.start_time(pid)
751
- => 2021-01-22 21:42:20 +0530
782
+ => 2021-02-07 03:30:35 +0530
752
783
 
753
- # File: process_info.rb | Line: 568
784
+ # File: process_info.rb | Line: 493
754
785
  # Definition: def start_time_epoch(pid = $$)
755
786
  LinuxStat::ProcessInfo.start_time_epoch(pid)
756
- => 1611331940
787
+ => 1612648835
757
788
 
758
- # File: process_info.rb | Line: 653
789
+ # File: process_info.rb | Line: 565
759
790
  # Definition: def state(pid = $$)
760
791
  LinuxStat::ProcessInfo.state(pid)
761
792
  => "R"
762
793
 
763
- # File: process_info.rb | Line: 407
794
+ # File: process_info.rb | Line: 370
764
795
  # Definition: def thread_usage(pid: $$, sleep: ticks_to_ms_t5)
765
796
  LinuxStat::ProcessInfo.thread_usage(pid:, sleep:)
766
797
  => 0.0
767
798
 
768
- # File: process_info.rb | Line: 462
799
+ # File: process_info.rb | Line: 395
769
800
  # Definition: def threads(pid = $$)
770
801
  LinuxStat::ProcessInfo.threads(pid)
771
802
  => 1
@@ -773,17 +804,17 @@ LinuxStat::ProcessInfo.threads(pid)
773
804
  # File: process_info.rb | Line: 30
774
805
  # Definition: def total_io(pid = $$)
775
806
  LinuxStat::ProcessInfo.total_io(pid)
776
- => {:read_bytes=>1302528, :write_bytes=>0}
807
+ => {:read_bytes=>1286144, :write_bytes=>0}
777
808
 
778
- # File: process_info.rb | Line: 501
809
+ # File: process_info.rb | Line: 426
779
810
  # Definition: def uid(pid = $$)
780
811
  LinuxStat::ProcessInfo.uid(pid)
781
812
  => {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
782
813
 
783
- # File: process_info.rb | Line: 209
814
+ # File: process_info.rb | Line: 192
784
815
  # Definition: def virtual_memory(pid = $$)
785
816
  LinuxStat::ProcessInfo.virtual_memory(pid)
786
- => 96256.0
817
+ => 96317.44
787
818
 
788
819
  ```
789
820
 
@@ -794,45 +825,45 @@ LinuxStat::ProcessInfo.virtual_memory(pid)
794
825
  LinuxStat::Swap.any?()
795
826
  => true
796
827
 
797
- # File: swap.rb | Line: 81
828
+ # File: swap.rb | Line: 84
798
829
  # Definition: def available
799
830
  LinuxStat::Swap.available()
800
- => 2437940
831
+ => 2328956
801
832
 
802
- # File: swap.rb | Line: 70
833
+ # File: swap.rb | Line: 73
803
834
  # Definition: def free
804
835
  LinuxStat::Swap.free()
805
- => 2437940
836
+ => 2328956
806
837
 
807
838
  # File: swap.rb | Line: 10
808
839
  # Definition: def list
809
840
  LinuxStat::Swap.list()
810
- => {"/dev/zram0"=>[:partition, 4194300, 1756360, -2]}
841
+ => {"/dev/zram0"=>[:partition, 4194300, 1865344, -2]}
811
842
 
812
- # File: swap.rb | Line: 116
843
+ # File: swap.rb | Line: 127
813
844
  # Definition: def percent_available
814
845
  LinuxStat::Swap.percent_available()
815
- => 58.13
846
+ => 55.53
816
847
 
817
- # File: swap.rb | Line: 102
848
+ # File: swap.rb | Line: 107
818
849
  # Definition: def percent_used
819
850
  LinuxStat::Swap.percent_used()
820
- => 41.87
851
+ => 44.47
821
852
 
822
853
  # File: swap.rb | Line: 34
823
854
  # Definition: def stat
824
855
  LinuxStat::Swap.stat()
825
- => {:total=>4194300, :used=>1756360, :available=>2437940, :percent_used=>41.87, :percent_available=>58.13}
856
+ => {:total=>4194300, :used=>1865344, :available=>2328956, :percent_used=>44.47, :percent_available=>55.53}
826
857
 
827
- # File: swap.rb | Line: 59
858
+ # File: swap.rb | Line: 62
828
859
  # Definition: def total
829
860
  LinuxStat::Swap.total()
830
861
  => 4194300
831
862
 
832
- # File: swap.rb | Line: 93
863
+ # File: swap.rb | Line: 98
833
864
  # Definition: def used
834
865
  LinuxStat::Swap.used()
835
- => 1756360
866
+ => 1865344
836
867
 
837
868
  ```
838
869
 
@@ -906,28 +937,31 @@ LinuxStat::Sysinfo.freehigh()
906
937
  => 0
907
938
 
908
939
  LinuxStat::Sysinfo.freeram()
909
- => 223875072
940
+ => 258519040
910
941
 
911
942
  LinuxStat::Sysinfo.freeswap()
912
- => 2496450560
943
+ => 2384850944
913
944
 
914
945
  LinuxStat::Sysinfo.loads()
915
- => [0.56884765625, 0.69482421875, 0.9892578125]
946
+ => [2.873046875, 1.9189453125, 1.396484375]
916
947
 
917
948
  LinuxStat::Sysinfo.sharedram()
918
- => 834801664
949
+ => 644231168
950
+
951
+ LinuxStat::Sysinfo.stat()
952
+ => {:totalram=>3928297472, :freeram=>258519040, :sharedram=>644231168, :bufferram=>4096, :totalswap=>4294963200, :freeswap=>2384850944, :totalhigh=>0, :freehigh=>0, :uptime=>58562, :loads=>[2.873046875, 1.9189453125, 1.396484375]}
919
953
 
920
954
  LinuxStat::Sysinfo.totalhigh()
921
955
  => 0
922
956
 
923
957
  LinuxStat::Sysinfo.totalram()
924
- => 3928305664
958
+ => 3928297472
925
959
 
926
960
  LinuxStat::Sysinfo.totalswap()
927
961
  => 4294963200
928
962
 
929
963
  LinuxStat::Sysinfo.uptime()
930
- => 40627
964
+ => 58562
931
965
 
932
966
  ```
933
967
 
@@ -946,12 +980,12 @@ LinuxStat::Thermal.count_sensors()
946
980
  # File: thermal.rb | Line: 41
947
981
  # Definition: def fans
948
982
  LinuxStat::Thermal.fans()
949
- => [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Processor Fan", :rpm=>0}]
983
+ => [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Processor Fan", :rpm=>2795}]
950
984
 
951
985
  # File: thermal.rb | Line: 23
952
986
  # Definition: def temperatures
953
987
  LinuxStat::Thermal.temperatures()
954
- => [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"SODIMM", :temperature=>36.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"CPU", :temperature=>46.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Ambi...
988
+ => [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"SODIMM", :temperature=>33.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"CPU", :temperature=>41.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Ambi...
955
989
 
956
990
  ```
957
991
 
@@ -960,17 +994,17 @@ LinuxStat::Thermal.temperatures()
960
994
  # File: usb.rb | Line: 139
961
995
  # Definition: def count
962
996
  LinuxStat::USB.count()
963
- => 10
997
+ => 11
964
998
 
965
999
  # File: usb.rb | Line: 139
966
1000
  # Definition: def count
967
1001
  LinuxStat::USB.count_devices()
968
- => 10
1002
+ => 11
969
1003
 
970
1004
  # File: usb.rb | Line: 49
971
1005
  # Definition: def devices_stat(hwdata: true)
972
1006
  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=>11, :hwdata=>{:vendor=>"Holtek Semiconductor, Inc.", :product=>"Keyboard"}, :authorized=>true, :b_max_power=>"100mA", :b_max_pack...
1007
+ => [{:path=>"/sys/bus/usb/devices/1-1.2/", :id=>"04d9:1203", :vendor_id=>"04d9", :product_id=>"1203", :bus_num=>1, :dev_num=>12, :hwdata=>{:vendor=>"Holtek Semiconductor, Inc.", :product=>"Keyboard"}, :authorized=>true, :b_max_power=>"100mA", :b_max_pack...
974
1008
 
975
1009
  # File: usb.rb | Line: 179
976
1010
  # Definition: def hwdata_file