!7 sclass Process { S processID, name, commandLine; long residentSize; double cpuUsage; // percent per core static S _fieldOrder = "processID name commandLine residentSize cpuUsage"; } module ProcessList > DynObjectTable { start { dontPersist(); itemToMap = func(Process p) -> Map { humanizeKeys( applyFunctionToMapValue('cpuUsage, f iround_spacePercentSign, applyFunctionToMapValue('residentSize, f str_toM, objectToMap_honorFieldOrder(p)))) }; actualUpdate(); // to make sort keys work doEvery(5.0, r actualUpdate); } afterVisualize { addRowSorter_desc(table, 3); rowSorter_setComparators(table, 2, alphaNumComparator(), 3, alphaNumComparator(), 4, alphaNumComparator()); } void actualUpdate enter { setData(map(timed(func -> L { //oshi_listProcesses() oshi_listProcesses_withoutOpenFiles() }), func(OSProcess p) -> Process { nu(Process, processID := str(p.getProcessID()), name := p.getName(), commandLine := p.getCommandLine(), residentSize := p.getResidentSetSize(), cpuUsage := oshi_calcProcessCPUUsage_v2(p)) })); } }