You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/plugin.md
+32-1Lines changed: 32 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -157,4 +157,35 @@ Support `{byte, 1024*10}` to ` 10.0000 KB`; `{percent, 0.12}` to `12.00%`.
157
157
158
158
Support F/B to page up/down.
159
159
160
-
[A more specific plugin](https://github.com/zhongwencool/os_stats) can collect linux system information such as kernel vsn, loadavg, disk, memory usage, cpu utilization, IO statistics.
160
+
[A more specific plugin](https://github.com/zhongwencool/os_stats) can collect linux system information such as kernel vsn, loadavg, disk, memory usage, cpu utilization, IO statistics.
161
+
162
+
3. Handler: specific per-item behavior
163
+
164
+
By default, once you select a row, it will show the process information in `observer_cli_process` view. This is done
165
+
by looking for a `pid` in the row, so the first one found will be used and passed to the `observer_cli_process` view.
166
+
167
+
To customize this behavior, you can implement your own handler. The handler is a tuple with a function and a module.
168
+
The function is a predicate that will be used to filter all row's items and, if the resulting list in not empty, the
169
+
`Handler:start/3` function will be called. The signature is the same of `observer_cli_process:start/3`.
170
+
171
+
The new configuration will look like this:
172
+
173
+
```erlang
174
+
%% module - Specific module implements plugin behavior. It's mandatory.
175
+
%% title - Menu title. It's mandatory.
176
+
%% shortcut - Switch plugin by shortcut. It's mandatory.
0 commit comments