Skip to content

Instantly share code, notes, and snippets.

@ashishb888
Last active November 4, 2020 07:22
Show Gist options
  • Save ashishb888/b6bae7ffa9eae1c78181d58b6b9e91a6 to your computer and use it in GitHub Desktop.
Save ashishb888/b6bae7ffa9eae1c78181d58b6b9e91a6 to your computer and use it in GitHub Desktop.
Monitor a process activity. It can display all the threads associated with a process, IO activity per thread, thread context switching etc
#!/bin/bash
pid=$1
appName=$2
timestamp=`date +%FT%H-%M-%S`
pidstat -w -d -t -p $pid -h 5 > /var/tmp/$appName-$timestamp.out
#bash pidstat.sh 22292 app-name &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment