[Migration] move user_agent_stats() to view