stats: port stats_events to es6