예제 #1
0
def read_cpuacct_stat(cgrp):
    """read cpuacct.stat pseudo file
    """
    divided_usage = cgutils.get_stat('cpuacct', cgrp)
    # usage in other file in nanseconds, in cpuaaac.stat is 10 miliseconds
    for name, value in six.iteritems(divided_usage):
        divided_usage[name] = value * NANOSECS_PER_10MILLI

    return divided_usage
예제 #2
0
def read_memory_stats(cgrp):
    """Reads memory stats for the given treadmill app or system service.

    Returns dict: key is pseudofile name
    """
    metric = cgrp_meminfo(cgrp)
    stats = cgutils.get_stat('memory', cgrp)
    metric['memory.stat'] = stats

    return metric
예제 #3
0
def read_cpu_stat(cgrp):
    """read cpu.stat pseudo file
    """
    throttled_usage = cgutils.get_stat('cpu', cgrp)
    return throttled_usage