58a085188f54983026f5f4c4ce70055f999d2969,pwnagotchi/plugins/default/memtemp.py,,mem_usage,#,41

Before Change




def mem_usage():
    out = subprocess.getoutput("free -m")
    for line in out.split("\n"):
        line = line.strip()
        if line.startswith("Mem:"):
            parts = list(map(int, line.split()[1:]))
            tot = parts[0]
            used = parts[1]
            free = parts[2]
            return int((used / tot) * 100)

    return 0


def cpu_load():

After Change




def mem_usage():
    return int(pwnagotchi.mem_usage() * 100)

def cpu_load():
    return int(pwnagotchi.cpu_load() * 100)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: evilsocket/pwnagotchi
Commit Name: 58a085188f54983026f5f4c4ce70055f999d2969
Time: 2019-10-19
Author: speeskonijn@gmail.com
File Name: pwnagotchi/plugins/default/memtemp.py
Class Name:
Method Name: mem_usage


Project Name: NifTK/NiftyNet
Commit Name: 534c4dc7423681faab78d1829c1ec3c31ffb8330
Time: 2018-01-30
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/resampler.py
Class Name: ResamplerLayer
Method Name: _resample_inv_dst_weighting


Project Name: evilsocket/pwnagotchi
Commit Name: 58a085188f54983026f5f4c4ce70055f999d2969
Time: 2019-10-19
Author: speeskonijn@gmail.com
File Name: pwnagotchi/plugins/default/memtemp.py
Class Name:
Method Name: cpu_load