Capture per-core statistics

Fix #1124