Use the same function to compute upgrade after update

Fixes #1161
Merge pull request #1171 from OCamlPro/update-stats

Fixes the inconsistency in the stats after update compared to upgrade