linux下性能监控

top -c -b -n 1 -u postgres | grep -A 7 postgres | awk '{print $1,$9,$11}'| xargs -n 3 /root/test.sh


#!/bin/bash

RESULT=`psql -U postgres -c "SELECT COALESCE(QUERY, '$1'), '$1' PID, '$2' CPU, '$3' \"TIME\" FROM PG_STAT_ACTIVITY WHERE PID = $1" >> /root/result.log`

posted @ 2017-06-29 16:50  pg_libs  阅读(204)  评论(0)    收藏  举报