Populate origin_visit_stats table out of the origin_visit_status topic
The snapshot is used to determine the "eventful/uneventful" nature of the origin visit status.
When no snapshot is provided, the visit is considered as failed so the last_failed column is updated.
As there is no time guarantee when reading message from the topic, the code tries to keep the data in the most timely ordered as possible. Only most recent information is kept.
TODO: @vlorentz mentioned in !170 (closed) that the api origin_visit_stats_upsert
should
be a batch api. That concern shall be addressed in D4868.
Related to #2967 (closed)
Test Plan
tox
Migrated from D4866 (view on Phabricator)