toil.lib.resources

Module Contents

Classes

ResourceMonitor

Global resource monitoring widget.

Functions

glob(glob_pattern, directoryname)

Walks through a directory and its subdirectories looking for files matching

class toil.lib.resources.ResourceMonitor[source]

Global resource monitoring widget.

Presents class methods to get the resource usage of this process and child processes, and other class methods to adjust the statistics so they can account for e.g. resources used inside containers, or other resource usage that should be billable to the current process.

classmethod record_extra_memory(peak_ki)[source]

Become responsible for the given peak memory usage, in kibibytes.

The memory will be treated as if it was used by a child process at the time our real child processes were also using their peak memory.

Parameters:

peak_ki (int)

Return type:

None

classmethod record_extra_cpu(seconds)[source]

Become responsible for the given CPU time.

The CPU time will be treated as if it had been used by a child process.

Parameters:

seconds (float)

Return type:

None

classmethod get_total_cpu_time_and_memory_usage()[source]

Gives the total cpu time of itself and all its children, and the maximum RSS memory usage of itself and its single largest child (in kibibytes).

Return type:

Tuple[float, int]

classmethod get_total_cpu_time()[source]

Gives the total cpu time, including the children.

Return type:

float

toil.lib.resources.glob(glob_pattern, directoryname)[source]

Walks through a directory and its subdirectories looking for files matching the glob_pattern and returns a list=[].

Parameters:
  • directoryname (str) – Any accessible folder name on the filesystem.

  • glob_pattern (str) – A string like *.txt, which would find all text files.

Returns:

A list=[] of absolute filepaths matching the glob pattern.

Return type:

List[str]