iostat displays stats since boot, once (per command run, not per boot). Then depending on parameters (eg: running
iostat 2, for every two seconds), it will display stats since previous display in the same command run:
The first report generated by the iostat command provides statistics
concerning the time since the system was booted, unless the -y option
is used (in this case, this first report is omitted). Each subsequent
report covers the time since the previous report. All statistics are
reported each time the iostat command is run. The report consists of a
CPU header row followed by a row of CPU statistics. On multiprocessor
systems, CPU statistics are calculated system-wide as averages among
all processors. A device header row is displayed followed by a line of
statistics for each device that is configured.
iostat is just doing a few substractions. The bookkeeping role is done by the kernel.
iostat just accesses various
/proc (or perhaps other similar entries). Among them (found simply by using
First read is since boot. To know since its last display, the
iostat memorizes (while it's running, in memory) the previous values, and substracts them to the newly read: that's what happened during the time period.
To confirm OP's questions: every run of
iostat command is independant of other runs of the
iostat command. It won't affect an other concurrently running
iostat command or future runs of the