I've dumped the cron job i use for data collection here https://gist.github.com/4477372
My rough approach to post processing this data was to group by 6 minute intervals, and to drop any records where the computer was inactive for more than 120 seconds.