Skip to main content
100%

Linux Process Tree

✓ Published0🌍 Public
663anp3ca
Last edited Oct 31, 2018
Created on Oct 31, 2018

This interactive visualization presents the Linux process hierarchy as an expandable tree diagram, built with D3.js v3. Each node represents a running process, with links showing parent-child relationships derived from a CSV file generated from the `ps` command. The tree layout organizes processes by depth, with nodes spaced horizontally and vertically to reveal the process hierarchy. Users can click on any node to collapse or expand its subtree, helping to manage the visual density of the many processes. Hovering over a node triggers a tooltip that displays additional process details such as PID, command name, user, CPU usage, and memory size. The visualization uses smooth transitions when nodes expand or collapse, and all interactions are implemented with SVG elements.

AI-generated description

This is a chart as used as an example to demonstrate the relationships between Linux processes as a tree using d3.js.

The nodes can be collapsed (since they tend to get crowded) by clicking on them and they include a tool tip feature to provide additional information about each process. It is used as an example and described in the book D3 Tips and Tricks.

The csv file used here was taken by running the command...

ps -eo pid,ppid,pcpu,size,comm,ruser,s

...and converting the resultant output to a csv file. I manually added the 'start' line (0, ,0,0,start,nul,u) to include the root node and removed the '%' sign from the '%CPU' label to reduce chance of errors. In theory this process of formatting the data file could be automated (indeed, there may be a much better way to gather and include it!).

While I have included a tool tip feature for displaying more data from each node, ultimately, I would have grand visions of this being more useful by encoding the node/link colour according to CPU usage or memory use.

forked from <a href='http://bl.ocks.org/d3noob/'>d3noob</a>'s block: <a href='http://bl.ocks.org/d3noob/9692795'>Interactive Linux process tree using d3.js</a>

mit Licensed

Similar vizzes