linux_stat 2.1.1 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7af04643c6d2b3886048d2f8e454b6aaea3646a7aca28e46af44bb67e8ecb3f
4
- data.tar.gz: fba61371d7ab4169e6c187a81bba56c8016d848afea9b2c6d5a8b2ffd30fb9bb
3
+ metadata.gz: f6509d9a0ed303d95d92e1d410bd2e8ee1046d0b320cdbc5a2c8230b20037614
4
+ data.tar.gz: ca02da4c022fe3dfcb0a900537cc1389a602a8d79e5f300ffe206878d737e8f2
5
5
  SHA512:
6
- metadata.gz: 33272ae30466df860dd3330cdbac62031a9f1022f6854577c83330705cb2ec5c3b2864cac88d1e5823c2d756e1866496fef01e3ef77f26e8e82dd71d14a7ad1a
7
- data.tar.gz: 1004e9136ce2b252a7c4ce2f408dcaa4558dd1d4219edc61a049ead3456ab571a7b17058663462136858372659855b894c578c15f0099d84ae2a99ed8d30824e
6
+ metadata.gz: e0c2ce5029b1fb98812a18a6f5383f52b89b06fbf2bba3ed1bda29d880491cba781950ed3295e4a85b6040b8f62a68c6de390598bfd9d6cd53bd1f141e6815f3
7
+ data.tar.gz: 40b493dc6dd1c9f862ceeab1ee2c24e3493996560cc214046167907f01fca9ec262dfa54f2d237212ec2cd50f84ae2b0ae5a41be62b6017c5833dc9895235807
data/README.md CHANGED
@@ -8,11 +8,27 @@ For reading the eyecandy HTML version, visit [linux_stat](https://souravgoswami.
8
8
 
9
9
  LinuxStat lets you read status of a Linux system. It can show you cpu stats and usages, memory stats and usages, swap stats and usages, battery usage, bios info, kernel details, local ip, os details and parse os-release + lsb-release, etc.
10
10
 
11
- It only works for Linux, and detecting the OS is upto the user of this gem.
11
+ It only works on Linux, and detecting the OS is upto the user of this gem.
12
12
 
13
- Languages Used:
13
+ ---
14
14
 
15
- <img src="https://linuxstatloc.herokuapp.com/svg" width="260px">
15
+ | Table of Contents |
16
+ |:---|
17
+ | [Runtime Dependencies](https://github.com/Souravgoswami/linux_stat#runtime-dependencies) |
18
+ | [Build Dependencies](https://github.com/Souravgoswami/linux_stat#build-dependencies) |
19
+ | [Optional Runtime Dependencies](https://github.com/Souravgoswami/linux_stat#optional-runtime-dependencies) |
20
+ | [Installation](https://github.com/Souravgoswami/linux_stat#installation) |
21
+ | [Usage](https://github.com/Souravgoswami/linux_stat#usage) |
22
+ | [Notes](https://github.com/Souravgoswami/linux_stat#notes) |
23
+ | [Return Types](https://github.com/Souravgoswami/linux_stat#return-types) |
24
+ | [Ruby On Rails](https://github.com/Souravgoswami/linux_stat#ruby-on-rails) |
25
+ | [Android](https://github.com/Souravgoswami/linux_stat#android) |
26
+ | [Cloning this Repo](https://github.com/Souravgoswami/linux_stat#cloning-this-repo) |
27
+ | [Development](https://github.com/Souravgoswami/linux_stat#development) |
28
+ | [Testing](https://github.com/Souravgoswami/linux_stat#testing) |
29
+ | [Contributing](https://github.com/Souravgoswami/linux_stat#contributing) |
30
+ | [License](https://github.com/Souravgoswami/linux_stat#license) |
31
+ | [Languages](https://github.com/Souravgoswami/linux_stat#languages) |
16
32
 
17
33
  ---
18
34
 
@@ -84,1060 +100,42 @@ $ gem install linux_stat
84
100
  ```
85
101
 
86
102
  ## Usage
87
- Following are the LinuxStat modules and module functions.
88
- It's generated by linuxstat.rb command, which is available after the installation.
89
-
90
- For ease of use, LinuxStat is also assigned to the LS constant.
91
-
92
- ### LinuxStat::BIOS
93
- ```
94
- # File: bios.rb | Line: 58
95
- # Definition: def date
96
- LinuxStat::BIOS.date()
97
- => "04/10/2017"
98
-
99
- # File: bios.rb | Line: 12
100
- # Definition: def model
101
- LinuxStat::BIOS.model()
102
- => "Inspiron 5567"
103
-
104
- # File: bios.rb | Line: 29
105
- # Definition: def vendor
106
- LinuxStat::BIOS.vendor()
107
- => "Dell Inc."
108
-
109
- # File: bios.rb | Line: 44
110
- # Definition: def version
111
- LinuxStat::BIOS.version()
112
- => "1.1.2"
113
-
114
- ```
115
-
116
- ### LinuxStat::Battery
117
- ```
118
- # File: battery.rb | Line: 107
119
- # Definition: def charge
120
- LinuxStat::Battery.charge()
121
- => 100.0
122
-
123
- # File: battery.rb | Line: 124
124
- # Definition: def charge_full_design_wh
125
- LinuxStat::Battery.charge_full_design_wh()
126
- => 42.0
127
-
128
- # File: battery.rb | Line: 143
129
- # Definition: def charge_full_wh
130
- LinuxStat::Battery.charge_full_wh()
131
- => 23.79
132
-
133
- # File: battery.rb | Line: 80
134
- # Definition: def charging?
135
- LinuxStat::Battery.charging?()
136
- => true
137
-
138
- # File: battery.rb | Line: 193
139
- # Definition: def devices_stat
140
- LinuxStat::Battery.devices_stat()
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....
142
-
143
- # File: battery.rb | Line: 89
144
- # Definition: def discharging?
145
- LinuxStat::Battery.discharging?()
146
- => false
147
-
148
- # File: battery.rb | Line: 98
149
- # Definition: def full?
150
- LinuxStat::Battery.full?()
151
- => true
152
-
153
- # File: battery.rb | Line: 49
154
- # Definition: def manufacturer
155
- LinuxStat::Battery.manufacturer()
156
- => "Samsung SDI"
157
-
158
- # File: battery.rb | Line: 38
159
- # Definition: def model
160
- LinuxStat::Battery.model()
161
- => "DELL CYMGM77"
162
-
163
- # File: battery.rb | Line: 10
164
- # Definition: def present?
165
- LinuxStat::Battery.present?()
166
- => true
167
-
168
- # File: battery.rb | Line: 18
169
- # Definition: def stat
170
- LinuxStat::Battery.stat()
171
- => {:model=>"DELL CYMGM77", :manufacturer=>"Samsung SDI", :technology=>"Li-ion", :status=>"Full", :charge=>100.0, :charging=>true, :discharging=>false, :full=>true}
172
-
173
- # File: battery.rb | Line: 70
174
- # Definition: def status
175
- LinuxStat::Battery.status()
176
- => "Full"
177
-
178
- # File: battery.rb | Line: 59
179
- # Definition: def technology
180
- LinuxStat::Battery.technology()
181
- => "Li-ion"
182
-
183
- # File: battery.rb | Line: 162
184
- # Definition: def voltage_now
185
- LinuxStat::Battery.voltage_now()
186
- => 12.627
187
-
188
- ```
189
-
190
- ### LinuxStat::CPU
191
- ```
192
- # File: cpu.rb | Line: 289
193
- # Definition: def available_governors
194
- LinuxStat::CPU.available_governors()
195
- => {"cpu0"=>["performance", "powersave"], "cpu1"=>["performance", "powersave"], "cpu2"=>["performance", "powersave"], "cpu3"=>["performance", "powersave"]}
196
-
197
- # File: cpu.rb | Line: 88
198
- # Definition: def count
199
- LinuxStat::CPU.count()
200
- => 4
201
-
202
- # File: cpu.rb | Line: 105
203
- # Definition: def count_online
204
- LinuxStat::CPU.count_online()
205
- => 4
206
-
207
- # File: cpu.rb | Line: 199
208
- # Definition: def cur_freq
209
- LinuxStat::CPU.cur_freq()
210
- => {"cpu0"=>2000001, "cpu1"=>2000003, "cpu2"=>2000010, "cpu3"=>1999999}
211
-
212
- # File: cpu.rb | Line: 267
213
- # Definition: def governor
214
- LinuxStat::CPU.governor()
215
- => {"cpu0"=>"performance", "cpu1"=>"performance", "cpu2"=>"performance", "cpu3"=>"performance"}
216
-
217
- # File: cpu.rb | Line: 243
218
- # Definition: def max_freq
219
- LinuxStat::CPU.max_freq()
220
- => {"cpu0"=>2000000, "cpu1"=>2000000, "cpu2"=>2000000, "cpu3"=>2000000}
221
-
222
- # File: cpu.rb | Line: 221
223
- # Definition: def min_freq
224
- LinuxStat::CPU.min_freq()
225
- => {"cpu0"=>2000000, "cpu1"=>2000000, "cpu2"=>2000000, "cpu3"=>2000000}
226
-
227
- # File: cpu.rb | Line: 186
228
- # Definition: def model
229
- LinuxStat::CPU.model()
230
- => "Intel(R) Core(TM) i3-6006U CPU @ 2.00GHz"
231
-
232
- # File: cpu.rb | Line: 165
233
- # Definition: def offline
234
- LinuxStat::CPU.offline()
235
- => []
236
-
237
- # File: cpu.rb | Line: 134
238
- # Definition: def online
239
- LinuxStat::CPU.online()
240
- => [0, 1, 2, 3]
241
-
242
- # File: cpu.rb | Line: 25
243
- # Definition: def stat(sleep = ticks_to_ms_t5)
244
- LinuxStat::CPU.stat(sleep)
245
- => {0=>38.89, 1=>20.0, 2=>33.33, 3=>25.0, 4=>100.0}
246
-
247
- # File: cpu.rb | Line: 65
248
- # Definition: def total_usage(sleep = ticks_to_ms_t5)
249
- LinuxStat::CPU.total_usage(sleep)
250
- => 45.0
251
-
252
- # File: cpu.rb | Line: 65
253
- # Definition: def total_usage(sleep = ticks_to_ms_t5)
254
- LinuxStat::CPU.usage(sleep)
255
- => 47.37
256
-
257
- # File: cpu.rb | Line: 25
258
- # Definition: def stat(sleep = ticks_to_ms_t5)
259
- LinuxStat::CPU.usages(sleep)
260
- => {0=>44.44, 1=>20.0, 2=>20.0, 3=>20.0, 4=>100.0}
261
-
262
- ```
263
-
264
- ### LinuxStat::FS
265
- ```
266
- LinuxStat::FS.stat(arg = "/")
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}
268
-
269
- ```
270
-
271
- ### LinuxStat::Filesystem
272
- ```
273
- # File: filesystem.rb | Line: 94
274
- # Definition: def available(fs = ?..freeze)
275
- LinuxStat::Filesystem.available(fs)
276
- => 31602905088
277
-
278
- # File: filesystem.rb | Line: 60
279
- # Definition: def free(fs = ?..freeze)
280
- LinuxStat::Filesystem.free(fs)
281
- => 31602905088
282
-
283
- # File: filesystem.rb | Line: 21
284
- # Definition: def stat(fs = ?..freeze)
285
- LinuxStat::Filesystem.stat(fs)
286
- => {:total=>119981191168, :free=>31602905088, :used=>88378286080}
287
-
288
- # File: filesystem.rb | Line: 110
289
- # Definition: def stat_raw(fs = ?..freeze)
290
- LinuxStat::Filesystem.stat_raw(fs)
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}
292
-
293
- # File: filesystem.rb | Line: 41
294
- # Definition: def total(fs = ?..freeze)
295
- LinuxStat::Filesystem.total(fs)
296
- => 119981191168
297
-
298
- # File: filesystem.rb | Line: 75
299
- # Definition: def used(fs = ?..freeze)
300
- LinuxStat::Filesystem.used(fs)
301
- => 88378286080
302
-
303
- ```
304
-
305
- ### LinuxStat::Kernel
306
- ```
307
- # File: kernel.rb | Line: 88
308
- # Definition: def build_date
309
- LinuxStat::Kernel.build_date()
310
- => 2020-11-20 07:44:55 +0000
311
-
312
- # File: kernel.rb | Line: 142
313
- # Definition: def build_date_string
314
- LinuxStat::Kernel.build_date_string()
315
- => "20 Nov 2020 07:44:55 +0000"
316
-
317
- # File: kernel.rb | Line: 23
318
- # Definition: def build_user
319
- LinuxStat::Kernel.build_user()
320
- => "souravgoswami@archlinux"
321
-
322
- # File: kernel.rb | Line: 181
323
- # Definition: def ticks
324
- LinuxStat::Kernel.clk_tck()
325
- => 100
326
-
327
- # File: kernel.rb | Line: 35
328
- # Definition: def compiler
329
- LinuxStat::Kernel.compiler()
330
- => [:gcc, "10.2.0"]
331
-
332
- # File: kernel.rb | Line: 57
333
- # Definition: def compiler_version
334
- LinuxStat::Kernel.compiler_version()
335
- => "10.2.0"
336
-
337
- # File: kernel.rb | Line: 12
338
- # Definition: def version
339
- LinuxStat::Kernel.release()
340
- => "5.9.9-xanmod1-1"
341
-
342
- # File: kernel.rb | Line: 171
343
- # Definition: def string
344
- LinuxStat::Kernel.string()
345
- => "Linux version 5.9.9-xanmod1-1 (souravgoswami@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Fri, 20 Nov 2020 07:44:55 +0000"
346
-
347
- # File: kernel.rb | Line: 181
348
- # Definition: def ticks
349
- LinuxStat::Kernel.ticks()
350
- => 100
351
-
352
- # File: kernel.rb | Line: 12
353
- # Definition: def version
354
- LinuxStat::Kernel.version()
355
- => "5.9.9-xanmod1-1"
356
-
357
- ```
358
-
359
- ### LinuxStat::Memory
360
- ```
361
- # File: memory.rb | Line: 62
362
- # Definition: def available
363
- LinuxStat::Memory.available()
364
- => 310424
365
-
366
- # File: memory.rb | Line: 52
367
- # Definition: def free
368
- LinuxStat::Memory.free()
369
- => 278680
370
-
371
- # File: memory.rb | Line: 93
372
- # Definition: def percent_available
373
- LinuxStat::Memory.percent_available()
374
- => 8.09
375
-
376
- # File: memory.rb | Line: 82
377
- # Definition: def percent_used
378
- LinuxStat::Memory.percent_used()
379
- => 91.91
380
-
381
- # File: memory.rb | Line: 13
382
- # Definition: def stat
383
- LinuxStat::Memory.stat()
384
- => {:total=>3836236, :used=>3525820, :available=>310416, :percent_used=>91.91, :percent_available=>8.09}
385
-
386
- # File: memory.rb | Line: 42
387
- # Definition: def total
388
- LinuxStat::Memory.total()
389
- => 3836236
390
-
391
- # File: memory.rb | Line: 72
392
- # Definition: def used
393
- LinuxStat::Memory.used()
394
- => 3525820
395
-
396
- ```
397
-
398
- ### LinuxStat::Mounts
399
- ```
400
- # File: mounts.rb | Line: 181
401
- # Definition: def device_stat(dev = root)
402
- LinuxStat::Mounts.device_stat(dev)
403
- => {:mountpoint=>"/", :total=>119981191168, :free=>31602905088, :available=>31602905088, :used=>88378286080, :percent_used=>73.66, :percent_free=>26.34, :percent_available=>26.34}
404
-
405
- # File: mounts.rb | Line: 139
406
- # Definition: def devices_stat
407
- LinuxStat::Mounts.devices_stat()
408
- => {"proc"=>{:mountpoint=>"/proc", :total=>0, :free=>0, :available=>0, :used=>0, :percent_used=>NaN, :percent_free=>NaN, :percent_available=>NaN}, "sys"=>{:mountpoint=>"/sys", :total=>0, :free=>0, :available=>0, :used=>0, :percent_used=>NaN, :percent_fre...
409
-
410
- # File: mounts.rb | Line: 13
411
- # Definition: def list
412
- LinuxStat::Mounts.list()
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", "...
414
-
415
- # File: mounts.rb | Line: 22
416
- # Definition: def list_devices
417
- LinuxStat::Mounts.list_devices()
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...
419
-
420
- # File: mounts.rb | Line: 111
421
- # Definition: def list_devices_mount_point
422
- LinuxStat::Mounts.list_devices_mount_point()
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/cpuset", "pstore"=>"...
424
-
425
- # File: mounts.rb | Line: 82
426
- # Definition: def mount_point(dev = root)
427
- LinuxStat::Mounts.mount_point(dev)
428
- => "/"
429
-
430
- # File: mounts.rb | Line: 31
431
- # Definition: def root
432
- LinuxStat::Mounts.root()
433
- => "/dev/sda2"
434
-
435
- # File: mounts.rb | Line: 40
436
- # Definition: def root_fs
437
- LinuxStat::Mounts.root_fs()
438
- => "xfs"
439
-
440
- # File: mounts.rb | Line: 49
441
- # Definition: def root_mount_options
442
- LinuxStat::Mounts.root_mount_options()
443
- => "rw,noatime,attr2,inode64,logbufs=8,logbsize=32k,noquota"
444
-
445
- # File: mounts.rb | Line: 58
446
- # Definition: def tmpfs
447
- LinuxStat::Mounts.tmpfs()
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...
449
-
450
- ```
451
-
452
- ### LinuxStat::Net
453
- ```
454
- # File: net.rb | Line: 86
455
- # Definition: def usage(interval = 0.1)
456
- LinuxStat::Net.current_usage(interval)
457
- => {:received=>0.0, :transmitted=>0.0}
458
-
459
- # File: net.rb | Line: 12
460
- # Definition: def ipv4_private
461
- LinuxStat::Net.ipv4_private()
462
- => "192.168.43.107"
463
-
464
- # File: net.rb | Line: 27
465
- # Definition: def total_bytes
466
- LinuxStat::Net.total_bytes()
467
- => {:received=>850558466, :transmitted=>187230758}
468
-
469
- # File: net.rb | Line: 45
470
- # Definition: def total_bytes_received
471
- LinuxStat::Net.total_bytes_received()
472
- => 850558466
473
-
474
- # File: net.rb | Line: 58
475
- # Definition: def total_bytes_transmitted
476
- LinuxStat::Net.total_bytes_transmitted()
477
- => 187230758
478
-
479
- # File: net.rb | Line: 86
480
- # Definition: def usage(interval = 0.1)
481
- LinuxStat::Net.usage(interval)
482
- => {:received=>0.0, :transmitted=>0.0}
483
-
484
- ```
485
-
486
- ### LinuxStat::OS
487
- ```
488
- # File: os.rb | Line: 129
489
- # Definition: def bits
490
- LinuxStat::OS.bits()
491
- => 64
492
-
493
- # File: os.rb | Line: 84
494
- # Definition: def version
495
- LinuxStat::OS.distrib_version()
496
- => "rolling"
497
-
498
- # File: os.rb | Line: 46
499
- # Definition: def distribution
500
- LinuxStat::OS.distribution()
501
- => "Arch Linux"
502
-
503
- # File: os.rb | Line: 117
504
- # Definition: def hostname
505
- LinuxStat::OS.hostname()
506
- => "archlinux"
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
-
513
- # File: os.rb | Line: 35
514
- # Definition: def lsb_release
515
- LinuxStat::OS.lsb_release()
516
- => {:LSB_VERSION=>"1.4", :DISTRIB_ID=>"Arch", :DISTRIB_RELEASE=>"rolling", :DISTRIB_DESCRIPTION=>"Arch Linux"}
517
-
518
- # File: os.rb | Line: 100
519
- # Definition: def machine
520
- LinuxStat::OS.machine()
521
- => "x86_64"
522
-
523
- # File: os.rb | Line: 108
524
- # Definition: def nodename
525
- LinuxStat::OS.nodename()
526
- => "archlinux"
527
-
528
- # File: os.rb | Line: 19
529
- # Definition: def os_release
530
- LinuxStat::OS.os_release()
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/"...
532
-
533
- # File: os.rb | Line: 146
534
- # Definition: def uptime
535
- LinuxStat::OS.uptime()
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
547
-
548
- # File: os.rb | Line: 84
549
- # Definition: def version
550
- LinuxStat::OS.version()
551
- => "rolling"
552
-
553
- ```
554
-
555
- ### LinuxStat::PCI
556
- ```
557
- # File: pci.rb | Line: 216
558
- # Definition: def count
559
- LinuxStat::PCI.count()
560
- => 13
561
-
562
- # File: pci.rb | Line: 216
563
- # Definition: def count
564
- LinuxStat::PCI.count_devices()
565
- => 13
566
-
567
- # File: pci.rb | Line: 54
568
- # Definition: def devices_info(hwdata: true)
569
- LinuxStat::PCI.devices_info(hwdata:)
570
- => [{:id=>"8086:1904", :vendor=>"8086", :device=>"1904", :irq=>0, :kernel_driver=>"skl_uncore", :hwdata=>{:vendor=>"Intel Corporation", :product=>"Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers"}}, {:id=>"8086:1916", :vendor...
571
-
572
- # File: pci.rb | Line: 130
573
- # Definition: def devices_stat(hwdata: true)
574
- LinuxStat::PCI.devices_stat(hwdata:)
575
- => [{:path=>"/sys/bus/pci/devices/0000:00:00.0/", :id=>"8086:1904", :vendor=>"8086", :device=>"1904", :sub_vendor=>"1028", :sub_device=>"077d", :kernel_driver=>"skl_uncore", :revision=>"0x08", :irq=>0, :enable=>false, :hwdata=>{:vendor=>"Intel Corporatio...
576
-
577
- # File: pci.rb | Line: 264
578
- # Definition: def hwdata_file
579
- LinuxStat::PCI.hwdata_file()
580
- => "/usr/share/hwdata/pci.ids"
581
-
582
- # File: pci.rb | Line: 253
583
- # Definition: def hwdata_file_set?
584
- LinuxStat::PCI.hwdata_file_set?()
585
- => true
586
-
587
- # File: pci.rb | Line: 280
588
- # Definition: def initialize_hwdata
589
- LinuxStat::PCI.initialize_hwdata()
590
- => false
591
-
592
- ```
593
-
594
- ### LinuxStat::PrettifyBytes
595
- ```
596
- # File: prettify_bytes.rb | Line: 49
597
- # Definition: def convert_binary(n, precision: 2)
598
- LinuxStat::PrettifyBytes.convert_binary(n = 630454817180687, precision:)
599
- => "573.40 tebibytes"
600
-
601
- # File: prettify_bytes.rb | Line: 26
602
- # Definition: def convert_decimal(n, precision: 2)
603
- LinuxStat::PrettifyBytes.convert_decimal(n = 42077508120898, precision:)
604
- => "42.08 terabytes"
605
-
606
- # File: prettify_bytes.rb | Line: 97
607
- # Definition: def convert_short_binary(n, precision: 2)
608
- LinuxStat::PrettifyBytes.convert_short_binary(n = 363689812033137, precision:)
609
- => "330.77 TiB"
610
-
611
- # File: prettify_bytes.rb | Line: 72
612
- # Definition: def convert_short_decimal(n, precision: 2)
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
625
-
626
- ```
627
-
628
- ### LinuxStat::Process
629
- ```
630
- # File: process.rb | Line: 57
631
- # Definition: def cmdlines
632
- LinuxStat::Process.cmdlines()
633
- => {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=>""...
634
-
635
- # File: process.rb | Line: 29
636
- # Definition: def count
637
- LinuxStat::Process.count()
638
- => 216
639
-
640
- # File: process.rb | Line: 120
641
- # Definition: def idle
642
- LinuxStat::Process.idle()
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
649
-
650
- # File: process.rb | Line: 11
651
- # Definition: def list
652
- LinuxStat::Process.list()
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,...
654
-
655
- # File: process.rb | Line: 36
656
- # Definition: def names
657
- LinuxStat::Process.names()
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/...
659
-
660
- # File: process.rb | Line: 138
661
- # Definition: def running
662
- LinuxStat::Process.running()
663
- => [16203, 27259, 34902]
664
-
665
- # File: process.rb | Line: 111
666
- # Definition: def sleeping
667
- LinuxStat::Process.sleeping()
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,...
669
-
670
- # File: process.rb | Line: 147
671
- # Definition: def stopped
672
- LinuxStat::Process.stopped()
673
- => []
674
-
675
- # File: process.rb | Line: 78
676
- # Definition: def types
677
- LinuxStat::Process.types()
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...
679
-
680
- # File: process.rb | Line: 129
681
- # Definition: def zombie
682
- LinuxStat::Process.zombie()
683
- => []
684
-
685
- ```
686
-
687
- ### LinuxStat::ProcessInfo
688
- ```
689
- # File: process_info.rb | Line: 61
690
- # Definition: def cmdline(pid = $$)
691
- LinuxStat::ProcessInfo.cmdline(pid)
692
- => "/usr/bin/ruby /home/sourav/.gem/ruby/2.7.0/bin/linuxstat.rb -md"
693
-
694
- # File: process_info.rb | Line: 87
695
- # Definition: def command_name(pid = $$)
696
- LinuxStat::ProcessInfo.command_name(pid)
697
- => "ruby"
698
-
699
- # File: process_info.rb | Line: 654
700
- # Definition: def nproc(pid = $$)
701
- LinuxStat::ProcessInfo.count_cpu(pid)
702
- => 4
703
-
704
- # File: process_info.rb | Line: 280
705
- # Definition: def cpu_stat(pid: $$, sleep: ticks_to_ms_t5)
706
- LinuxStat::ProcessInfo.cpu_stat(pid:, sleep:)
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}
718
-
719
- # File: process_info.rb | Line: 340
720
- # Definition: def cpu_usage(pid: $$, sleep: ticks_to_ms_t5)
721
- LinuxStat::ProcessInfo.cpu_usage(pid:, sleep:)
722
- => 0.0
723
-
724
- # File: process_info.rb | Line: 496
725
- # Definition: def gid(pid = $$)
726
- LinuxStat::ProcessInfo.gid(pid)
727
- => {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
728
-
729
- # File: process_info.rb | Line: 462
730
- # Definition: def last_executed_cpu(pid = $$)
731
- LinuxStat::ProcessInfo.last_executed_cpu(pid)
732
- => 1
733
-
734
- # File: process_info.rb | Line: 151
735
- # Definition: def mem_stat(pid = $$)
736
- LinuxStat::ProcessInfo.mem_stat(pid)
737
- => {:memory=>24821760, :virtual_memory=>96198656, :resident_memory=>30973952, :shared_memory=>6152192}
738
-
739
- # File: process_info.rb | Line: 171
740
- # Definition: def memory(pid = $$)
741
- LinuxStat::ProcessInfo.memory(pid)
742
- => 24821.76
743
-
744
- # File: process_info.rb | Line: 624
745
- # Definition: def nice(pid = $$)
746
- LinuxStat::ProcessInfo.nice(pid)
747
- => 0
748
-
749
- # File: process_info.rb | Line: 654
750
- # Definition: def nproc(pid = $$)
751
- LinuxStat::ProcessInfo.nproc(pid)
752
- => 4
753
-
754
- # File: process_info.rb | Line: 517
755
- # Definition: def owner(pid = $$)
756
- LinuxStat::ProcessInfo.owner(pid)
757
- => "sourav"
758
-
759
- # File: process_info.rb | Line: 112
760
- # Definition: def process_name(pid = $$)
761
- LinuxStat::ProcessInfo.process_name(pid)
762
- => "linuxstat.rb"
763
-
764
- # File: process_info.rb | Line: 213
765
- # Definition: def resident_memory(pid = $$)
766
- LinuxStat::ProcessInfo.resident_memory(pid)
767
- => 30973.952
768
-
769
- # File: process_info.rb | Line: 586
770
- # Definition: def running_time(pid = $$)
771
- LinuxStat::ProcessInfo.running_time(pid)
772
- => 1.19
773
-
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
780
- # Definition: def start_time(pid = $$)
781
- LinuxStat::ProcessInfo.start_time(pid)
782
- => 2021-02-06 04:32:07 +0530
783
-
784
- # File: process_info.rb | Line: 539
785
- # Definition: def start_time_epoch(pid = $$)
786
- LinuxStat::ProcessInfo.start_time_epoch(pid)
787
- => 1612566127
788
-
789
- # File: process_info.rb | Line: 611
790
- # Definition: def state(pid = $$)
791
- LinuxStat::ProcessInfo.state(pid)
792
- => "R"
793
-
794
- # File: process_info.rb | Line: 392
795
- # Definition: def thread_usage(pid: $$, sleep: ticks_to_ms_t5)
796
- LinuxStat::ProcessInfo.thread_usage(pid:, sleep:)
797
- => 0.0
798
-
799
- # File: process_info.rb | Line: 441
800
- # Definition: def threads(pid = $$)
801
- LinuxStat::ProcessInfo.threads(pid)
802
- => 1
803
-
804
- # File: process_info.rb | Line: 30
805
- # Definition: def total_io(pid = $$)
806
- LinuxStat::ProcessInfo.total_io(pid)
807
- => {:read_bytes=>0, :write_bytes=>0}
808
-
809
- # File: process_info.rb | Line: 472
810
- # Definition: def uid(pid = $$)
811
- LinuxStat::ProcessInfo.uid(pid)
812
- => {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
813
-
814
- # File: process_info.rb | Line: 192
815
- # Definition: def virtual_memory(pid = $$)
816
- LinuxStat::ProcessInfo.virtual_memory(pid)
817
- => 96198.656
818
-
819
- ```
820
-
821
- ### LinuxStat::Swap
822
- ```
823
- # File: swap.rb | Line: 24
824
- # Definition: def any?
825
- LinuxStat::Swap.any?()
826
- => true
827
-
828
- # File: swap.rb | Line: 84
829
- # Definition: def available
830
- LinuxStat::Swap.available()
831
- => 2800844
832
-
833
- # File: swap.rb | Line: 73
834
- # Definition: def free
835
- LinuxStat::Swap.free()
836
- => 2800844
837
-
838
- # File: swap.rb | Line: 10
839
- # Definition: def list
840
- LinuxStat::Swap.list()
841
- => {"/dev/zram0"=>[:partition, 4194300, 1393456, -2]}
842
-
843
- # File: swap.rb | Line: 127
844
- # Definition: def percent_available
845
- LinuxStat::Swap.percent_available()
846
- => 66.78
847
-
848
- # File: swap.rb | Line: 107
849
- # Definition: def percent_used
850
- LinuxStat::Swap.percent_used()
851
- => 33.22
852
-
853
- # File: swap.rb | Line: 34
854
- # Definition: def stat
855
- LinuxStat::Swap.stat()
856
- => {:total=>4194300, :used=>1393456, :available=>2800844, :percent_used=>33.22, :percent_available=>66.78}
857
-
858
- # File: swap.rb | Line: 62
859
- # Definition: def total
860
- LinuxStat::Swap.total()
861
- => 4194300
862
-
863
- # File: swap.rb | Line: 98
864
- # Definition: def used
865
- LinuxStat::Swap.used()
866
- => 1393456
867
-
868
- ```
869
-
870
- ### LinuxStat::Sysconf
871
- ```
872
- LinuxStat::Sysconf.child_max()
873
- => 14788
874
-
875
- LinuxStat::Sysconf.expr_nest_max()
876
- => 32
877
-
878
- LinuxStat::Sysconf.get_euid()
879
- => 1000
880
-
881
- LinuxStat::Sysconf.get_gid()
882
- => 1000
883
-
884
- LinuxStat::Sysconf.get_login()
885
- => "sourav"
886
-
887
- LinuxStat::Sysconf.get_uid()
888
- => 1000
889
-
890
- LinuxStat::Sysconf.get_user()
891
- => "sourav"
892
-
893
- LinuxStat::Sysconf.hostname()
894
- => "archlinux"
895
-
896
- LinuxStat::Sysconf.hostname_max()
897
- => 64
898
-
899
- LinuxStat::Sysconf.line_max()
900
- => 2048
901
-
902
- LinuxStat::Sysconf.login_name_max()
903
- => 256
904
-
905
- LinuxStat::Sysconf.open_max()
906
- => 1024
907
-
908
- LinuxStat::Sysconf.pagesize()
909
- => 4096
910
-
911
- LinuxStat::Sysconf.posix_version()
912
- => 200809
913
-
914
- LinuxStat::Sysconf.processor_configured()
915
- => 4
916
-
917
- LinuxStat::Sysconf.processor_online()
918
- => 4
919
-
920
- LinuxStat::Sysconf.sc_clk_tck()
921
- => 100
922
-
923
- LinuxStat::Sysconf.stream_max()
924
- => 16
925
-
926
- LinuxStat::Sysconf.tty_name_max()
927
- => 32
928
-
929
- ```
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
103
 
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]}
104
+ Following are the LinuxStat modules and module functions in a table.
105
+ Usages.md is generated by `linuxstat.rb -md` command, which is available after the installation.
953
106
 
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
-
968
- ### LinuxStat::Thermal
969
- ```
970
- # File: thermal.rb | Line: 59
971
- # Definition: def count_fans
972
- LinuxStat::Thermal.count_fans()
973
- => 1
974
-
975
- # File: thermal.rb | Line: 49
976
- # Definition: def count_sensors
977
- LinuxStat::Thermal.count_sensors()
978
- => 8
979
-
980
- # File: thermal.rb | Line: 41
981
- # Definition: def fans
982
- LinuxStat::Thermal.fans()
983
- => [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Processor Fan", :rpm=>2686}]
984
-
985
- # File: thermal.rb | Line: 23
986
- # Definition: def temperatures
987
- LinuxStat::Thermal.temperatures()
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...
989
-
990
- ```
991
-
992
- ### LinuxStat::USB
993
- ```
994
- # File: usb.rb | Line: 139
995
- # Definition: def count
996
- LinuxStat::USB.count()
997
- => 11
998
-
999
- # File: usb.rb | Line: 139
1000
- # Definition: def count
1001
- LinuxStat::USB.count_devices()
1002
- => 11
1003
-
1004
- # File: usb.rb | Line: 49
1005
- # Definition: def devices_stat(hwdata: true)
1006
- LinuxStat::USB.devices_stat(hwdata:)
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...
1008
-
1009
- # File: usb.rb | Line: 179
1010
- # Definition: def hwdata_file
1011
- LinuxStat::USB.hwdata_file()
1012
- => "/usr/share/hwdata/usb.ids"
1013
-
1014
- # File: usb.rb | Line: 168
1015
- # Definition: def hwdata_file_set?
1016
- LinuxStat::USB.hwdata_file_set?()
1017
- => true
1018
-
1019
- # File: usb.rb | Line: 195
1020
- # Definition: def initialize_hwdata
1021
- LinuxStat::USB.initialize_hwdata()
1022
- => false
1023
-
1024
- ```
1025
-
1026
- ### LinuxStat::Uname
1027
- ```
1028
- LinuxStat::Uname.machine()
1029
- => "x86_64"
1030
-
1031
- LinuxStat::Uname.nodename()
1032
- => "archlinux"
1033
-
1034
- LinuxStat::Uname.release()
1035
- => "5.9.9-xanmod1-1"
1036
-
1037
- LinuxStat::Uname.sysname()
1038
- => "Linux"
1039
-
1040
- LinuxStat::Uname.version()
1041
- => "#1 SMP PREEMPT Fri, 20 Nov 2020 07:44:55 +0000"
1042
-
1043
- ```
1044
-
1045
- ### LinuxStat::User
1046
- ```
1047
- # File: user.rb | Line: 101
1048
- # Definition: def get_user
1049
- LinuxStat::User.get_current_user()
1050
- => "sourav"
1051
-
1052
- # File: user.rb | Line: 140
1053
- # Definition: def get_euid
1054
- LinuxStat::User.get_euid()
1055
- => 1000
1056
-
1057
- # File: user.rb | Line: 132
1058
- # Definition: def get_gid
1059
- LinuxStat::User.get_gid()
1060
- => 1000
1061
-
1062
- # File: user.rb | Line: 155
1063
- # Definition: def get_login
1064
- LinuxStat::User.get_login()
1065
- => "sourav"
1066
-
1067
- # File: user.rb | Line: 124
1068
- # Definition: def get_uid
1069
- LinuxStat::User.get_uid()
1070
- => 1000
1071
-
1072
- # File: user.rb | Line: 101
1073
- # Definition: def get_user
1074
- LinuxStat::User.get_user()
1075
- => "sourav"
1076
-
1077
- # File: user.rb | Line: 218
1078
- # Definition: def gid_by_username(username = get_user)
1079
- LinuxStat::User.gid_by_username(username)
1080
- => 1000
1081
-
1082
- # File: user.rb | Line: 58
1083
- # Definition: def gids
1084
- LinuxStat::User.gids()
1085
- => {:root=>0, :bin=>1, :daemon=>2, :mail=>12, :ftp=>11, :http=>33, :nobody=>65534, :dbus=>81, :"systemd-journal-remote"=>982, :"systemd-network"=>981, :"systemd-resolve"=>980, :"systemd-timesync"=>979, :"systemd-coredump"=>978, :uuidd=>68, :avahi=>977, :...
1086
-
1087
- # File: user.rb | Line: 317
1088
- # Definition: def home_by_gid(id = get_gid)
1089
- LinuxStat::User.home_by_gid(id)
1090
- => "/home/sourav"
1091
-
1092
- # File: user.rb | Line: 269
1093
- # Definition: def home_by_username(user = get_user)
1094
- LinuxStat::User.home_by_username(user)
1095
- => "/home/sourav"
1096
-
1097
- # File: user.rb | Line: 75
1098
- # Definition: def home_directories
1099
- LinuxStat::User.home_directories()
1100
- => {:root=>"/root", :bin=>"/", :daemon=>"/", :mail=>"/var/spool/mail", :ftp=>"/srv/ftp", :http=>"/srv/http", :nobody=>"/", :dbus=>"/", :"systemd-journal-remote"=>"/", :"systemd-network"=>"/", :"systemd-resolve"=>"/", :"systemd-timesync"=>"/", :"systemd-c...
1101
-
1102
- # File: user.rb | Line: 296
1103
- # Definition: def homes_by_uid(id = get_uid)
1104
- LinuxStat::User.homes_by_uid(id)
1105
- => ["/home/sourav"]
1106
-
1107
- # File: user.rb | Line: 25
1108
- # Definition: def ids
1109
- LinuxStat::User.ids()
1110
- => {:root=>{:uid=>0, :gid=>0}, :bin=>{:uid=>1, :gid=>1}, :daemon=>{:uid=>2, :gid=>2}, :mail=>{:uid=>8, :gid=>12}, :ftp=>{:uid=>14, :gid=>11}, :http=>{:uid=>33, :gid=>33}, :nobody=>{:uid=>65534, :gid=>65534}, :dbus=>{:uid=>81, :gid=>81}, :"systemd-journal...
1111
-
1112
- # File: user.rb | Line: 13
1113
- # Definition: def list
1114
- LinuxStat::User.list()
1115
- => ["root", "bin", "daemon", "mail", "ftp", "http", "nobody", "dbus", "systemd-journal-remote", "systemd-network", "systemd-resolve", "systemd-timesync", "systemd-coredump", "uuidd", "avahi", "colord", "git", "lxdm", "polkitd", "rtkit", "usbmux", "sourav...
1116
-
1117
- # File: user.rb | Line: 247
1118
- # Definition: def uid_by_username(username = get_user)
1119
- LinuxStat::User.uid_by_username(username)
1120
- => 1000
1121
-
1122
- # File: user.rb | Line: 42
1123
- # Definition: def uids
1124
- LinuxStat::User.uids()
1125
- => {:root=>0, :bin=>1, :daemon=>2, :mail=>8, :ftp=>14, :http=>33, :nobody=>65534, :dbus=>81, :"systemd-journal-remote"=>982, :"systemd-network"=>981, :"systemd-resolve"=>980, :"systemd-timesync"=>979, :"systemd-coredump"=>978, :uuidd=>68, :avahi=>977, :c...
1126
-
1127
- # File: user.rb | Line: 190
1128
- # Definition: def username_by_gid(gid = get_gid)
1129
- LinuxStat::User.username_by_gid(gid)
1130
- => "sourav"
1131
-
1132
- # File: user.rb | Line: 172
1133
- # Definition: def usernames_by_uid(uid = get_uid)
1134
- LinuxStat::User.usernames_by_uid(uid)
1135
- => ["sourav"]
1136
-
1137
- ```
107
+ For ease of use, LinuxStat is also assigned to the LS constant.
108
+ So LinuxStat::USB can be replaced with LS::USB for example.
109
+
110
+ | LinuxStat Module | Description |
111
+ |:---|:---|
112
+ | [LinuxStat::BIOS](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatbios) | System's BIOS related informaion |
113
+ | [LinuxStat::Battery](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatbattery) | System's first Battery realted information |
114
+ | [LinuxStat::CPU](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatcpu) | System's CPU usage and other related information |
115
+ | [LinuxStat::FS](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatfs) | System's file system related information. It's used by Filesystem module. |
116
+ | [LinuxStat::Filesystem](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatfilesystem) | System's file system usage and other related information |
117
+ | [LinuxStat::Kernel](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatkernel) | System's kernel related information |
118
+ | [LinuxStat::Memory](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatmemory) | System's memory (RAM) usage and other related information |
119
+ | [LinuxStat::Mounts](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatmounts) | System's mount point related information |
120
+ | [LinuxStat::Net](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatnet) | System's internet usage and other information |
121
+ | [LinuxStat::OS](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatos) | System's OS related information and parse release files |
122
+ | [LinuxStat::PCI](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatpci) | System's PCI device related information (optional parsing of hwdata) |
123
+ | [LinuxStat::PrettifyBytes](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatprettifybytes) | Convert bytes into human readable format (kB, kiB, etc.) |
124
+ | [LinuxStat::ProcFS](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatprocfs) | Read proc file system in C for faster access. Used accross |
125
+ | [LinuxStat::Process](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatprocess) | System's processes and related information |
126
+ | [LinuxStat::ProcessInfo](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatprocessinfo) | System's single process CPU, memory usages, CPU time, etc. info |
127
+ | [LinuxStat::Swap](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatswap) | System's swap related information |
128
+ | [LinuxStat::Sysconf](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatsysconf) | Used by other LinuxStat modules, provides various system details like pagesize, max children, open files, etc |
129
+ | [LinuxStat::Sysinfo](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatsysinfo) | Used by other LinuxStat modules, faster access to information like totalram, freeram, totalhigh, load average, etc. |
130
+ | [LinuxStat::Thermal](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatthermal) | System's thermal status, fan related info, sensor count, fan count, etc. |
131
+ | [LinuxStat::USB](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatusb) | System's USB device related information and other counts (optional parsing of hwdata) |
132
+ | [LinuxStat::Uname](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatuname) | Used by other LinuxStat modules, System's Uname information in C, that's also provided by the `uname` command. |
133
+ | [LinuxStat::User](https://github.com/Souravgoswami/linux_stat/blob/master/Usages.md#linuxstatuser) | Systems' various user related information, provides current user name, home directory, etc. |
1138
134
 
1139
135
  ---
1140
136
 
137
+ # Notes
138
+
1141
139
  ## Note 1: CPU usage, and Net usage
1142
140
  To calculate the current usage, we need to get two usages at a given interval, and subtract the 2nd from the 1st.
1143
141
  For example, if the current download (`LinuxStat::Net.total_bytes_received`) is 1000 bytes, and if 0.1 seconds ago, it was 100 bytes, that means 900 bytes was received in 0.1 seconds.
@@ -1770,3 +768,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/Sourav
1770
768
  ## License
1771
769
 
1772
770
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
771
+
772
+ ## Languages
773
+
774
+ <img src="https://linuxstatloc.herokuapp.com/svg" width="260px">