linux_stat 2.0.1 → 2.2.1

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: b1292d974695e1622fd5ca04cd91393b325a8acd4116727498b077b74b530aa6
4
- data.tar.gz: ba39825500d32ebaafa6d0a6176901c34e9abc98ea747f6035f4731db9ed1818
3
+ metadata.gz: 7a2257dd9d025a05cf31fbfdf06d67933abd1d355678fe23c0ab1d5797fce9e9
4
+ data.tar.gz: 3898fa563cda7716321f689a64448afb0b46bb7ba1c9bac297c9f3ba0e9e4f38
5
5
  SHA512:
6
- metadata.gz: 4ae4eed738ade10f5aa8202a6552c9a4e05d2e8ba22c6f2e6f2b8f5f59a38f057befe3f2b5cef4302917ba04477c21a5fedf34538cca32256dea55df408dcee5
7
- data.tar.gz: 1569d7d670cb488b10fac97f0bfcf9c8e6c9ce3ff997524dc478e5a762e7806bbf84fb06e31f4c7376ef0c2f48e6b08f5f27671abdc5c7d54e041971ca17da64
6
+ metadata.gz: 5b6fede8da5d7a14322253c8c108b56069f0d3089349f23a9b7c207500c240b8a855a847dc9de649797da81466e449911609f3308473a4d8f5c32c1d0622cf46
7
+ data.tar.gz: 0f61a61920ca364cba0b3e664ff67bab7fcbf45d3d47eaea622b71b2fde7585cb761025f1b02d8f7e80ea0105b66541432cdb7ca12594938a6d5f04c0d648b05
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,1050 +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: 186
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.538
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"=>1980781, "cpu1"=>2000008, "cpu2"=>1760131, "cpu3"=>2000064}
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=>9.52, 1=>16.67, 2=>16.67, 3=>0.0, 4=>0.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
- => 0.0
251
-
252
- # File: cpu.rb | Line: 65
253
- # Definition: def total_usage(sleep = ticks_to_ms_t5)
254
- LinuxStat::CPU.usage(sleep)
255
- => 5.0
256
-
257
- # File: cpu.rb | Line: 25
258
- # Definition: def stat(sleep = ticks_to_ms_t5)
259
- LinuxStat::CPU.usages(sleep)
260
- => {0=>5.26, 1=>20.0, 2=>0.0, 3=>0.0, 4=>0.0}
261
-
262
- ```
263
-
264
- ### LinuxStat::FS
265
- ```
266
- LinuxStat::FS.stat(arg = "/")
267
- => {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>8714668, :block_avail_unpriv=>8714668, :inodes=>58612160, :free_inodes=>56817750, :filesystem_id=>2050, :mount_flags=>1024, :max_filename_length=>255}
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
- => 35695280128
277
-
278
- # File: filesystem.rb | Line: 60
279
- # Definition: def free(fs = ?..freeze)
280
- LinuxStat::Filesystem.free(fs)
281
- => 35695280128
282
-
283
- # File: filesystem.rb | Line: 21
284
- # Definition: def stat(fs = ?..freeze)
285
- LinuxStat::Filesystem.stat(fs)
286
- => {:total=>119981191168, :free=>35695280128, :used=>84285911040}
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=>8714668, :block_avail_unpriv=>8714668, :inodes=>58612160, :free_inodes=>56817750, :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
- => 84285911040
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
- => 1155372
365
-
366
- # File: memory.rb | Line: 52
367
- # Definition: def free
368
- LinuxStat::Memory.free()
369
- => 261316
370
-
371
- # File: memory.rb | Line: 93
372
- # Definition: def percent_available
373
- LinuxStat::Memory.percent_available()
374
- => 30.12
375
-
376
- # File: memory.rb | Line: 82
377
- # Definition: def percent_used
378
- LinuxStat::Memory.percent_used()
379
- => 69.88
380
-
381
- # File: memory.rb | Line: 13
382
- # Definition: def stat
383
- LinuxStat::Memory.stat()
384
- => {:total=>3836228, :used=>2680856, :available=>1155372, :percent_used=>69.88, :percent_available=>30.12}
385
-
386
- # File: memory.rb | Line: 42
387
- # Definition: def total
388
- LinuxStat::Memory.total()
389
- => 3836228
390
-
391
- # File: memory.rb | Line: 72
392
- # Definition: def used
393
- LinuxStat::Memory.used()
394
- => 2680856
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=>35695280128, :available=>35695280128, :used=>84285911040, :percent_used=>70.25, :percent_free=>29.75, :percent_available=>29.75}
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=1892888k,nr_inodes=473222,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/perf_event", "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=>2805500.0, :transmitted=>127290.0}
458
-
459
- # File: net.rb | Line: 12
460
- # Definition: def ipv4_private
461
- LinuxStat::Net.ipv4_private()
462
- => "192.168.0.103"
463
-
464
- # File: net.rb | Line: 27
465
- # Definition: def total_bytes
466
- LinuxStat::Net.total_bytes()
467
- => {:received=>1312151997, :transmitted=>81641336}
468
-
469
- # File: net.rb | Line: 45
470
- # Definition: def total_bytes_received
471
- LinuxStat::Net.total_bytes_received()
472
- => 1312151997
473
-
474
- # File: net.rb | Line: 58
475
- # Definition: def total_bytes_transmitted
476
- LinuxStat::Net.total_bytes_transmitted()
477
- => 81641336
478
-
479
- # File: net.rb | Line: 86
480
- # Definition: def usage(interval = 0.1)
481
- LinuxStat::Net.usage(interval)
482
- => {:received=>2971440.0, :transmitted=>80020.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=>2.78173828125, 5=>2.96923828125, 15=>2.40185546875}
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=>5, :minute=>33, :second=>59.77}
537
-
538
- # File: os.rb | Line: 174
539
- # Definition: def uptime_f
540
- LinuxStat::OS.uptime_f()
541
- => 20039.77
542
-
543
- # File: os.rb | Line: 185
544
- # Definition: def uptime_i
545
- LinuxStat::OS.uptime_i()
546
- => 20040
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 = 388183402613652, precision:)
599
- => "353.05 tebibytes"
600
-
601
- # File: prettify_bytes.rb | Line: 26
602
- # Definition: def convert_decimal(n, precision: 2)
603
- LinuxStat::PrettifyBytes.convert_decimal(n = 937555692903085, precision:)
604
- => "937.56 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 = 542625870963586, precision:)
609
- => "493.52 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 = 861937756585891, precision:)
614
- => "861.94 TB"
615
-
616
- ```
617
-
618
- ### LinuxStat::ProcFS
619
- ```
620
- LinuxStat::ProcFS.last_pid()
621
- => 12587
622
-
623
- LinuxStat::ProcFS.uptime_f()
624
- => 20039.98
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
- => 190
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, 135, 140, 165, 167, 170, 171, 175, 180, 181, 182, 183, 184, 185, 186, 188, 225, 232, 234, 270, 415, 419, 422, 10749, 11032, 11078, 11124, 11128,...
644
-
645
- # File: process.rb | Line: 160
646
- # Definition: def last_pid
647
- LinuxStat::Process.last_pid()
648
- => 12587
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-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...
659
-
660
- # File: process.rb | Line: 138
661
- # Definition: def running
662
- LinuxStat::Process.running()
663
- => [12583]
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, 164, 166, 189, 217, 233, 235, 307, 310, 311, 312, 313, 418, 420, 421, 424, 426, 429, 444, 447, 450, 481,...
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
103
 
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}
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.
708
106
 
709
- # File: process_info.rb | Line: 340
710
- # Definition: def cpu_usage(pid: $$, sleep: ticks_to_ms_t5)
711
- LinuxStat::ProcessInfo.cpu_usage(pid:, sleep:)
712
- => 0.0
713
-
714
- # File: process_info.rb | Line: 496
715
- # Definition: def gid(pid = $$)
716
- LinuxStat::ProcessInfo.gid(pid)
717
- => {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
718
-
719
- # File: process_info.rb | Line: 462
720
- # Definition: def last_executed_cpu(pid = $$)
721
- LinuxStat::ProcessInfo.last_executed_cpu(pid)
722
- => 1
723
-
724
- # File: process_info.rb | Line: 151
725
- # Definition: def mem_stat(pid = $$)
726
- LinuxStat::ProcessInfo.mem_stat(pid)
727
- => {:memory=>24576000, :virtual_memory=>96206848, :resident_memory=>30736384, :shared_memory=>6160384}
728
-
729
- # File: process_info.rb | Line: 171
730
- # Definition: def memory(pid = $$)
731
- LinuxStat::ProcessInfo.memory(pid)
732
- => 24576.0
733
-
734
- # File: process_info.rb | Line: 624
735
- # Definition: def nice(pid = $$)
736
- LinuxStat::ProcessInfo.nice(pid)
737
- => 0
738
-
739
- # File: process_info.rb | Line: 654
740
- # Definition: def nproc(pid = $$)
741
- LinuxStat::ProcessInfo.nproc(pid)
742
- => 4
743
-
744
- # File: process_info.rb | Line: 517
745
- # Definition: def owner(pid = $$)
746
- LinuxStat::ProcessInfo.owner(pid)
747
- => "sourav"
748
-
749
- # File: process_info.rb | Line: 112
750
- # Definition: def process_name(pid = $$)
751
- LinuxStat::ProcessInfo.process_name(pid)
752
- => "linuxstat.rb"
753
-
754
- # File: process_info.rb | Line: 213
755
- # Definition: def resident_memory(pid = $$)
756
- LinuxStat::ProcessInfo.resident_memory(pid)
757
- => 30736.384
758
-
759
- # File: process_info.rb | Line: 586
760
- # Definition: def running_time(pid = $$)
761
- LinuxStat::ProcessInfo.running_time(pid)
762
- => 1.02
763
-
764
- # File: process_info.rb | Line: 234
765
- # Definition: def shared_memory(pid = $$)
766
- LinuxStat::ProcessInfo.shared_memory(pid)
767
- => 6160.384
768
-
769
- # File: process_info.rb | Line: 567
770
- # Definition: def start_time(pid = $$)
771
- LinuxStat::ProcessInfo.start_time(pid)
772
- => 2021-02-01 16:58:34 +0530
773
-
774
- # File: process_info.rb | Line: 539
775
- # Definition: def start_time_epoch(pid = $$)
776
- LinuxStat::ProcessInfo.start_time_epoch(pid)
777
- => 1612178914
778
-
779
- # File: process_info.rb | Line: 611
780
- # Definition: def state(pid = $$)
781
- LinuxStat::ProcessInfo.state(pid)
782
- => "R"
783
-
784
- # File: process_info.rb | Line: 392
785
- # Definition: def thread_usage(pid: $$, sleep: ticks_to_ms_t5)
786
- LinuxStat::ProcessInfo.thread_usage(pid:, sleep:)
787
- => 0.0
788
-
789
- # File: process_info.rb | Line: 441
790
- # Definition: def threads(pid = $$)
791
- LinuxStat::ProcessInfo.threads(pid)
792
- => 1
793
-
794
- # File: process_info.rb | Line: 30
795
- # Definition: def total_io(pid = $$)
796
- LinuxStat::ProcessInfo.total_io(pid)
797
- => {:read_bytes=>1245184, :write_bytes=>0}
798
-
799
- # File: process_info.rb | Line: 472
800
- # Definition: def uid(pid = $$)
801
- LinuxStat::ProcessInfo.uid(pid)
802
- => {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
803
-
804
- # File: process_info.rb | Line: 192
805
- # Definition: def virtual_memory(pid = $$)
806
- LinuxStat::ProcessInfo.virtual_memory(pid)
807
- => 96206.848
808
-
809
- ```
810
-
811
- ### LinuxStat::Swap
812
- ```
813
- # File: swap.rb | Line: 24
814
- # Definition: def any?
815
- LinuxStat::Swap.any?()
816
- => true
817
-
818
- # File: swap.rb | Line: 81
819
- # Definition: def available
820
- LinuxStat::Swap.available()
821
- => 3856636
822
-
823
- # File: swap.rb | Line: 70
824
- # Definition: def free
825
- LinuxStat::Swap.free()
826
- => 3856636
827
-
828
- # File: swap.rb | Line: 10
829
- # Definition: def list
830
- LinuxStat::Swap.list()
831
- => {"/dev/zram0"=>[:partition, 4194300, 337664, -2]}
832
-
833
- # File: swap.rb | Line: 116
834
- # Definition: def percent_available
835
- LinuxStat::Swap.percent_available()
836
- => 91.95
837
-
838
- # File: swap.rb | Line: 102
839
- # Definition: def percent_used
840
- LinuxStat::Swap.percent_used()
841
- => 8.05
842
-
843
- # File: swap.rb | Line: 34
844
- # Definition: def stat
845
- LinuxStat::Swap.stat()
846
- => {:total=>4194300, :used=>337664, :available=>3856636, :percent_used=>8.05, :percent_available=>91.95}
847
-
848
- # File: swap.rb | Line: 59
849
- # Definition: def total
850
- LinuxStat::Swap.total()
851
- => 4194300
852
-
853
- # File: swap.rb | Line: 93
854
- # Definition: def used
855
- LinuxStat::Swap.used()
856
- => 337664
857
-
858
- ```
859
-
860
- ### LinuxStat::Sysconf
861
- ```
862
- LinuxStat::Sysconf.child_max()
863
- => 14788
864
-
865
- LinuxStat::Sysconf.expr_nest_max()
866
- => 32
867
-
868
- LinuxStat::Sysconf.get_euid()
869
- => 1000
870
-
871
- LinuxStat::Sysconf.get_gid()
872
- => 1000
873
-
874
- LinuxStat::Sysconf.get_login()
875
- => "sourav"
876
-
877
- LinuxStat::Sysconf.get_uid()
878
- => 1000
879
-
880
- LinuxStat::Sysconf.get_user()
881
- => "sourav"
882
-
883
- LinuxStat::Sysconf.hostname()
884
- => "archlinux"
885
-
886
- LinuxStat::Sysconf.hostname_max()
887
- => 64
888
-
889
- LinuxStat::Sysconf.line_max()
890
- => 2048
891
-
892
- LinuxStat::Sysconf.login_name_max()
893
- => 256
894
-
895
- LinuxStat::Sysconf.open_max()
896
- => 1024
897
-
898
- LinuxStat::Sysconf.pagesize()
899
- => 4096
900
-
901
- LinuxStat::Sysconf.posix_version()
902
- => 200809
903
-
904
- LinuxStat::Sysconf.processor_configured()
905
- => 4
906
-
907
- LinuxStat::Sysconf.processor_online()
908
- => 4
909
-
910
- LinuxStat::Sysconf.sc_clk_tck()
911
- => 100
912
-
913
- LinuxStat::Sysconf.stream_max()
914
- => 16
915
-
916
- LinuxStat::Sysconf.tty_name_max()
917
- => 32
918
-
919
- ```
920
-
921
- ### LinuxStat::Sysinfo
922
- ```
923
- LinuxStat::Sysinfo.bufferram()
924
- => 4096
925
-
926
- LinuxStat::Sysinfo.freehigh()
927
- => 0
928
-
929
- LinuxStat::Sysinfo.freeram()
930
- => 251408384
931
-
932
- LinuxStat::Sysinfo.freeswap()
933
- => 3949195264
934
-
935
- LinuxStat::Sysinfo.loads()
936
- => [2.78173828125, 2.96923828125, 2.40185546875]
937
-
938
- LinuxStat::Sysinfo.sharedram()
939
- => 606461952
940
-
941
- LinuxStat::Sysinfo.stat()
942
- => {:totalram=>3928297472, :freeram=>251408384, :sharedram=>606461952, :bufferram=>4096, :totalswap=>4294963200, :freeswap=>3949195264, :totalhigh=>0, :freehigh=>0, :uptime=>20041, :loads=>[2.78173828125, 2.96923828125, 2.40185546875]}
943
-
944
- LinuxStat::Sysinfo.totalhigh()
945
- => 0
946
-
947
- LinuxStat::Sysinfo.totalram()
948
- => 3928297472
949
-
950
- LinuxStat::Sysinfo.totalswap()
951
- => 4294963200
952
-
953
- LinuxStat::Sysinfo.uptime()
954
- => 20041
955
-
956
- ```
957
-
958
- ### LinuxStat::Thermal
959
- ```
960
- # File: thermal.rb | Line: 59
961
- # Definition: def count_fans
962
- LinuxStat::Thermal.count_fans()
963
- => 1
964
-
965
- # File: thermal.rb | Line: 49
966
- # Definition: def count_sensors
967
- LinuxStat::Thermal.count_sensors()
968
- => 8
969
-
970
- # File: thermal.rb | Line: 41
971
- # Definition: def fans
972
- LinuxStat::Thermal.fans()
973
- => [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Processor Fan", :rpm=>2785}]
974
-
975
- # File: thermal.rb | Line: 23
976
- # Definition: def temperatures
977
- LinuxStat::Thermal.temperatures()
978
- => [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"SODIMM", :temperature=>34.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"CPU", :temperature=>43.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Ambi...
979
-
980
- ```
981
-
982
- ### LinuxStat::USB
983
- ```
984
- # File: usb.rb | Line: 139
985
- # Definition: def count
986
- LinuxStat::USB.count()
987
- => 10
988
-
989
- # File: usb.rb | Line: 139
990
- # Definition: def count
991
- LinuxStat::USB.count_devices()
992
- => 10
993
-
994
- # File: usb.rb | Line: 49
995
- # Definition: def devices_stat(hwdata: true)
996
- LinuxStat::USB.devices_stat(hwdata:)
997
- => [{:path=>"/sys/bus/usb/devices/1-1.2/", :id=>"04d9:1203", :vendor_id=>"04d9", :product_id=>"1203", :bus_num=>1, :dev_num=>7, :hwdata=>{:vendor=>"Holtek Semiconductor, Inc.", :product=>"Keyboard"}, :authorized=>true, :b_max_power=>"100mA", :b_max_packe...
998
-
999
- # File: usb.rb | Line: 179
1000
- # Definition: def hwdata_file
1001
- LinuxStat::USB.hwdata_file()
1002
- => "/usr/share/hwdata/usb.ids"
1003
-
1004
- # File: usb.rb | Line: 168
1005
- # Definition: def hwdata_file_set?
1006
- LinuxStat::USB.hwdata_file_set?()
1007
- => true
1008
-
1009
- # File: usb.rb | Line: 195
1010
- # Definition: def initialize_hwdata
1011
- LinuxStat::USB.initialize_hwdata()
1012
- => false
1013
-
1014
- ```
1015
-
1016
- ### LinuxStat::Uname
1017
- ```
1018
- LinuxStat::Uname.machine()
1019
- => "x86_64"
1020
-
1021
- LinuxStat::Uname.nodename()
1022
- => "archlinux"
1023
-
1024
- LinuxStat::Uname.release()
1025
- => "5.9.9-xanmod1-1"
1026
-
1027
- LinuxStat::Uname.sysname()
1028
- => "Linux"
1029
-
1030
- LinuxStat::Uname.version()
1031
- => "#1 SMP PREEMPT Fri, 20 Nov 2020 07:44:55 +0000"
1032
-
1033
- ```
1034
-
1035
- ### LinuxStat::User
1036
- ```
1037
- # File: user.rb | Line: 101
1038
- # Definition: def get_user
1039
- LinuxStat::User.get_current_user()
1040
- => "sourav"
1041
-
1042
- # File: user.rb | Line: 140
1043
- # Definition: def get_euid
1044
- LinuxStat::User.get_euid()
1045
- => 1000
1046
-
1047
- # File: user.rb | Line: 132
1048
- # Definition: def get_gid
1049
- LinuxStat::User.get_gid()
1050
- => 1000
1051
-
1052
- # File: user.rb | Line: 155
1053
- # Definition: def get_login
1054
- LinuxStat::User.get_login()
1055
- => "sourav"
1056
-
1057
- # File: user.rb | Line: 124
1058
- # Definition: def get_uid
1059
- LinuxStat::User.get_uid()
1060
- => 1000
1061
-
1062
- # File: user.rb | Line: 101
1063
- # Definition: def get_user
1064
- LinuxStat::User.get_user()
1065
- => "sourav"
1066
-
1067
- # File: user.rb | Line: 218
1068
- # Definition: def gid_by_username(username = get_user)
1069
- LinuxStat::User.gid_by_username(username)
1070
- => 1000
1071
-
1072
- # File: user.rb | Line: 58
1073
- # Definition: def gids
1074
- LinuxStat::User.gids()
1075
- => {: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, :...
1076
-
1077
- # File: user.rb | Line: 317
1078
- # Definition: def home_by_gid(id = get_gid)
1079
- LinuxStat::User.home_by_gid(id)
1080
- => "/home/sourav"
1081
-
1082
- # File: user.rb | Line: 269
1083
- # Definition: def home_by_username(user = get_user)
1084
- LinuxStat::User.home_by_username(user)
1085
- => "/home/sourav"
1086
-
1087
- # File: user.rb | Line: 75
1088
- # Definition: def home_directories
1089
- LinuxStat::User.home_directories()
1090
- => {: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...
1091
-
1092
- # File: user.rb | Line: 296
1093
- # Definition: def homes_by_uid(id = get_uid)
1094
- LinuxStat::User.homes_by_uid(id)
1095
- => ["/home/sourav"]
1096
-
1097
- # File: user.rb | Line: 25
1098
- # Definition: def ids
1099
- LinuxStat::User.ids()
1100
- => {: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...
1101
-
1102
- # File: user.rb | Line: 13
1103
- # Definition: def list
1104
- LinuxStat::User.list()
1105
- => ["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...
1106
-
1107
- # File: user.rb | Line: 247
1108
- # Definition: def uid_by_username(username = get_user)
1109
- LinuxStat::User.uid_by_username(username)
1110
- => 1000
1111
-
1112
- # File: user.rb | Line: 42
1113
- # Definition: def uids
1114
- LinuxStat::User.uids()
1115
- => {: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...
1116
-
1117
- # File: user.rb | Line: 190
1118
- # Definition: def username_by_gid(gid = get_gid)
1119
- LinuxStat::User.username_by_gid(gid)
1120
- => "sourav"
1121
-
1122
- # File: user.rb | Line: 172
1123
- # Definition: def usernames_by_uid(uid = get_uid)
1124
- LinuxStat::User.usernames_by_uid(uid)
1125
- => ["sourav"]
1126
-
1127
- ```
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. |
1128
134
 
1129
135
  ---
1130
136
 
137
+ # Notes
138
+
1131
139
  ## Note 1: CPU usage, and Net usage
1132
140
  To calculate the current usage, we need to get two usages at a given interval, and subtract the 2nd from the 1st.
1133
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.
@@ -1760,3 +768,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/Sourav
1760
768
  ## License
1761
769
 
1762
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">