commit | 7b324c9842466996d0012f0540128aa049191973 | [log] [tgz] |
---|---|---|
author | buyingyi <buyingyi@gmail.com> | Thu Nov 14 17:40:38 2013 -0800 |
committer | buyingyi <buyingyi@gmail.com> | Thu Nov 14 17:40:38 2013 -0800 |
tree | 0db49d65ce6abbc42e7cdba078aa0d7f83541892 | |
parent | 6f974688002c096517e30ebe0cf853dcf82eb340 [diff] |
fix linux io counter to return relative I/Os
diff --git a/hyracks/hyracks-client/src/test/java/edu/uci/ics/hyracks/client/stats/HyracksUtils.java b/hyracks/hyracks-client/src/test/java/edu/uci/ics/hyracks/client/stats/HyracksUtils.java index 7bda39d..a58aa9c 100644 --- a/hyracks/hyracks-client/src/test/java/edu/uci/ics/hyracks/client/stats/HyracksUtils.java +++ b/hyracks/hyracks-client/src/test/java/edu/uci/ics/hyracks/client/stats/HyracksUtils.java
@@ -53,6 +53,7 @@ ccConfig.defaultMaxJobAttempts = 0; ccConfig.jobHistorySize = 0; ccConfig.profileDumpPeriod = -1; + ccConfig.heartbeatPeriod = 50; // cluster controller cc = new ClusterControllerService(ccConfig);
diff --git a/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/io/profiling/IOCounterLinux.java b/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/io/profiling/IOCounterLinux.java index 589857b..1e8baa1 100644 --- a/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/io/profiling/IOCounterLinux.java +++ b/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/io/profiling/IOCounterLinux.java
@@ -25,11 +25,19 @@ public static final String COMMAND2 = "cat /proc/self/io"; public static final int PAGE_SIZE = 4096; + private final long baseReads; + private final long baseWrites; + + public IOCounterLinux() { + baseReads = getReads(); + baseWrites = getWrites(); + } + @Override public long getReads() { try { long reads = extractColumn(4); - return reads; + return reads - baseReads; } catch (IOException e) { try { long reads = extractRow(4); @@ -44,7 +52,7 @@ public long getWrites() { try { long writes = extractColumn(5); - return writes; + return writes - baseWrites; } catch (IOException e) { try { long writes = extractRow(5); @@ -73,6 +81,7 @@ String column = tokenizer.nextToken(); if (i == columnIndex) { ios += Long.parseLong(column); + break; } i++; }