linux_stat 1.2.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +275 -231
- data/exe/linuxstat.rb +15 -15
- data/lib/linux_stat.rb +1 -0
- data/lib/linux_stat/battery.rb +2 -0
- data/lib/linux_stat/bios.rb +2 -0
- data/lib/linux_stat/cpu.rb +2 -0
- data/lib/linux_stat/filesystem.rb +2 -0
- data/lib/linux_stat/kernel.rb +2 -0
- data/lib/linux_stat/memory.rb +9 -7
- data/lib/linux_stat/mounts.rb +5 -3
- data/lib/linux_stat/net.rb +6 -4
- data/lib/linux_stat/os.rb +3 -1
- data/lib/linux_stat/pci.rb +61 -56
- data/lib/linux_stat/prettify_bytes.rb +16 -9
- data/lib/linux_stat/process.rb +95 -28
- data/lib/linux_stat/process_info.rb +93 -25
- data/lib/linux_stat/swap.rb +6 -4
- data/lib/linux_stat/thermal.rb +122 -0
- data/lib/linux_stat/usb.rb +52 -47
- data/lib/linux_stat/user.rb +6 -3
- data/lib/linux_stat/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 219b1bdf4ab0f8c62143e6b8c28059966baa28c33323bf65c718614446377513
|
4
|
+
data.tar.gz: 3f38dede32f96b80b74311468524e20e07a87184cbaf55ccbc8c899a86a20eb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0a08fd12c22370baf0080845e64ec8d0ea027d575b238ee02bb1b9dc5e193d12f5c9f3d705490a2ef9824e839dffa549d6840c21b434d08bcae58f1e135768d
|
7
|
+
data.tar.gz: f47e5f32f8cac9d4aa5dbb5510f85d8acde8d81c849da28a097ab07cd551cefc2e8c567047a16a4741ab49301d9adf8e33557423b60675b6434514bde831e407
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ It only works for Linux, and detecting the OS is upto the user of this gem.
|
|
12
12
|
|
13
13
|
Languages Used:
|
14
14
|
|
15
|
-
<img src="https://linuxstatloc.herokuapp.com/
|
15
|
+
<img src="https://linuxstatloc.herokuapp.com/svg" width="260px">
|
16
16
|
|
17
17
|
---
|
18
18
|
|
@@ -73,11 +73,15 @@ gem 'linux_stat'
|
|
73
73
|
|
74
74
|
And then execute:
|
75
75
|
|
76
|
-
|
76
|
+
```
|
77
|
+
$ bundle install
|
78
|
+
```
|
77
79
|
|
78
80
|
Or install it yourself as:
|
79
81
|
|
80
|
-
|
82
|
+
```
|
83
|
+
$ gem install linux_stat
|
84
|
+
```
|
81
85
|
|
82
86
|
## Usage
|
83
87
|
Following are the LinuxStat modules and module functions.
|
@@ -85,24 +89,25 @@ It's generated by linuxstat.rb command, which is available after the installatio
|
|
85
89
|
|
86
90
|
For ease of use, LinuxStat is also assigned to the LS constant.
|
87
91
|
|
92
|
+
### LinuxStat::BIOS
|
88
93
|
### LinuxStat::BIOS
|
89
94
|
```
|
90
|
-
# File: bios.rb | Line:
|
95
|
+
# File: bios.rb | Line: 58
|
91
96
|
# Definition: def date
|
92
97
|
LinuxStat::BIOS.date()
|
93
98
|
=> "04/10/2017"
|
94
99
|
|
95
|
-
# File: bios.rb | Line:
|
100
|
+
# File: bios.rb | Line: 12
|
96
101
|
# Definition: def model
|
97
102
|
LinuxStat::BIOS.model()
|
98
103
|
=> "Inspiron 5567"
|
99
104
|
|
100
|
-
# File: bios.rb | Line:
|
105
|
+
# File: bios.rb | Line: 29
|
101
106
|
# Definition: def vendor
|
102
107
|
LinuxStat::BIOS.vendor()
|
103
108
|
=> "Dell Inc."
|
104
109
|
|
105
|
-
# File: bios.rb | Line:
|
110
|
+
# File: bios.rb | Line: 44
|
106
111
|
# Definition: def version
|
107
112
|
LinuxStat::BIOS.version()
|
108
113
|
=> "1.1.2"
|
@@ -111,417 +116,417 @@ LinuxStat::BIOS.version()
|
|
111
116
|
|
112
117
|
### LinuxStat::Battery
|
113
118
|
```
|
114
|
-
# File: battery.rb | Line:
|
119
|
+
# File: battery.rb | Line: 107
|
115
120
|
# Definition: def charge
|
116
121
|
LinuxStat::Battery.charge()
|
117
122
|
=> 100.0
|
118
123
|
|
119
|
-
# File: battery.rb | Line:
|
124
|
+
# File: battery.rb | Line: 124
|
120
125
|
# Definition: def charge_full_design_wh
|
121
126
|
LinuxStat::Battery.charge_full_design_wh()
|
122
127
|
=> 42.0
|
123
128
|
|
124
|
-
# File: battery.rb | Line:
|
129
|
+
# File: battery.rb | Line: 143
|
125
130
|
# Definition: def charge_full_wh
|
126
131
|
LinuxStat::Battery.charge_full_wh()
|
127
132
|
=> 23.79
|
128
133
|
|
129
|
-
# File: battery.rb | Line:
|
134
|
+
# File: battery.rb | Line: 80
|
130
135
|
# Definition: def charging?
|
131
136
|
LinuxStat::Battery.charging?()
|
132
137
|
=> true
|
133
138
|
|
134
|
-
# File: battery.rb | Line:
|
139
|
+
# File: battery.rb | Line: 186
|
135
140
|
# Definition: def devices_stat
|
136
141
|
LinuxStat::Battery.devices_stat()
|
137
142
|
=> {: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....
|
138
143
|
|
139
|
-
# File: battery.rb | Line:
|
144
|
+
# File: battery.rb | Line: 89
|
140
145
|
# Definition: def discharging?
|
141
146
|
LinuxStat::Battery.discharging?()
|
142
147
|
=> false
|
143
148
|
|
144
|
-
# File: battery.rb | Line:
|
149
|
+
# File: battery.rb | Line: 98
|
145
150
|
# Definition: def full?
|
146
151
|
LinuxStat::Battery.full?()
|
147
152
|
=> true
|
148
153
|
|
149
|
-
# File: battery.rb | Line:
|
154
|
+
# File: battery.rb | Line: 49
|
150
155
|
# Definition: def manufacturer
|
151
156
|
LinuxStat::Battery.manufacturer()
|
152
157
|
=> "Samsung SDI"
|
153
158
|
|
154
|
-
# File: battery.rb | Line:
|
159
|
+
# File: battery.rb | Line: 38
|
155
160
|
# Definition: def model
|
156
161
|
LinuxStat::Battery.model()
|
157
162
|
=> "DELL CYMGM77"
|
158
163
|
|
159
|
-
# File: battery.rb | Line:
|
164
|
+
# File: battery.rb | Line: 10
|
160
165
|
# Definition: def present?
|
161
166
|
LinuxStat::Battery.present?()
|
162
167
|
=> true
|
163
168
|
|
164
|
-
# File: battery.rb | Line:
|
169
|
+
# File: battery.rb | Line: 18
|
165
170
|
# Definition: def stat
|
166
171
|
LinuxStat::Battery.stat()
|
167
172
|
=> {:model=>"DELL CYMGM77", :manufacturer=>"Samsung SDI", :technology=>"Li-ion", :status=>"Full", :charge=>100.0, :charging=>true, :discharging=>false, :full=>true}
|
168
173
|
|
169
|
-
# File: battery.rb | Line:
|
174
|
+
# File: battery.rb | Line: 70
|
170
175
|
# Definition: def status
|
171
176
|
LinuxStat::Battery.status()
|
172
177
|
=> "Full"
|
173
178
|
|
174
|
-
# File: battery.rb | Line:
|
179
|
+
# File: battery.rb | Line: 59
|
175
180
|
# Definition: def technology
|
176
181
|
LinuxStat::Battery.technology()
|
177
182
|
=> "Li-ion"
|
178
183
|
|
179
|
-
# File: battery.rb | Line:
|
184
|
+
# File: battery.rb | Line: 162
|
180
185
|
# Definition: def voltage_now
|
181
186
|
LinuxStat::Battery.voltage_now()
|
182
|
-
=> 12.
|
187
|
+
=> 12.537
|
183
188
|
|
184
189
|
```
|
185
190
|
|
186
191
|
### LinuxStat::CPU
|
187
192
|
```
|
188
|
-
# File: cpu.rb | Line:
|
193
|
+
# File: cpu.rb | Line: 289
|
189
194
|
# Definition: def available_governors
|
190
195
|
LinuxStat::CPU.available_governors()
|
191
196
|
=> {"cpu0"=>["performance", "powersave"], "cpu1"=>["performance", "powersave"], "cpu2"=>["performance", "powersave"], "cpu3"=>["performance", "powersave"]}
|
192
197
|
|
193
|
-
# File: cpu.rb | Line:
|
198
|
+
# File: cpu.rb | Line: 88
|
194
199
|
# Definition: def count
|
195
200
|
LinuxStat::CPU.count()
|
196
201
|
=> 4
|
197
202
|
|
198
|
-
# File: cpu.rb | Line:
|
203
|
+
# File: cpu.rb | Line: 105
|
199
204
|
# Definition: def count_online
|
200
205
|
LinuxStat::CPU.count_online()
|
201
206
|
=> 4
|
202
207
|
|
203
|
-
# File: cpu.rb | Line:
|
208
|
+
# File: cpu.rb | Line: 199
|
204
209
|
# Definition: def cur_freq
|
205
210
|
LinuxStat::CPU.cur_freq()
|
206
|
-
=> {"cpu0"=>
|
211
|
+
=> {"cpu0"=>1999901, "cpu1"=>1999408, "cpu2"=>2000039, "cpu3"=>2000019}
|
207
212
|
|
208
|
-
# File: cpu.rb | Line:
|
213
|
+
# File: cpu.rb | Line: 267
|
209
214
|
# Definition: def governor
|
210
215
|
LinuxStat::CPU.governor()
|
211
216
|
=> {"cpu0"=>"performance", "cpu1"=>"performance", "cpu2"=>"performance", "cpu3"=>"performance"}
|
212
217
|
|
213
|
-
# File: cpu.rb | Line:
|
218
|
+
# File: cpu.rb | Line: 243
|
214
219
|
# Definition: def max_freq
|
215
220
|
LinuxStat::CPU.max_freq()
|
216
221
|
=> {"cpu0"=>2000000, "cpu1"=>2000000, "cpu2"=>2000000, "cpu3"=>2000000}
|
217
222
|
|
218
|
-
# File: cpu.rb | Line:
|
223
|
+
# File: cpu.rb | Line: 221
|
219
224
|
# Definition: def min_freq
|
220
225
|
LinuxStat::CPU.min_freq()
|
221
226
|
=> {"cpu0"=>2000000, "cpu1"=>2000000, "cpu2"=>2000000, "cpu3"=>2000000}
|
222
227
|
|
223
|
-
# File: cpu.rb | Line:
|
228
|
+
# File: cpu.rb | Line: 186
|
224
229
|
# Definition: def model
|
225
230
|
LinuxStat::CPU.model()
|
226
231
|
=> "Intel(R) Core(TM) i3-6006U CPU @ 2.00GHz"
|
227
232
|
|
228
|
-
# File: cpu.rb | Line:
|
233
|
+
# File: cpu.rb | Line: 165
|
229
234
|
# Definition: def offline
|
230
235
|
LinuxStat::CPU.offline()
|
231
236
|
=> []
|
232
237
|
|
233
|
-
# File: cpu.rb | Line:
|
238
|
+
# File: cpu.rb | Line: 134
|
234
239
|
# Definition: def online
|
235
240
|
LinuxStat::CPU.online()
|
236
241
|
=> [0, 1, 2, 3]
|
237
242
|
|
238
|
-
# File: cpu.rb | Line:
|
243
|
+
# File: cpu.rb | Line: 25
|
239
244
|
# Definition: def stat(sleep = ticks_to_ms_t5)
|
240
245
|
LinuxStat::CPU.stat(sleep)
|
241
|
-
=> {0=>
|
246
|
+
=> {0=>27.78, 1=>20.0, 2=>25.0, 3=>25.0, 4=>40.0}
|
242
247
|
|
243
|
-
# File: cpu.rb | Line:
|
248
|
+
# File: cpu.rb | Line: 65
|
244
249
|
# Definition: def total_usage(sleep = ticks_to_ms_t5)
|
245
250
|
LinuxStat::CPU.total_usage(sleep)
|
246
|
-
=>
|
251
|
+
=> 25.0
|
247
252
|
|
248
|
-
# File: cpu.rb | Line:
|
253
|
+
# File: cpu.rb | Line: 65
|
249
254
|
# Definition: def total_usage(sleep = ticks_to_ms_t5)
|
250
255
|
LinuxStat::CPU.usage(sleep)
|
251
|
-
=>
|
256
|
+
=> 25.0
|
252
257
|
|
253
|
-
# File: cpu.rb | Line:
|
258
|
+
# File: cpu.rb | Line: 25
|
254
259
|
# Definition: def stat(sleep = ticks_to_ms_t5)
|
255
260
|
LinuxStat::CPU.usages(sleep)
|
256
|
-
=> {0=>
|
261
|
+
=> {0=>25.0, 1=>20.0, 2=>33.33, 3=>20.0, 4=>0.0}
|
257
262
|
|
258
263
|
```
|
259
264
|
|
260
265
|
### LinuxStat::FS
|
261
266
|
```
|
262
267
|
LinuxStat::FS.stat(arg = "/")
|
263
|
-
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>
|
268
|
+
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>7268389, :block_avail_unpriv=>7268389, :inodes=>58612160, :free_inodes=>56907397, :filesystem_id=>2050, :mount_flags=>1024, :max_filename_length=>255}
|
264
269
|
|
265
270
|
```
|
266
271
|
|
267
272
|
### LinuxStat::Filesystem
|
268
273
|
```
|
269
|
-
# File: filesystem.rb | Line:
|
274
|
+
# File: filesystem.rb | Line: 94
|
270
275
|
# Definition: def available(fs = ?..freeze)
|
271
276
|
LinuxStat::Filesystem.available(fs)
|
272
|
-
=>
|
277
|
+
=> 29771321344
|
273
278
|
|
274
|
-
# File: filesystem.rb | Line:
|
279
|
+
# File: filesystem.rb | Line: 60
|
275
280
|
# Definition: def free(fs = ?..freeze)
|
276
281
|
LinuxStat::Filesystem.free(fs)
|
277
|
-
=>
|
282
|
+
=> 29771321344
|
278
283
|
|
279
|
-
# File: filesystem.rb | Line:
|
284
|
+
# File: filesystem.rb | Line: 21
|
280
285
|
# Definition: def stat(fs = ?..freeze)
|
281
286
|
LinuxStat::Filesystem.stat(fs)
|
282
|
-
=> {:total=>119981191168, :free=>
|
287
|
+
=> {:total=>119981191168, :free=>29771321344, :used=>90209869824}
|
283
288
|
|
284
|
-
# File: filesystem.rb | Line:
|
289
|
+
# File: filesystem.rb | Line: 110
|
285
290
|
# Definition: def stat_raw(fs = ?..freeze)
|
286
291
|
LinuxStat::Filesystem.stat_raw(fs)
|
287
|
-
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>
|
292
|
+
=> {:block_size=>4096, :fragment_size=>4096, :blocks=>29292283, :block_free=>7268389, :block_avail_unpriv=>7268389, :inodes=>58612160, :free_inodes=>56907397, :filesystem_id=>2050, :mount_flags=>1024, :max_filename_length=>255}
|
288
293
|
|
289
|
-
# File: filesystem.rb | Line:
|
294
|
+
# File: filesystem.rb | Line: 41
|
290
295
|
# Definition: def total(fs = ?..freeze)
|
291
296
|
LinuxStat::Filesystem.total(fs)
|
292
297
|
=> 119981191168
|
293
298
|
|
294
|
-
# File: filesystem.rb | Line:
|
299
|
+
# File: filesystem.rb | Line: 75
|
295
300
|
# Definition: def used(fs = ?..freeze)
|
296
301
|
LinuxStat::Filesystem.used(fs)
|
297
|
-
=>
|
302
|
+
=> 90209869824
|
298
303
|
|
299
304
|
```
|
300
305
|
|
301
306
|
### LinuxStat::Kernel
|
302
307
|
```
|
303
|
-
# File: kernel.rb | Line:
|
308
|
+
# File: kernel.rb | Line: 88
|
304
309
|
# Definition: def build_date
|
305
310
|
LinuxStat::Kernel.build_date()
|
306
|
-
=> 2020-
|
311
|
+
=> 2020-11-20 07:44:55 +0000
|
307
312
|
|
308
|
-
# File: kernel.rb | Line:
|
313
|
+
# File: kernel.rb | Line: 142
|
309
314
|
# Definition: def build_date_string
|
310
315
|
LinuxStat::Kernel.build_date_string()
|
311
|
-
=> "
|
316
|
+
=> "20 Nov 2020 07:44:55 +0000"
|
312
317
|
|
313
|
-
# File: kernel.rb | Line:
|
318
|
+
# File: kernel.rb | Line: 23
|
314
319
|
# Definition: def build_user
|
315
320
|
LinuxStat::Kernel.build_user()
|
316
321
|
=> "souravgoswami@archlinux"
|
317
322
|
|
318
|
-
# File: kernel.rb | Line:
|
323
|
+
# File: kernel.rb | Line: 181
|
319
324
|
# Definition: def ticks
|
320
325
|
LinuxStat::Kernel.clk_tck()
|
321
326
|
=> 100
|
322
327
|
|
323
|
-
# File: kernel.rb | Line:
|
328
|
+
# File: kernel.rb | Line: 35
|
324
329
|
# Definition: def compiler
|
325
330
|
LinuxStat::Kernel.compiler()
|
326
331
|
=> [:gcc, "10.2.0"]
|
327
332
|
|
328
|
-
# File: kernel.rb | Line:
|
333
|
+
# File: kernel.rb | Line: 57
|
329
334
|
# Definition: def compiler_version
|
330
335
|
LinuxStat::Kernel.compiler_version()
|
331
336
|
=> "10.2.0"
|
332
337
|
|
333
|
-
# File: kernel.rb | Line:
|
338
|
+
# File: kernel.rb | Line: 12
|
334
339
|
# Definition: def version
|
335
340
|
LinuxStat::Kernel.release()
|
336
|
-
=> "5.
|
341
|
+
=> "5.9.9-xanmod1-1"
|
337
342
|
|
338
|
-
# File: kernel.rb | Line:
|
343
|
+
# File: kernel.rb | Line: 171
|
339
344
|
# Definition: def string
|
340
345
|
LinuxStat::Kernel.string()
|
341
|
-
=> "Linux version 5.
|
346
|
+
=> "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"
|
342
347
|
|
343
|
-
# File: kernel.rb | Line:
|
348
|
+
# File: kernel.rb | Line: 181
|
344
349
|
# Definition: def ticks
|
345
350
|
LinuxStat::Kernel.ticks()
|
346
351
|
=> 100
|
347
352
|
|
348
|
-
# File: kernel.rb | Line:
|
353
|
+
# File: kernel.rb | Line: 12
|
349
354
|
# Definition: def version
|
350
355
|
LinuxStat::Kernel.version()
|
351
|
-
=> "5.
|
356
|
+
=> "5.9.9-xanmod1-1"
|
352
357
|
|
353
358
|
```
|
354
359
|
|
355
360
|
### LinuxStat::Memory
|
356
361
|
```
|
357
|
-
# File: memory.rb | Line:
|
362
|
+
# File: memory.rb | Line: 52
|
358
363
|
# Definition: def available
|
359
364
|
LinuxStat::Memory.available()
|
360
|
-
=>
|
365
|
+
=> 337416
|
361
366
|
|
362
|
-
# File: memory.rb | Line:
|
367
|
+
# File: memory.rb | Line: 83
|
363
368
|
# Definition: def percent_available
|
364
369
|
LinuxStat::Memory.percent_available()
|
365
|
-
=>
|
370
|
+
=> 8.8
|
366
371
|
|
367
|
-
# File: memory.rb | Line:
|
372
|
+
# File: memory.rb | Line: 72
|
368
373
|
# Definition: def percent_used
|
369
374
|
LinuxStat::Memory.percent_used()
|
370
|
-
=>
|
375
|
+
=> 91.2
|
371
376
|
|
372
|
-
# File: memory.rb | Line:
|
377
|
+
# File: memory.rb | Line: 13
|
373
378
|
# Definition: def stat
|
374
379
|
LinuxStat::Memory.stat()
|
375
|
-
=> {:total=>
|
380
|
+
=> {:total=>3836228, :used=>3498812, :available=>337416, :percent_used=>91.2, :percent_available=>8.8}
|
376
381
|
|
377
|
-
# File: memory.rb | Line:
|
382
|
+
# File: memory.rb | Line: 42
|
378
383
|
# Definition: def total
|
379
384
|
LinuxStat::Memory.total()
|
380
|
-
=>
|
385
|
+
=> 3836228
|
381
386
|
|
382
|
-
# File: memory.rb | Line:
|
387
|
+
# File: memory.rb | Line: 62
|
383
388
|
# Definition: def used
|
384
389
|
LinuxStat::Memory.used()
|
385
|
-
=>
|
390
|
+
=> 3498812
|
386
391
|
|
387
392
|
```
|
388
393
|
|
389
394
|
### LinuxStat::Mounts
|
390
395
|
```
|
391
|
-
# File: mounts.rb | Line:
|
396
|
+
# File: mounts.rb | Line: 181
|
392
397
|
# Definition: def device_stat(dev = root)
|
393
398
|
LinuxStat::Mounts.device_stat(dev)
|
394
|
-
=> {:mountpoint=>"/", :total=>119981191168, :free=>
|
399
|
+
=> {:mountpoint=>"/", :total=>119981191168, :free=>29771321344, :available=>29771321344, :used=>90209869824, :percent_used=>75.19, :percent_free=>24.81, :percent_available=>24.81}
|
395
400
|
|
396
|
-
# File: mounts.rb | Line:
|
401
|
+
# File: mounts.rb | Line: 139
|
397
402
|
# Definition: def devices_stat
|
398
403
|
LinuxStat::Mounts.devices_stat()
|
399
404
|
=> {"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...
|
400
405
|
|
401
|
-
# File: mounts.rb | Line:
|
406
|
+
# File: mounts.rb | Line: 13
|
402
407
|
# Definition: def list
|
403
408
|
LinuxStat::Mounts.list()
|
404
|
-
=> ["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=
|
409
|
+
=> ["proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0", "sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0", "dev /dev devtmpfs rw,nosuid,relatime,size=1892888k,nr_inodes=473222,mode=755 0 0", "run /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0", "...
|
405
410
|
|
406
|
-
# File: mounts.rb | Line:
|
411
|
+
# File: mounts.rb | Line: 22
|
407
412
|
# Definition: def list_devices
|
408
413
|
LinuxStat::Mounts.list_devices()
|
409
|
-
=> ["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", "
|
414
|
+
=> ["proc", "sys", "dev", "run", "/dev/sda2", "securityfs", "tmpfs", "devpts", "tmpfs", "cgroup2", "cgroup", "pstore", "none", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "cgroup", "systemd-1", "deb...
|
410
415
|
|
411
|
-
# File: mounts.rb | Line:
|
416
|
+
# File: mounts.rb | Line: 111
|
412
417
|
# Definition: def list_devices_mount_point
|
413
418
|
LinuxStat::Mounts.list_devices_mount_point()
|
414
|
-
=> {"proc"=>"/proc", "sys"=>"/sys", "dev"=>"/dev", "run"=>"/run", "/dev/sda2"=>"/", "securityfs"=>"/sys/kernel/security", "tmpfs"=>"/run/user/
|
419
|
+
=> {"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"=>"...
|
415
420
|
|
416
|
-
# File: mounts.rb | Line:
|
421
|
+
# File: mounts.rb | Line: 82
|
417
422
|
# Definition: def mount_point(dev = root)
|
418
423
|
LinuxStat::Mounts.mount_point(dev)
|
419
424
|
=> "/"
|
420
425
|
|
421
|
-
# File: mounts.rb | Line:
|
426
|
+
# File: mounts.rb | Line: 31
|
422
427
|
# Definition: def root
|
423
428
|
LinuxStat::Mounts.root()
|
424
429
|
=> "/dev/sda2"
|
425
430
|
|
426
|
-
# File: mounts.rb | Line:
|
431
|
+
# File: mounts.rb | Line: 40
|
427
432
|
# Definition: def root_fs
|
428
433
|
LinuxStat::Mounts.root_fs()
|
429
434
|
=> "xfs"
|
430
435
|
|
431
|
-
# File: mounts.rb | Line:
|
436
|
+
# File: mounts.rb | Line: 49
|
432
437
|
# Definition: def root_mount_options
|
433
438
|
LinuxStat::Mounts.root_mount_options()
|
434
439
|
=> "rw,noatime,attr2,inode64,logbufs=8,logbsize=32k,noquota"
|
435
440
|
|
436
|
-
# File: mounts.rb | Line:
|
441
|
+
# File: mounts.rb | Line: 58
|
437
442
|
# Definition: def tmpfs
|
438
443
|
LinuxStat::Mounts.tmpfs()
|
439
|
-
=> {"/dev/shm"=>"tmpfs /dev/shm tmpfs rw,nosuid,nodev
|
444
|
+
=> {"/dev/shm"=>"tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0", "/sys/fs/cgroup"=>"tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755 0 0", "/ramdisk"=>"tmpfs /ramdisk tmpfs rw,nosuid,nodev,relatime,size=6291456k 0 0", "/tmp...
|
440
445
|
|
441
446
|
```
|
442
447
|
|
443
448
|
### LinuxStat::Net
|
444
449
|
```
|
445
|
-
# File: net.rb | Line:
|
450
|
+
# File: net.rb | Line: 86
|
446
451
|
# Definition: def usage(interval = 0.1)
|
447
452
|
LinuxStat::Net.current_usage(interval)
|
448
|
-
=> {:received=>
|
453
|
+
=> {:received=>0.0, :transmitted=>0.0}
|
449
454
|
|
450
|
-
# File: net.rb | Line:
|
455
|
+
# File: net.rb | Line: 12
|
451
456
|
# Definition: def ipv4_private
|
452
457
|
LinuxStat::Net.ipv4_private()
|
453
|
-
=> "192.168.
|
458
|
+
=> "192.168.43.107"
|
454
459
|
|
455
|
-
# File: net.rb | Line:
|
460
|
+
# File: net.rb | Line: 27
|
456
461
|
# Definition: def total_bytes
|
457
462
|
LinuxStat::Net.total_bytes()
|
458
|
-
=> {:received=>
|
463
|
+
=> {:received=>936112008, :transmitted=>141554101}
|
459
464
|
|
460
|
-
# File: net.rb | Line:
|
465
|
+
# File: net.rb | Line: 45
|
461
466
|
# Definition: def total_bytes_received
|
462
467
|
LinuxStat::Net.total_bytes_received()
|
463
|
-
=>
|
468
|
+
=> 936112008
|
464
469
|
|
465
|
-
# File: net.rb | Line:
|
470
|
+
# File: net.rb | Line: 58
|
466
471
|
# Definition: def total_bytes_transmitted
|
467
472
|
LinuxStat::Net.total_bytes_transmitted()
|
468
|
-
=>
|
473
|
+
=> 141554101
|
469
474
|
|
470
|
-
# File: net.rb | Line:
|
475
|
+
# File: net.rb | Line: 86
|
471
476
|
# Definition: def usage(interval = 0.1)
|
472
477
|
LinuxStat::Net.usage(interval)
|
473
|
-
=> {:received=>
|
478
|
+
=> {:received=>0.0, :transmitted=>0.0}
|
474
479
|
|
475
480
|
```
|
476
481
|
|
477
482
|
### LinuxStat::OS
|
478
483
|
```
|
479
|
-
# File: os.rb | Line:
|
484
|
+
# File: os.rb | Line: 129
|
480
485
|
# Definition: def bits
|
481
486
|
LinuxStat::OS.bits()
|
482
487
|
=> 64
|
483
488
|
|
484
|
-
# File: os.rb | Line:
|
489
|
+
# File: os.rb | Line: 84
|
485
490
|
# Definition: def version
|
486
491
|
LinuxStat::OS.distrib_version()
|
487
492
|
=> "rolling"
|
488
493
|
|
489
|
-
# File: os.rb | Line:
|
494
|
+
# File: os.rb | Line: 46
|
490
495
|
# Definition: def distribution
|
491
496
|
LinuxStat::OS.distribution()
|
492
497
|
=> "Arch Linux"
|
493
498
|
|
494
|
-
# File: os.rb | Line:
|
499
|
+
# File: os.rb | Line: 117
|
495
500
|
# Definition: def hostname
|
496
501
|
LinuxStat::OS.hostname()
|
497
502
|
=> "archlinux"
|
498
503
|
|
499
|
-
# File: os.rb | Line:
|
504
|
+
# File: os.rb | Line: 35
|
500
505
|
# Definition: def lsb_release
|
501
506
|
LinuxStat::OS.lsb_release()
|
502
507
|
=> {:LSB_VERSION=>"1.4", :DISTRIB_ID=>"Arch", :DISTRIB_RELEASE=>"rolling", :DISTRIB_DESCRIPTION=>"Arch Linux"}
|
503
508
|
|
504
|
-
# File: os.rb | Line:
|
509
|
+
# File: os.rb | Line: 100
|
505
510
|
# Definition: def machine
|
506
511
|
LinuxStat::OS.machine()
|
507
512
|
=> "x86_64"
|
508
513
|
|
509
|
-
# File: os.rb | Line:
|
514
|
+
# File: os.rb | Line: 108
|
510
515
|
# Definition: def nodename
|
511
516
|
LinuxStat::OS.nodename()
|
512
517
|
=> "archlinux"
|
513
518
|
|
514
|
-
# File: os.rb | Line:
|
519
|
+
# File: os.rb | Line: 19
|
515
520
|
# Definition: def os_release
|
516
521
|
LinuxStat::OS.os_release()
|
517
522
|
=> {: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/"...
|
518
523
|
|
519
|
-
# File: os.rb | Line:
|
524
|
+
# File: os.rb | Line: 144
|
520
525
|
# Definition: def uptime
|
521
526
|
LinuxStat::OS.uptime()
|
522
|
-
=> {:hour=>14, :minute=>
|
527
|
+
=> {:hour=>14, :minute=>8, :second=>42.08}
|
523
528
|
|
524
|
-
# File: os.rb | Line:
|
529
|
+
# File: os.rb | Line: 84
|
525
530
|
# Definition: def version
|
526
531
|
LinuxStat::OS.version()
|
527
532
|
=> "rolling"
|
@@ -530,37 +535,37 @@ LinuxStat::OS.version()
|
|
530
535
|
|
531
536
|
### LinuxStat::PCI
|
532
537
|
```
|
533
|
-
# File: pci.rb | Line:
|
538
|
+
# File: pci.rb | Line: 216
|
534
539
|
# Definition: def count
|
535
540
|
LinuxStat::PCI.count()
|
536
541
|
=> 13
|
537
542
|
|
538
|
-
# File: pci.rb | Line:
|
543
|
+
# File: pci.rb | Line: 216
|
539
544
|
# Definition: def count
|
540
545
|
LinuxStat::PCI.count_devices()
|
541
546
|
=> 13
|
542
547
|
|
543
|
-
# File: pci.rb | Line:
|
548
|
+
# File: pci.rb | Line: 54
|
544
549
|
# Definition: def devices_info(hwdata: true)
|
545
550
|
LinuxStat::PCI.devices_info(hwdata:)
|
546
551
|
=> [{: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...
|
547
552
|
|
548
|
-
# File: pci.rb | Line:
|
553
|
+
# File: pci.rb | Line: 130
|
549
554
|
# Definition: def devices_stat(hwdata: true)
|
550
555
|
LinuxStat::PCI.devices_stat(hwdata:)
|
551
556
|
=> [{: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...
|
552
557
|
|
553
|
-
# File: pci.rb | Line:
|
558
|
+
# File: pci.rb | Line: 264
|
554
559
|
# Definition: def hwdata_file
|
555
560
|
LinuxStat::PCI.hwdata_file()
|
556
561
|
=> "/usr/share/hwdata/pci.ids"
|
557
562
|
|
558
|
-
# File: pci.rb | Line:
|
563
|
+
# File: pci.rb | Line: 253
|
559
564
|
# Definition: def hwdata_file_set?
|
560
565
|
LinuxStat::PCI.hwdata_file_set?()
|
561
566
|
=> true
|
562
567
|
|
563
|
-
# File: pci.rb | Line:
|
568
|
+
# File: pci.rb | Line: 280
|
564
569
|
# Definition: def initialize_hwdata
|
565
570
|
LinuxStat::PCI.initialize_hwdata()
|
566
571
|
=> false
|
@@ -569,66 +574,76 @@ LinuxStat::PCI.initialize_hwdata()
|
|
569
574
|
|
570
575
|
### LinuxStat::PrettifyBytes
|
571
576
|
```
|
572
|
-
# File: prettify_bytes.rb | Line:
|
573
|
-
# Definition: def convert_binary(n)
|
574
|
-
LinuxStat::PrettifyBytes.convert_binary(n =
|
575
|
-
=> "
|
577
|
+
# File: prettify_bytes.rb | Line: 49
|
578
|
+
# Definition: def convert_binary(n, precision: 2)
|
579
|
+
LinuxStat::PrettifyBytes.convert_binary(n = 327222499582327, precision:)
|
580
|
+
=> "297.61 tebibytes"
|
576
581
|
|
577
|
-
# File: prettify_bytes.rb | Line:
|
578
|
-
# Definition: def convert_decimal(n)
|
579
|
-
LinuxStat::PrettifyBytes.convert_decimal(n =
|
580
|
-
=> "
|
582
|
+
# File: prettify_bytes.rb | Line: 26
|
583
|
+
# Definition: def convert_decimal(n, precision: 2)
|
584
|
+
LinuxStat::PrettifyBytes.convert_decimal(n = 812496332434396, precision:)
|
585
|
+
=> "812.50 terabytes"
|
581
586
|
|
582
|
-
# File: prettify_bytes.rb | Line:
|
583
|
-
# Definition: def convert_short_binary(n)
|
584
|
-
LinuxStat::PrettifyBytes.convert_short_binary(n =
|
585
|
-
=> "
|
587
|
+
# File: prettify_bytes.rb | Line: 97
|
588
|
+
# Definition: def convert_short_binary(n, precision: 2)
|
589
|
+
LinuxStat::PrettifyBytes.convert_short_binary(n = 447429857254915, precision:)
|
590
|
+
=> "406.94 TiB"
|
586
591
|
|
587
|
-
# File: prettify_bytes.rb | Line:
|
588
|
-
# Definition: def convert_short_decimal(n)
|
589
|
-
LinuxStat::PrettifyBytes.convert_short_decimal(n =
|
590
|
-
=> "
|
592
|
+
# File: prettify_bytes.rb | Line: 72
|
593
|
+
# Definition: def convert_short_decimal(n, precision: 2)
|
594
|
+
LinuxStat::PrettifyBytes.convert_short_decimal(n = 157028156498063, precision:)
|
595
|
+
=> "157.03 TB"
|
591
596
|
|
592
597
|
```
|
593
598
|
|
594
599
|
### LinuxStat::Process
|
595
600
|
```
|
596
|
-
# File: process.rb | Line:
|
601
|
+
# File: process.rb | Line: 57
|
602
|
+
# Definition: def cmdlines
|
603
|
+
LinuxStat::Process.cmdlines()
|
604
|
+
=> {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=>""...
|
605
|
+
|
606
|
+
# File: process.rb | Line: 29
|
597
607
|
# Definition: def count
|
598
608
|
LinuxStat::Process.count()
|
599
|
-
=>
|
609
|
+
=> 209
|
600
610
|
|
601
|
-
# File: process.rb | Line:
|
611
|
+
# File: process.rb | Line: 124
|
602
612
|
# Definition: def idle
|
603
613
|
LinuxStat::Process.idle()
|
604
|
-
=> [3, 4,
|
614
|
+
=> [3, 4, 6, 9, 12, 23, 30, 37, 39, 49, 102, 103, 104, 106, 107, 108, 109, 110, 117, 118, 119, 121, 131, 134, 140, 164, 166, 168, 169, 172, 174, 179, 180, 181, 182, 183, 184, 185, 186, 230, 234, 283, 418, 426, 428, 5731, 5732, 5733, 5734, 5735, 5736, 517...
|
605
615
|
|
606
|
-
# File: process.rb | Line:
|
616
|
+
# File: process.rb | Line: 11
|
607
617
|
# Definition: def list
|
608
618
|
LinuxStat::Process.list()
|
609
|
-
=> [1, 2, 3, 4,
|
619
|
+
=> [1, 2, 3, 4, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 46, 47, 48, 49, 50, 51, 52, 102, 103, 104, 106, 107, 108, 109, 110, 111, 114, 115, 117, 118, 119, 121, 131, 134,...
|
610
620
|
|
611
|
-
# File: process.rb | Line:
|
621
|
+
# File: process.rb | Line: 36
|
612
622
|
# Definition: def names
|
613
623
|
LinuxStat::Process.names()
|
614
|
-
=> {1=>"systemd", 2=>"kthreadd", 3=>"rcu_gp", 4=>"rcu_par_gp",
|
624
|
+
=> {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...
|
615
625
|
|
616
|
-
# File: process.rb | Line:
|
626
|
+
# File: process.rb | Line: 150
|
617
627
|
# Definition: def running
|
618
628
|
LinuxStat::Process.running()
|
619
|
-
=> [
|
629
|
+
=> [474, 628, 643, 55770]
|
620
630
|
|
621
|
-
# File: process.rb | Line:
|
631
|
+
# File: process.rb | Line: 111
|
622
632
|
# Definition: def sleeping
|
623
633
|
LinuxStat::Process.sleeping()
|
624
|
-
=> [1, 2, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 38, 40, 41, 42,
|
634
|
+
=> [1, 2, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 38, 40, 41, 42, 46, 47, 48, 50, 51, 52, 111, 114, 115, 163, 165, 187, 216, 233, 235, 349, 350, 352, 353, 363, 425, 427, 451, 452, 453, 454, 468, 470, 474, 485,...
|
635
|
+
|
636
|
+
# File: process.rb | Line: 163
|
637
|
+
# Definition: def stopped
|
638
|
+
LinuxStat::Process.stopped()
|
639
|
+
=> []
|
625
640
|
|
626
|
-
# File: process.rb | Line:
|
641
|
+
# File: process.rb | Line: 78
|
627
642
|
# Definition: def types
|
628
643
|
LinuxStat::Process.types()
|
629
|
-
=> {1=>:sleeping, 2=>:sleeping, 3=>:idle, 4=>:idle,
|
644
|
+
=> {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...
|
630
645
|
|
631
|
-
# File: process.rb | Line:
|
646
|
+
# File: process.rb | Line: 137
|
632
647
|
# Definition: def zombie
|
633
648
|
LinuxStat::Process.zombie()
|
634
649
|
=> []
|
@@ -637,166 +652,171 @@ LinuxStat::Process.zombie()
|
|
637
652
|
|
638
653
|
### LinuxStat::ProcessInfo
|
639
654
|
```
|
640
|
-
# File: process_info.rb | Line:
|
655
|
+
# File: process_info.rb | Line: 61
|
641
656
|
# Definition: def cmdline(pid = $$)
|
642
657
|
LinuxStat::ProcessInfo.cmdline(pid)
|
643
|
-
=> "/usr/bin/ruby /home/sourav/.gem/ruby/2.7.0/bin/linuxstat.rb
|
658
|
+
=> "/usr/bin/ruby /home/sourav/.gem/ruby/2.7.0/bin/linuxstat.rb -md"
|
644
659
|
|
645
|
-
# File: process_info.rb | Line:
|
660
|
+
# File: process_info.rb | Line: 87
|
646
661
|
# Definition: def command_name(pid = $$)
|
647
662
|
LinuxStat::ProcessInfo.command_name(pid)
|
648
663
|
=> "ruby"
|
649
664
|
|
650
|
-
# File: process_info.rb | Line:
|
665
|
+
# File: process_info.rb | Line: 708
|
651
666
|
# Definition: def nproc(pid = $$)
|
652
667
|
LinuxStat::ProcessInfo.count_cpu(pid)
|
653
668
|
=> 4
|
654
669
|
|
655
|
-
# File: process_info.rb | Line:
|
670
|
+
# File: process_info.rb | Line: 284
|
656
671
|
# Definition: def cpu_stat(pid: $$, sleep: ticks_to_ms_t5)
|
657
672
|
LinuxStat::ProcessInfo.cpu_stat(pid:, sleep:)
|
658
|
-
=> {:cpu_usage=>0.0, :threads=>1, :last_executed_cpu=>
|
673
|
+
=> {:cpu_usage=>0.0, :threads=>1, :last_executed_cpu=>2}
|
659
674
|
|
660
|
-
# File: process_info.rb | Line:
|
675
|
+
# File: process_info.rb | Line: 350
|
661
676
|
# Definition: def cpu_usage(pid: $$, sleep: ticks_to_ms_t5)
|
662
677
|
LinuxStat::ProcessInfo.cpu_usage(pid:, sleep:)
|
663
|
-
=>
|
678
|
+
=> 5.0
|
664
679
|
|
665
|
-
# File: process_info.rb | Line:
|
680
|
+
# File: process_info.rb | Line: 525
|
666
681
|
# Definition: def gid(pid = $$)
|
667
682
|
LinuxStat::ProcessInfo.gid(pid)
|
668
683
|
=> {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
|
669
684
|
|
670
|
-
# File: process_info.rb | Line:
|
685
|
+
# File: process_info.rb | Line: 487
|
671
686
|
# Definition: def last_executed_cpu(pid = $$)
|
672
687
|
LinuxStat::ProcessInfo.last_executed_cpu(pid)
|
673
|
-
=>
|
688
|
+
=> 2
|
674
689
|
|
675
|
-
# File: process_info.rb | Line:
|
690
|
+
# File: process_info.rb | Line: 151
|
676
691
|
# Definition: def mem_stat(pid = $$)
|
677
692
|
LinuxStat::ProcessInfo.mem_stat(pid)
|
678
|
-
=> {:memory=>
|
693
|
+
=> {:memory=>24842.24, :virtual_memory=>96309.248, :resident_memory=>30720.0}
|
679
694
|
|
680
|
-
# File: process_info.rb | Line:
|
695
|
+
# File: process_info.rb | Line: 184
|
681
696
|
# Definition: def memory(pid = $$)
|
682
697
|
LinuxStat::ProcessInfo.memory(pid)
|
683
|
-
=>
|
698
|
+
=> 24842.24
|
684
699
|
|
685
|
-
# File: process_info.rb | Line:
|
700
|
+
# File: process_info.rb | Line: 672
|
686
701
|
# Definition: def nice(pid = $$)
|
687
702
|
LinuxStat::ProcessInfo.nice(pid)
|
688
703
|
=> 0
|
689
704
|
|
690
|
-
# File: process_info.rb | Line:
|
705
|
+
# File: process_info.rb | Line: 708
|
691
706
|
# Definition: def nproc(pid = $$)
|
692
707
|
LinuxStat::ProcessInfo.nproc(pid)
|
693
708
|
=> 4
|
694
709
|
|
695
|
-
# File: process_info.rb | Line:
|
710
|
+
# File: process_info.rb | Line: 546
|
696
711
|
# Definition: def owner(pid = $$)
|
697
712
|
LinuxStat::ProcessInfo.owner(pid)
|
698
713
|
=> "sourav"
|
699
714
|
|
700
|
-
# File: process_info.rb | Line:
|
715
|
+
# File: process_info.rb | Line: 112
|
716
|
+
# Definition: def process_name(pid = $$)
|
717
|
+
LinuxStat::ProcessInfo.process_name(pid)
|
718
|
+
=> "linuxstat.rb"
|
719
|
+
|
720
|
+
# File: process_info.rb | Line: 234
|
701
721
|
# Definition: def resident_memory(pid = $$)
|
702
722
|
LinuxStat::ProcessInfo.resident_memory(pid)
|
703
|
-
=>
|
723
|
+
=> 30720.0
|
704
724
|
|
705
|
-
# File: process_info.rb | Line:
|
725
|
+
# File: process_info.rb | Line: 621
|
706
726
|
# Definition: def running_time(pid = $$)
|
707
727
|
LinuxStat::ProcessInfo.running_time(pid)
|
708
|
-
=> 1.
|
728
|
+
=> 1.19
|
709
729
|
|
710
|
-
# File: process_info.rb | Line:
|
730
|
+
# File: process_info.rb | Line: 602
|
711
731
|
# Definition: def start_time(pid = $$)
|
712
732
|
LinuxStat::ProcessInfo.start_time(pid)
|
713
|
-
=>
|
733
|
+
=> 2021-01-20 00:10:50 +0530
|
714
734
|
|
715
|
-
# File: process_info.rb | Line:
|
735
|
+
# File: process_info.rb | Line: 568
|
716
736
|
# Definition: def start_time_epoch(pid = $$)
|
717
737
|
LinuxStat::ProcessInfo.start_time_epoch(pid)
|
718
|
-
=>
|
738
|
+
=> 1611081650
|
719
739
|
|
720
|
-
# File: process_info.rb | Line:
|
740
|
+
# File: process_info.rb | Line: 653
|
721
741
|
# Definition: def state(pid = $$)
|
722
742
|
LinuxStat::ProcessInfo.state(pid)
|
723
743
|
=> "R"
|
724
744
|
|
725
|
-
# File: process_info.rb | Line:
|
745
|
+
# File: process_info.rb | Line: 407
|
726
746
|
# Definition: def thread_usage(pid: $$, sleep: ticks_to_ms_t5)
|
727
747
|
LinuxStat::ProcessInfo.thread_usage(pid:, sleep:)
|
728
748
|
=> 0.0
|
729
749
|
|
730
|
-
# File: process_info.rb | Line:
|
750
|
+
# File: process_info.rb | Line: 462
|
731
751
|
# Definition: def threads(pid = $$)
|
732
752
|
LinuxStat::ProcessInfo.threads(pid)
|
733
753
|
=> 1
|
734
754
|
|
735
|
-
# File: process_info.rb | Line:
|
755
|
+
# File: process_info.rb | Line: 30
|
736
756
|
# Definition: def total_io(pid = $$)
|
737
757
|
LinuxStat::ProcessInfo.total_io(pid)
|
738
|
-
=> {:read_bytes=>
|
758
|
+
=> {:read_bytes=>1286144, :write_bytes=>0}
|
739
759
|
|
740
|
-
# File: process_info.rb | Line:
|
760
|
+
# File: process_info.rb | Line: 501
|
741
761
|
# Definition: def uid(pid = $$)
|
742
762
|
LinuxStat::ProcessInfo.uid(pid)
|
743
763
|
=> {:real=>1000, :effective=>1000, :saved_set=>1000, :filesystem_uid=>1000}
|
744
764
|
|
745
|
-
# File: process_info.rb | Line:
|
765
|
+
# File: process_info.rb | Line: 209
|
746
766
|
# Definition: def virtual_memory(pid = $$)
|
747
767
|
LinuxStat::ProcessInfo.virtual_memory(pid)
|
748
|
-
=>
|
768
|
+
=> 96309.248
|
749
769
|
|
750
770
|
```
|
751
771
|
|
752
772
|
### LinuxStat::Swap
|
753
773
|
```
|
754
|
-
# File: swap.rb | Line:
|
774
|
+
# File: swap.rb | Line: 24
|
755
775
|
# Definition: def any?
|
756
776
|
LinuxStat::Swap.any?()
|
757
777
|
=> true
|
758
778
|
|
759
|
-
# File: swap.rb | Line:
|
779
|
+
# File: swap.rb | Line: 70
|
760
780
|
# Definition: def available
|
761
781
|
LinuxStat::Swap.available()
|
762
|
-
=>
|
782
|
+
=> 3546108
|
763
783
|
|
764
|
-
# File: swap.rb | Line:
|
784
|
+
# File: swap.rb | Line: 10
|
765
785
|
# Definition: def list
|
766
786
|
LinuxStat::Swap.list()
|
767
|
-
=> {"/dev/zram0"=>[:partition, 4194300,
|
787
|
+
=> {"/dev/zram0"=>[:partition, 4194300, 648192, -2]}
|
768
788
|
|
769
|
-
# File: swap.rb | Line:
|
789
|
+
# File: swap.rb | Line: 105
|
770
790
|
# Definition: def percent_available
|
771
791
|
LinuxStat::Swap.percent_available()
|
772
|
-
=>
|
792
|
+
=> 84.55
|
773
793
|
|
774
|
-
# File: swap.rb | Line:
|
794
|
+
# File: swap.rb | Line: 91
|
775
795
|
# Definition: def percent_used
|
776
796
|
LinuxStat::Swap.percent_used()
|
777
|
-
=> 45
|
797
|
+
=> 15.45
|
778
798
|
|
779
|
-
# File: swap.rb | Line:
|
799
|
+
# File: swap.rb | Line: 34
|
780
800
|
# Definition: def stat
|
781
801
|
LinuxStat::Swap.stat()
|
782
|
-
=> {:total=>4194300, :used=>
|
802
|
+
=> {:total=>4194300, :used=>648192, :available=>3546108, :percent_used=>15.45, :percent_available=>84.55}
|
783
803
|
|
784
|
-
# File: swap.rb | Line:
|
804
|
+
# File: swap.rb | Line: 59
|
785
805
|
# Definition: def total
|
786
806
|
LinuxStat::Swap.total()
|
787
807
|
=> 4194300
|
788
808
|
|
789
|
-
# File: swap.rb | Line:
|
809
|
+
# File: swap.rb | Line: 82
|
790
810
|
# Definition: def used
|
791
811
|
LinuxStat::Swap.used()
|
792
|
-
=>
|
812
|
+
=> 648192
|
793
813
|
|
794
814
|
```
|
795
815
|
|
796
816
|
### LinuxStat::Sysconf
|
797
817
|
```
|
798
818
|
LinuxStat::Sysconf.child_max()
|
799
|
-
=>
|
819
|
+
=> 14788
|
800
820
|
|
801
821
|
LinuxStat::Sysconf.expr_nest_max()
|
802
822
|
=> 32
|
@@ -854,34 +874,58 @@ LinuxStat::Sysconf.tty_name_max()
|
|
854
874
|
|
855
875
|
```
|
856
876
|
|
877
|
+
### LinuxStat::Thermal
|
878
|
+
```
|
879
|
+
# File: thermal.rb | Line: 59
|
880
|
+
# Definition: def count_fans
|
881
|
+
LinuxStat::Thermal.count_fans()
|
882
|
+
=> 1
|
883
|
+
|
884
|
+
# File: thermal.rb | Line: 49
|
885
|
+
# Definition: def count_sensors
|
886
|
+
LinuxStat::Thermal.count_sensors()
|
887
|
+
=> 8
|
888
|
+
|
889
|
+
# File: thermal.rb | Line: 41
|
890
|
+
# Definition: def fans
|
891
|
+
LinuxStat::Thermal.fans()
|
892
|
+
=> [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Processor Fan", :rpm=>2718}]
|
893
|
+
|
894
|
+
# File: thermal.rb | Line: 23
|
895
|
+
# Definition: def temperatures
|
896
|
+
LinuxStat::Thermal.temperatures()
|
897
|
+
=> [{:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"SODIMM", :temperature=>33.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"CPU", :temperature=>42.0}, {:path=>"/sys/class/hwmon/hwmon4", :name=>"dell_smm", :label=>"Ambi...
|
898
|
+
|
899
|
+
```
|
900
|
+
|
857
901
|
### LinuxStat::USB
|
858
902
|
```
|
859
|
-
# File: usb.rb | Line:
|
903
|
+
# File: usb.rb | Line: 139
|
860
904
|
# Definition: def count
|
861
905
|
LinuxStat::USB.count()
|
862
906
|
=> 10
|
863
907
|
|
864
|
-
# File: usb.rb | Line:
|
908
|
+
# File: usb.rb | Line: 139
|
865
909
|
# Definition: def count
|
866
910
|
LinuxStat::USB.count_devices()
|
867
911
|
=> 10
|
868
912
|
|
869
|
-
# File: usb.rb | Line:
|
913
|
+
# File: usb.rb | Line: 49
|
870
914
|
# Definition: def devices_stat(hwdata: true)
|
871
915
|
LinuxStat::USB.devices_stat(hwdata:)
|
872
916
|
=> [{: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...
|
873
917
|
|
874
|
-
# File: usb.rb | Line:
|
918
|
+
# File: usb.rb | Line: 179
|
875
919
|
# Definition: def hwdata_file
|
876
920
|
LinuxStat::USB.hwdata_file()
|
877
921
|
=> "/usr/share/hwdata/usb.ids"
|
878
922
|
|
879
|
-
# File: usb.rb | Line:
|
923
|
+
# File: usb.rb | Line: 168
|
880
924
|
# Definition: def hwdata_file_set?
|
881
925
|
LinuxStat::USB.hwdata_file_set?()
|
882
926
|
=> true
|
883
927
|
|
884
|
-
# File: usb.rb | Line:
|
928
|
+
# File: usb.rb | Line: 195
|
885
929
|
# Definition: def initialize_hwdata
|
886
930
|
LinuxStat::USB.initialize_hwdata()
|
887
931
|
=> false
|
@@ -897,104 +941,104 @@ LinuxStat::Uname.nodename()
|
|
897
941
|
=> "archlinux"
|
898
942
|
|
899
943
|
LinuxStat::Uname.release()
|
900
|
-
=> "5.
|
944
|
+
=> "5.9.9-xanmod1-1"
|
901
945
|
|
902
946
|
LinuxStat::Uname.sysname()
|
903
947
|
=> "Linux"
|
904
948
|
|
905
949
|
LinuxStat::Uname.version()
|
906
|
-
=> "#1 SMP PREEMPT
|
950
|
+
=> "#1 SMP PREEMPT Fri, 20 Nov 2020 07:44:55 +0000"
|
907
951
|
|
908
952
|
```
|
909
953
|
|
910
954
|
### LinuxStat::User
|
911
955
|
```
|
912
|
-
# File: user.rb | Line:
|
956
|
+
# File: user.rb | Line: 101
|
913
957
|
# Definition: def get_user
|
914
958
|
LinuxStat::User.get_current_user()
|
915
959
|
=> "sourav"
|
916
960
|
|
917
|
-
# File: user.rb | Line:
|
961
|
+
# File: user.rb | Line: 140
|
918
962
|
# Definition: def get_euid
|
919
963
|
LinuxStat::User.get_euid()
|
920
964
|
=> 1000
|
921
965
|
|
922
|
-
# File: user.rb | Line:
|
966
|
+
# File: user.rb | Line: 132
|
923
967
|
# Definition: def get_gid
|
924
968
|
LinuxStat::User.get_gid()
|
925
969
|
=> 1000
|
926
970
|
|
927
|
-
# File: user.rb | Line:
|
971
|
+
# File: user.rb | Line: 155
|
928
972
|
# Definition: def get_login
|
929
973
|
LinuxStat::User.get_login()
|
930
974
|
=> "sourav"
|
931
975
|
|
932
|
-
# File: user.rb | Line:
|
976
|
+
# File: user.rb | Line: 124
|
933
977
|
# Definition: def get_uid
|
934
978
|
LinuxStat::User.get_uid()
|
935
979
|
=> 1000
|
936
980
|
|
937
|
-
# File: user.rb | Line:
|
981
|
+
# File: user.rb | Line: 101
|
938
982
|
# Definition: def get_user
|
939
983
|
LinuxStat::User.get_user()
|
940
984
|
=> "sourav"
|
941
985
|
|
942
|
-
# File: user.rb | Line:
|
986
|
+
# File: user.rb | Line: 218
|
943
987
|
# Definition: def gid_by_username(username = get_user)
|
944
988
|
LinuxStat::User.gid_by_username(username)
|
945
989
|
=> 1000
|
946
990
|
|
947
|
-
# File: user.rb | Line:
|
991
|
+
# File: user.rb | Line: 58
|
948
992
|
# Definition: def gids
|
949
993
|
LinuxStat::User.gids()
|
950
994
|
=> {: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, :...
|
951
995
|
|
952
|
-
# File: user.rb | Line:
|
996
|
+
# File: user.rb | Line: 317
|
953
997
|
# Definition: def home_by_gid(id = get_gid)
|
954
998
|
LinuxStat::User.home_by_gid(id)
|
955
999
|
=> "/home/sourav"
|
956
1000
|
|
957
|
-
# File: user.rb | Line:
|
1001
|
+
# File: user.rb | Line: 269
|
958
1002
|
# Definition: def home_by_username(user = get_user)
|
959
1003
|
LinuxStat::User.home_by_username(user)
|
960
1004
|
=> "/home/sourav"
|
961
1005
|
|
962
|
-
# File: user.rb | Line:
|
1006
|
+
# File: user.rb | Line: 75
|
963
1007
|
# Definition: def home_directories
|
964
1008
|
LinuxStat::User.home_directories()
|
965
1009
|
=> {: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...
|
966
1010
|
|
967
|
-
# File: user.rb | Line:
|
1011
|
+
# File: user.rb | Line: 296
|
968
1012
|
# Definition: def homes_by_uid(id = get_uid)
|
969
1013
|
LinuxStat::User.homes_by_uid(id)
|
970
1014
|
=> ["/home/sourav"]
|
971
1015
|
|
972
|
-
# File: user.rb | Line:
|
1016
|
+
# File: user.rb | Line: 25
|
973
1017
|
# Definition: def ids
|
974
1018
|
LinuxStat::User.ids()
|
975
1019
|
=> {: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...
|
976
1020
|
|
977
|
-
# File: user.rb | Line:
|
1021
|
+
# File: user.rb | Line: 13
|
978
1022
|
# Definition: def list
|
979
1023
|
LinuxStat::User.list()
|
980
1024
|
=> ["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...
|
981
1025
|
|
982
|
-
# File: user.rb | Line:
|
1026
|
+
# File: user.rb | Line: 247
|
983
1027
|
# Definition: def uid_by_username(username = get_user)
|
984
1028
|
LinuxStat::User.uid_by_username(username)
|
985
1029
|
=> 1000
|
986
1030
|
|
987
|
-
# File: user.rb | Line:
|
1031
|
+
# File: user.rb | Line: 42
|
988
1032
|
# Definition: def uids
|
989
1033
|
LinuxStat::User.uids()
|
990
1034
|
=> {: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...
|
991
1035
|
|
992
|
-
# File: user.rb | Line:
|
1036
|
+
# File: user.rb | Line: 190
|
993
1037
|
# Definition: def username_by_gid(gid = get_gid)
|
994
1038
|
LinuxStat::User.username_by_gid(gid)
|
995
1039
|
=> "sourav"
|
996
1040
|
|
997
|
-
# File: user.rb | Line:
|
1041
|
+
# File: user.rb | Line: 172
|
998
1042
|
# Definition: def usernames_by_uid(uid = get_uid)
|
999
1043
|
LinuxStat::User.usernames_by_uid(uid)
|
1000
1044
|
=> ["sourav"]
|