58a085188f54983026f5f4c4ce70055f999d2969,pwnagotchi/plugins/default/memtemp.py,,cpu_load,#,55

Before Change




def cpu_load():
    with open("/proc/stat", "rt") as fp:
        for line in fp:
            line = line.strip()
            if line.startswith("cpu "):
                parts = list(map(int, line.split()[1:]))
                user_n = parts[0]
                sys_n = parts[2]
                idle_n = parts[3]
                tot = user_n + sys_n + idle_n
                return int(((user_n + sys_n) / tot) * 100)
    return 0


def temperature(celsius=True):

After Change


    return int(pwnagotchi.mem_usage() * 100)

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



def on_ui_setup(ui):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: cpu_load


Project Name: OpenNMT/OpenNMT-py
Commit Name: 5830b75b375a5223f09d206ea2850902082f96ee
Time: 2017-12-25
Author: nasa4836@gmail.com
File Name: preprocess.py
Class Name:
Method Name: get_num_features


Project Name: ClimbsRocks/auto_ml
Commit Name: e87334a5fbe16bd1f16357b452036b578ca3b5f8
Time: 2017-04-17
Author: ClimbsBytes@gmail.com
File Name: auto_ml/utils_models.py
Class Name:
Method Name: load_keras_model