timer package

Submodules

timer.timer module

Track and predict how long an Amazon Cloud upload is going to take.

class timer.timer.TimeIt(nfiles=100)[source]

Bases: object

Create a time-tracking object.

upload_data

list – Measurements of file number uploads.

time_data

list – Measurements of the current system time when each upload measurement was taken.

nfiles

int – The total number of files to be uploaded.

add_to_dataset(file_number=None)[source]

Record a measurement of current file being uploaded and a timestamp.

Returns:True if successful, False otherwise.
plot_it(poly=2, **kwargs)[source]

Plot data and estimated upload completion time.

Parameters:
  • poly (int) – Degree of polynomial for fit.
  • **kwargs – Keyword arguments for matplotlib.pyplot.axes.plot.
Returns:

True if successful, False otherwise.

read_time_data(init=0, file_path='data/timestamps.txt')[source]

Return a list that holds the timestamps.

Parameters:
  • init (int) – Flag for whether to start from scratch and ignore any saved previous measurements (set True if desired).
  • file_path (str) – Path for the timestamps file.
Returns:

List for holding upload data measurements.

Return type:

time_data (list)

read_upload_data(init=0, file_path='data/uploads.txt')[source]

Return a list that holds the number of files being uploaded.

Parameters:
  • init (int) – Flag for whether to start from scratch and ignore any saved previous measurements (set True if desired).
  • file_path (str) – Path for the uploads file.
Returns:

List for holding upload data measurements.

Return type:

upload_data (list)

time_data_to_dec(time_data)[source]

Retreive the timestamps, including a decimal version for calculations.

Returns:
Floats of seconds since start of
epoch.
Return type:time_data_dec (numpy.ndarray)
write_time_data(file_path='data/timestamps.txt')[source]

Write the timestamps to a file.

Parameters:file_path (str) – Path for the timestamps file.
Returns:True if successful, False otherwise.
write_upload_data(file_path='data/uploads.txt')[source]

Write the upload data to a file.

Parameters:file_path (str) – Path for the uploads file.
Returns:True if successful, False otherwise.

Module contents