Commit 5ba8c0e5 authored by Matteo Melli's avatar Matteo Melli

Fix for /proc/<pid>/io file not found

parent d03cdf8e
......@@ -94,8 +94,10 @@ public class Main {
Map<Integer, ProcessInfo> processInfoMap = Arrays.asList(new File("/proc").listFiles())
.stream()
.filter(file -> file.getName().charAt(0) >= '0' && file.getName().charAt(0) <= '9')
.filter(file -> file.canRead())
.filter(file -> file.isDirectory())
.filter(file -> file.listFiles(entry -> entry.getName().equals("cmdline")).length == 1)
.filter(file -> file.listFiles(entry -> entry.getName().equals("io")).length == 1)
.map(file -> file.getName())
.map(name -> Integer.parseInt(name))
.map(pid -> getPreviousOrParseInfo(previousStats, pid))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment