Use numfmt to get back human output in memory usage executor
This commit is contained in:
parent
bba945b3b9
commit
975149642f
3 changed files with 6 additions and 6 deletions
|
@ -831,9 +831,9 @@ execp_markup = 1
|
||||||
.PP
|
.PP
|
||||||
.RS
|
.RS
|
||||||
.nf
|
.nf
|
||||||
# "stdbuf -oL" noticed to give better performance than fflush() from awk code
|
# Though unnecessary here, "stdbuf -oL" performs better than fflush() in awk code
|
||||||
execp = new
|
execp = new
|
||||||
execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %.1fGi %.0f%%\n", $2 / (2^30), 100 * ($2 - $7) / $2 }'
|
execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { c="numfmt --to=si"; print $2 |& c; c |& getline a; printf "Mem: %s %.0f%%\n", a, 100 * ($2 - $7) / $2 }'
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
execp_continuous = 1
|
execp_continuous = 1
|
||||||
.fi
|
.fi
|
||||||
|
|
|
@ -372,9 +372,9 @@ execp_continuous = 1
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
execp_markup = 1
|
execp_markup = 1
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code># "stdbuf -oL" noticed to give better performance than fflush() from awk code
|
<h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code># Though unnecessary here, "stdbuf -oL" performs better than fflush() in awk code
|
||||||
execp = new
|
execp = new
|
||||||
execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %.1fGi %.0f%%\n", $2 / (2^30), 100 * ($2 - $7) / $2 }'
|
execp_command = free -b -s1 | stdbuf -oL awk ‘/^Mem:/ { c=“numfmt –to=si”; print $2 |& c; c |& getline a; printf “Mem: %s %.0f%%\n”, a, 100 * ($2 - $7) / $2 }’
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
execp_continuous = 1
|
execp_continuous = 1
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
|
@ -694,9 +694,9 @@ execp_markup = 1
|
||||||
##### Memory usage
|
##### Memory usage
|
||||||
|
|
||||||
```
|
```
|
||||||
# "stdbuf -oL" noticed to give better performance than fflush() from awk code
|
# Though unnecessary here, "stdbuf -oL" performs better than fflush() in awk code
|
||||||
execp = new
|
execp = new
|
||||||
execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %.1fGi %.0f%%\n", $2 / (2^30), 100 * ($2 - $7) / $2 }'
|
execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { c="numfmt --to=si"; print $2 |& c; c |& getline a; printf "Mem: %s %.0f%%\n", a, 100 * ($2 - $7) / $2 }'
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
execp_continuous = 1
|
execp_continuous = 1
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue