Updated regex
This commit is contained in:
parent
7d5b412add
commit
4086990c0f
3 changed files with 3 additions and 3 deletions
|
|
@ -55,7 +55,7 @@ public class ProcDiskstats {
|
|||
BufferedReader in = new BufferedReader(new FileReader(PROC_PATH));
|
||||
String line = null;
|
||||
while((line=in.readLine()) != null){
|
||||
String[] str = line.trim().split("\\W+", 4);
|
||||
String[] str = line.trim().split("\\s+", 4);
|
||||
if(str.length >= 4) {
|
||||
String devName = str[2];
|
||||
if(!hdds.containsKey(devName)){
|
||||
|
|
@ -112,7 +112,7 @@ public class ProcDiskstats {
|
|||
writeThroughput = new ThroughputCalculator();
|
||||
}
|
||||
protected void update(String line){
|
||||
String[] stats = line.split("\\W+");
|
||||
String[] stats = line.split("\\s+");
|
||||
if(stats.length >= 11){
|
||||
readIO = Long.parseLong(stats[0]);
|
||||
readMerges = Long.parseLong(stats[1]);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class ProcStat {
|
|||
BufferedReader in = new BufferedReader(new FileReader(PROC_PATH));
|
||||
String line = null;
|
||||
while((line=in.readLine()) != null){
|
||||
String[] str = line.split("\\W+");
|
||||
String[] str = line.split("\\s+");
|
||||
if(str[0].equals("cpu")) {
|
||||
cpuTotal.update(str);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue