Average cpu usage

10018 crio-us+ 20 0 21960 2336 2136 S 0.0 0.1 0:00.00 vsftpd_v1
10018 crio-us+ 20 0 21960 2336 2136 D 3.0 0.1 0:00.09 vsftpd_v1
10018 crio-us+ 20 0 21960 2336 2136 D 4.0 0.1 0:00.21 vsftpd_v1
10018 crio-us+ 20 0 21960 2336 2136 S 3.0 0.1 0:00.30 vsftpd_v1
10018 crio-us+ 20 0 21960 2336 2136 S 0.3 0.1 0:00.31 vsftpd_v1
10018 crio-us+ 20 0 21960 2336 2136 S 0.0 0.1 0:00.31 vsftpd_v1

Is the avg cpu usage for this o/p is (3.0+4.0+3.0+0.3)/(31-0) ?

You need to capture the avg cpu usage only while the file is being transferred. So the avg would be (3+4+3+0.3)/(4) as per the above log.

There is no hard and fast rule about calculating average. You just need to have an idea of how much CPU is getting used.
For versions, where CPU usage is higher, you’ll clearly be able to differentiate.