blink_tm 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/blink-tm +18 -0
- data/lib/blink_tm/blink_tm.rb +8 -6
- data/lib/blink_tm/version.rb +1 -1
- data/lib/blink_tm.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 290de1234088715cb8d957462afdd3a8f54c1c876f2b49ae35de7546cb352da8
|
|
4
|
+
data.tar.gz: e4a103649d1c326c86eb74931ca4a4796e150c186e9f6ef05926410d33ab31b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7641d9d08838db8707dd75a327a417090ef0c0ecdddf0f458f34c5caeffb1406dde99272db73ad30d5e3ef288b348534b5834e09365ead845b4db34efa598c5d
|
|
7
|
+
data.tar.gz: 119773e1b395a46910267f6bee5f6c284a7bb3208953c40649c1d3981f31f6508f39b202d983a658ffedb7988b3dc4082be86c162df01b0063a0bf373352d4c9
|
data/exe/blink-tm
CHANGED
|
@@ -64,5 +64,23 @@ rescue Interrupt, SystemExit, SignalException
|
|
|
64
64
|
file &.close
|
|
65
65
|
File.delete(BlinkTM::LOCKFILE)
|
|
66
66
|
rescue Exception
|
|
67
|
+
|
|
68
|
+
mesg = <<~EOF
|
|
69
|
+
:: Time: #{Time.now.strftime("%A %d %B %Y, %H:%M:%S:%5N %p")}:
|
|
70
|
+
#{$!.full_message}
|
|
71
|
+
|
|
72
|
+
Please notify these bugs to the issue tracker.
|
|
73
|
+
#{'-' * 70}
|
|
74
|
+
EOF
|
|
75
|
+
|
|
76
|
+
if File.writable?(BlinkTM::LOGFILE)
|
|
77
|
+
log = File.open(BlinkTM::LOGFILE, 'a')
|
|
78
|
+
log.write(mesg)
|
|
79
|
+
log.close
|
|
80
|
+
else
|
|
81
|
+
puts "Logs aren't writable\n\nHere's a detailed message of what has happened:"
|
|
82
|
+
puts mesg
|
|
83
|
+
end
|
|
84
|
+
ensure
|
|
67
85
|
File.delete(BlinkTM::LOCKFILE)
|
|
68
86
|
end
|
data/lib/blink_tm/blink_tm.rb
CHANGED
|
@@ -83,7 +83,7 @@ module BlinkTM
|
|
|
83
83
|
Thread.new {
|
|
84
84
|
while true
|
|
85
85
|
_cpu_u = LS::CPU.total_usage(POLLING).to_f
|
|
86
|
-
cpu_u = _cpu_u.nan? ?
|
|
86
|
+
cpu_u = _cpu_u.nan? ? 255 : _cpu_u.to_i
|
|
87
87
|
end
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -150,10 +150,12 @@ module BlinkTM
|
|
|
150
150
|
# disktotal(999990) diskused(999990)
|
|
151
151
|
|
|
152
152
|
memstat = LS::Memory.stat
|
|
153
|
-
|
|
153
|
+
_mem_u = memstat[:used].to_i.*(1024).*(100).fdiv(memstat[:total].to_i * 1024)
|
|
154
|
+
mem_u = _mem_u.nan? ? 255 : _mem_u.round
|
|
154
155
|
|
|
155
156
|
swapstat = LS::Swap.stat
|
|
156
|
-
|
|
157
|
+
_swap_u = swapstat[:used].to_i.*(1024).*(100).fdiv(swapstat[:total].to_i * 1024)
|
|
158
|
+
swap_u = _swap_u.nan? ? 255 : _swap_u.round
|
|
157
159
|
|
|
158
160
|
# Output has to be exactly this long. If not, blink-taskmanager shows invalid result.
|
|
159
161
|
# No string is split inside blink-task manager, it just depends on the string length.
|
|
@@ -163,9 +165,9 @@ module BlinkTM
|
|
|
163
165
|
# ioWrite(9991) ioRead(9991)
|
|
164
166
|
|
|
165
167
|
# Debugging string
|
|
166
|
-
str = "#{"%03d" % cpu_u} #{"%03d" % mem_u} #{"%03d" % swap_u} "\
|
|
167
|
-
"#{convert_bytes(net_u)} #{convert_bytes(net_d)} "\
|
|
168
|
-
"#{convert_bytes(io_r)} #{convert_bytes(io_w)}"
|
|
168
|
+
# str = "#{"%03d" % cpu_u} #{"%03d" % mem_u} #{"%03d" % swap_u} "\
|
|
169
|
+
# "#{convert_bytes(net_u)} #{convert_bytes(net_d)} "\
|
|
170
|
+
# "#{convert_bytes(io_r)} #{convert_bytes(io_w)}"
|
|
169
171
|
|
|
170
172
|
str = "!##{"%03d" % cpu_u}#{"%03d" % mem_u}#{"%03d" % swap_u}"\
|
|
171
173
|
"#{convert_bytes(net_u)}#{convert_bytes(net_d)}"\
|
data/lib/blink_tm/version.rb
CHANGED
data/lib/blink_tm.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: blink_tm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sourav Goswami
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-03-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: linux_stat
|
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
62
|
version: '0'
|
|
63
63
|
requirements: []
|
|
64
|
-
rubygems_version: 3.
|
|
64
|
+
rubygems_version: 3.3.8
|
|
65
65
|
signing_key:
|
|
66
66
|
specification_version: 4
|
|
67
67
|
summary: A controller for Arduino OLED System Monitor, Blink Task Manager
|