idmtools_platform_comps.utils.disk_usage module

class idmtools_platform_comps.utils.disk_usage.ExperimentInfo(id, name, owner, size, sims)

Bases: object

class idmtools_platform_comps.utils.disk_usage.DiskSpaceUsage

Bases: object

TOP_COUNT = 15
OWNERS = []
static get_experiment_info(experiment: COMPS.Data.Experiment.Experiment, cache, refresh)

Adds the experiment information for a given experiment to the cache: - raw_size: the size in bytes - size: the formatted size (in KB, MB or GB) - sims: the number of simulations This function is used by the process pool to parallelize the retrieval of experiment info :param experiment: The experiment to analyze :param cache: :param refresh:

Returns:

static exp_str(info, display_owner=True)

Format an experiment and its information to a string.

static top_count_experiments(experiments_info)

Displays the top count of all experiments analyzed

static total_size_per_user(experiments_info)

Displays the total disk space occupied per user

static top_count_experiments_per_user(experiments_info)

Display the top count biggest experiments per user

static gather_experiment_info(refresh=False, max_workers: int = 6)
static display(platform: idmtools_platform_comps.comps_platform.COMPSPlatform, users, top=15, save=False, refresh=False)
static save_to_file(experiments_info)
class idmtools_platform_comps.utils.disk_usage.DiskEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)

Bases: json.encoder.JSONEncoder

default(o)

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)