detkit.Profile.disk_read#

Profile.disk_read()#

Inquiry the amount of read from disk.

Returns:
write_sizeint

The amount of read from disk in bytes.

See also

disk_write

Notes

The read amount is measured from the point where detkit.Profile.set() is called to the current.

Note

To properly measure the read from disk, the memory cache should be dropped before calling this function. To do so, execute the following in terminal:

echo 3 | sudo tee /proc/sys/vm/drop_caches

Examples

>>> from detkit import Profile, memdet

>>> # Initialize profile
>>> prof = Profile()

>>> # Set (or reset) the starting point of inquiry
>>> prof.set()

>>> # Perform an operation that reads from and writes to disk
>>> import numpy
>>> A = numpy.random.randn(1000, 1000)
>>> ld = memdet(A, num_blocks=4)

>>> # Inquiry read from disk during the above operation
>>> print(prof.disk_read())
909312.0