changeset 1261:7491572234e7

flow - ST-201 - lmin lmax
author Devel 1
date Thu, 02 Jul 2020 13:15:11 +0200
parents ced86e416863
children 4682303ee2ed
files stress-tester/src/main/java/com/passus/st/scanner/HttpUrlSequencePayloadAnalyzer.java
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/scanner/HttpUrlSequencePayloadAnalyzer.java	Thu Jul 02 10:57:35 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/scanner/HttpUrlSequencePayloadAnalyzer.java	Thu Jul 02 13:15:11 2020 +0200
@@ -151,14 +151,11 @@
 
             File dir = new File(".");
             Gson gson = new Gson();
-            String patternStr = command.fold ? "^seq_(L\\d+)f_out[.]json$" : "^seq_(L\\d+)_out[.]json$";
-            Pattern pattern = Pattern.compile(patternStr);
-            for (String fname : dir.list()) {
-                Matcher m = pattern.matcher(fname);
-                if (m.matches()) {
-                    FlowAnalyzerUtils.AnalyzerResult result = FlowAnalyzerUtils.readResult(new File(dir, fname), gson);
-                    metric.addSequences(m.group(1), result.getSequencesNoFold());
-                }
+            final String format = command.fold ? "seq_L%df_out.json" : "seq_L%d_out.json";
+            for (int i = command.lmin; i <= command.lmax; i++) {
+                String fname = String.format(format, i);
+                FlowAnalyzerUtils.AnalyzerResult result = FlowAnalyzerUtils.readResult(new File(dir, fname), gson);
+                metric.addSequences(Integer.toString(i), result.getSequencesNoFold());
             }
 
         } catch (Exception ex) {