atop is an extremely useful top-like utility that shows the current state of the system.
To try it out run “atop” and review its different output modes by pressing: m (memory), d (disk), n (network), s (scheduling), v (various), c (command line), u (per user), p (per program), y (toggle threads).
On top of its interactive, top-like (but top on steroids!) functionality, atop can capture (log) system state snapshots and then review them.
To start the recording use -w option with a file name and then the interval (in seconds) for each refresh, i.e.:
Later on, read the data from the log file:
Jump one interval forward by pressing “t”, to go backward press “T”. To jump to a specified time, press “b”.
Ubuntu package contains atop.service which will log the samples into /var/log/atop/atop_YYYYMMDD log files with interval 600.