Added latency tracking and refactored success/failure events tracking