Skip to content

Commit

Permalink
fix: system panel crash with ps command. (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongwencool authored Apr 17, 2022
1 parent 8d0d3ad commit 373cd66
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Visualize Erlang/Elixir Nodes On The Command Line base on [recon](https://github
%% rebar.config
{deps, [observer_cli]}
%% erlang.mk
dep_observer_cli = hex 1.7.2
dep_observer_cli = hex 1.7.3
```
**Elixir**
```elixir
Expand Down Expand Up @@ -223,6 +223,8 @@ Support F/B to page up/down.

----------------
### Changelog
- 1.7.3
- fix system pane exception by `ps` command.
- 1.7.2
- Fix error when inspecting process that monitors via {RegName, Node}.
- 1.7.1
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule ObserverCli.MixProject do
def project do
[
app: :observer_cli,
version: "1.7.2",
version: "1.7.3",
language: :erlang,
description: "observer in shell",
deps: [
Expand Down
2 changes: 1 addition & 1 deletion src/observer_cli.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{application, observer_cli,
[
{description, "Visualize Erlang Nodes On The Command Line"},
{vsn, "1.7.2"},
{vsn, "1.7.3"},
{modules, [
observer_cli
]},
Expand Down
6 changes: 3 additions & 3 deletions src/observer_cli_system.erl
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,15 @@ sys_info(Cmd) ->
[CpuPsV, MemPsV, RssPsV, VszPsV] =
case lists:filter(fun(Y) -> Y =/= [] end, string:split(CmdValue, " ", all)) of
[] -> ["--", "--", "--", "--"];
[V1, V2, V3, V4] -> [V1, V2, V3, V4]
[V1, V2, V3, V4] -> [V1, V2, list_to_integer(V3) * 1024, list_to_integer(V4) * 1024]
end,

{{_, Input}, {_, Output}} = erlang:statistics(io),
[
{ps_cpu, CpuPsV ++ "%"},
{ps_mem, MemPsV ++ "%"},
{ps_rss, list_to_integer(RssPsV) * 1024},
{ps_vsz, list_to_integer(VszPsV) * 1024},
{ps_rss, RssPsV},
{ps_vsz, VszPsV},
{io_input, Input},
{io_output, Output},

Expand Down

0 comments on commit 373cd66

Please sign in to comment.