Completed getProcessInfoByStat function