Skip to main content
100%

Linux Process Tree

✓ Published0🌍 Public
Dd3noob
Last edited Nov 30, 2019
Created on Mar 21, 2014

A hierarchical tree visualizes Linux processes as collapsible nodes, with each circle representing a process and links showing parent-child relationships based on PID/PPID data. The tree uses d3.layout.tree and d3.svg.diagonal for layout and connection paths, while d3.csv loads the process data from a CSV file. Interactive features include click-to-collapse and mouseover tooltips displaying PID, command, user, CPU, and memory values. Nodes animate positions over 750 milliseconds via d3 transitions, with styling defined through SVG circles, text labels, and path links.

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.

mit Licensed

Similar vizzes