toil.utils.toilStats¶
Reports statistical data about a given Toil workflow.
Attributes¶
Classes¶
Convenience object that stores the width of columns for printing. Helps make things pretty. |
Functions¶
|
Pad the beginning of a string with spaces, if necessary. |
|
Given input k as kibibytes, return a nicely formatted string. |
|
Given input t as seconds, return a nicely formatted string. |
|
Format a unit name for display. |
|
Given t seconds, report back the correct format as string. |
|
Given k kibibytes, report back the correct format as string. |
|
Given a number, report back the correct format as string. |
|
Report a value of the given category formatted as a string. |
|
Generate a pretty-print ready string from a JTTag(). |
|
Add extra parts to the category titles. |
|
Add a marker to the correct field if the TITLE is sorted on. |
|
Return a float value attribute NAME from TREE. |
|
Return a jobTypes all sorted. |
|
Print the important bits out. |
|
Return a ColumnWidths() object with the correct max widths. |
|
Update the column width attributes for this tag's fields. |
|
Create an element for output. |
|
Figure out how many jobs (or contained items) ran on each worker (or containing item). |
|
Sum together all the stats information in the job store. |
|
Collate the stats and report |
|
|
|
|
|
Reports stats on the workflow, use with --stats option to toil. |
Module Contents¶
- toil.utils.toilStats.logger¶
- toil.utils.toilStats.CATEGORIES = ['time', 'clock', 'wait', 'memory', 'disk']¶
- toil.utils.toilStats.CATEGORY_UNITS¶
- toil.utils.toilStats.TITLES¶
- toil.utils.toilStats.TIME_CATEGORIES¶
- toil.utils.toilStats.SPACE_CATEGORIES¶
- toil.utils.toilStats.COMPUTED_CATEGORIES¶
- toil.utils.toilStats.LONG_FORMS¶
- class toil.utils.toilStats.ColumnWidths[source]¶
Convenience object that stores the width of columns for printing. Helps make things pretty.
- categories¶
- fields_count = ['count', 'min', 'med', 'ave', 'max', 'total']¶
- fields = ['min', 'med', 'ave', 'max', 'total']¶
- toil.utils.toilStats.pad_str(s, field=None)[source]¶
Pad the beginning of a string with spaces, if necessary.
- toil.utils.toilStats.pretty_space(k, field=None, alone=False)[source]¶
Given input k as kibibytes, return a nicely formatted string.
- toil.utils.toilStats.pretty_time(t, field=None, unit='s', alone=False)[source]¶
Given input t as seconds, return a nicely formatted string.
- toil.utils.toilStats.report_time(t, options, field=None, unit='s', alone=False)[source]¶
Given t seconds, report back the correct format as string.
- toil.utils.toilStats.report_space(k, options, field=None, unit='KiB', alone=False)[source]¶
Given k kibibytes, report back the correct format as string.
If unit is set to B, convert to KiB first.
- toil.utils.toilStats.report_number(n, field=None, nan_value='NaN')[source]¶
Given a number, report back the correct format as string.
If it is a NaN or None, use nan_value to represent it instead.
- toil.utils.toilStats.report(v, category, options, field=None, alone=False)[source]¶
Report a value of the given category formatted as a string.
Uses the given field width if set.
If alone is set, the field is being formatted outside a table and might need a unit.
- Parameters:
v (float)
category (str)
options (argparse.Namespace)
field (Optional[int])
- Return type:
- toil.utils.toilStats.sprint_tag(key, tag, options, columnWidths=None)[source]¶
Generate a pretty-print ready string from a JTTag().
- Parameters:
key (str)
tag (toil.lib.expando.Expando)
options (argparse.Namespace)
columnWidths (Optional[ColumnWidths])
- Return type:
- toil.utils.toilStats.decorate_title(category, title, options)[source]¶
Add extra parts to the category titles.
Add units to title if they won’t appear in the formatted values. Add a marker to TITLE if the TITLE is sorted on.
- Parameters:
category (str)
title (str)
options (argparse.Namespace)
- Return type:
- toil.utils.toilStats.decorate_subheader(category, columnWidths, options)[source]¶
Add a marker to the correct field if the TITLE is sorted on.
- Parameters:
category (str)
columnWidths (ColumnWidths)
options (argparse.Namespace)
- Return type:
- toil.utils.toilStats.get(tree, name)[source]¶
Return a float value attribute NAME from TREE.
- Parameters:
tree (toil.lib.expando.Expando)
name (str)
- Return type:
- toil.utils.toilStats.sort_jobs(jobTypes, options)[source]¶
Return a jobTypes all sorted.
- Parameters:
jobTypes (List[Any])
options (argparse.Namespace)
- Return type:
List[Any]
- toil.utils.toilStats.report_pretty_data(root, worker, job, job_types, options)[source]¶
Print the important bits out.
- Parameters:
root (toil.lib.expando.Expando)
worker (toil.lib.expando.Expando)
job (toil.lib.expando.Expando)
job_types (List[Any])
options (argparse.Namespace)
- Return type:
- toil.utils.toilStats.compute_column_widths(job_types, worker, job, options)[source]¶
Return a ColumnWidths() object with the correct max widths.
- Parameters:
job_types (List[Any])
worker (toil.lib.expando.Expando)
job (toil.lib.expando.Expando)
options (argparse.Namespace)
- Return type:
- toil.utils.toilStats.update_column_widths(tag, cw, options)[source]¶
Update the column width attributes for this tag’s fields.
- Parameters:
tag (toil.lib.expando.Expando)
cw (ColumnWidths)
options (argparse.Namespace)
- Return type:
None
- toil.utils.toilStats.build_element(element, items, item_name, defaults)[source]¶
Create an element for output.
- Parameters:
element (toil.lib.expando.Expando)
items (List[toil.job.Job])
item_name (str)
- Return type:
- toil.utils.toilStats.create_summary(element, containingItems, containingItemName, count_contained)[source]¶
Figure out how many jobs (or contained items) ran on each worker (or containing item).
Stick a bunch of xxx_number_per_xxx stats into element to describe this.
- Parameters:
count_contained (Callable[[toil.lib.expando.Expando], int]) – function that maps from containing item to number of contained items.
element (toil.lib.expando.Expando)
containingItems (List[toil.lib.expando.Expando])
containingItemName (str)
- Return type:
None
- toil.utils.toilStats.get_stats(jobStore)[source]¶
Sum together all the stats information in the job store.
Produces one object containing lists of the values from all the summed objects.
- Parameters:
- Return type:
- toil.utils.toilStats.process_data(config, stats)[source]¶
Collate the stats and report
- Parameters:
config (toil.common.Config)
stats (toil.lib.expando.Expando)
- Return type:
- toil.utils.toilStats.report_data(tree, options)[source]¶
- Parameters:
tree (toil.lib.expando.Expando)
options (argparse.Namespace)
- Return type:
None
- toil.utils.toilStats.sort_category_choices¶
- toil.utils.toilStats.sort_field_choices = ['min', 'med', 'ave', 'max', 'total']¶
- toil.utils.toilStats.add_stats_options(parser)[source]¶
- Parameters:
parser (argparse.ArgumentParser)
- Return type:
None