Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@provides("perprocess-ram")
def psram_stat(disallowed_prefixes=None, allowed_prefixes=None):
results = {}
pid_list = get_pid_list(disallowed_prefixes, allowed_prefixes)
print pid_list
for pid in pid_list:
try:
dev_name = get_pid_name(pid)
private, shared = get_mem_stats(pid)
total = private + shared
sys_total = get_ram_size()
usage = float(total) / float(sys_total)
sensor_name = "{0}.{1}".format(dev_name, pid)
results[sensor_name + ".private_mem"] = SensorInfo(private, False)