!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 { doEvery(1.0, 10.0, r actualUpdate); itemToMap = func(Process p) -> Map { humanizeKeys( applyFunctionToMapValue('cpuUsage, f iround_spacePercentSign, applyFunctionToMapValue('residentSize, f str_toM, objectToMap_honorFieldOrder(p)))) }; } afterVisualize { addRowSorter_desc(table, 3); rowSorter_setComparators(table, 2, alphaNumComparator(), 3, alphaNumComparator()); } void actualUpdate enter { L data = map(timed(func -> L { oshi_listProcesses() }), func(OSProcess p) -> Process { nu(Process, processID := str(p.getProcessID()), name := p.getName(), commandLine := p.getCommandLine(), residentSize := p.getResidentSetSize(), cpuUsage := oshi_calcProcessCPUUsage(p)) }); // Table RowSorters seem broken on Windows, so pre-sort setData(sortedByFieldDesc(data, 'residentSize)); } }