worth mentioning here that there is discussion for tracking vacuum history
in this recent thread [1], and this includes both start_time and end_time
of the vacuum from what I can tell.
postgres=# select * from vacuum_history ;
start_time | end_time | dbid | relid | is_autovacuum | .....
It will also be good to see if there are other opinions for accumulating
the elapsed time for vacuums in pg_stat_all_tables.
[1] https://www.postgresql.org/message-id/flat/b68ab452-c41f-4d04-893f-eaab84f1855b%40vondra.me
Regards,
Sami