Utils-eurocon: script for discarding "error" lines
[p2p-testing-infrastructure.git] / Utils / test-socket-signal / test / process / inactive_timespan_drop_irrelevant
diff --git a/Utils/test-socket-signal/test/process/inactive_timespan_drop_irrelevant b/Utils/test-socket-signal/test/process/inactive_timespan_drop_irrelevant
new file mode 100755 (executable)
index 0000000..209336d
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/awk -f
+
+#
+# expect lines consisting of inactivity time and manifested time
+#   512   564
+#   32    54
+#
+# discard irrelevant/error lines where manifested time is shorter than
+# inactivity time
+#
+
+{
+       # only print relevant
+       if ($2 > 0) {
+               if ($2 > $1)
+                       print $1, $2;
+               if (($1-$2) / $1 < 0.10) {
+                       print $1, $2;
+               }
+       }
+}