Changeset 224
- Timestamp:
- 09/30/11 16:38:42 (13 years ago)
- Location:
- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/WeblogParser.java
r203 r224 45 45 /** 46 46 * <p> 47 * Maximal length of a session. All longer sessions will be prunde. Default: 48 * 100 49 * </p> 50 */ 51 private int maxLength = 100; 52 53 /** 54 * <p> 47 55 * Collection of generated sequences. 48 56 * </p> … … 121 129 public void setMinLength(int minLength) { 122 130 this.minLength = minLength; 131 } 132 133 /** 134 * <p> 135 * Sets the maximal length of a session. All sessions that contain more 136 * events will be pruned. 137 * </p> 138 * 139 * @param maxLength 140 * new maximal length 141 */ 142 public void setMaxLength(int maxLength) { 143 this.maxLength = maxLength; 123 144 } 124 145 … … 181 202 String path = uri.getPath(); 182 203 List<String> getVars = extractGetVarsFromUri(uri); 183 204 184 205 WebEvent event = new WebEvent(path, timestamp, postedVars, 185 206 getVars); 186 207 187 208 // find session and add event 188 209 List<Integer> sessionIds = cookieSessionMap.get(cookie); … … 196 217 Integer lastSessionIndex = sessionIds 197 218 .get(sessionIds.size() - 1); 198 List<WebEvent> lastSession = sequences.get(lastSessionIndex); 219 List<WebEvent> lastSession = sequences 220 .get(lastSessionIndex); 199 221 long lastEventTime = timestamp; 200 222 if (!lastSession.isEmpty()) { … … 211 233 } 212 234 } catch (URISyntaxException e) { 213 Console.traceln("Ignored line " + lineCounter + ": " + e.getMessage()); 235 Console.traceln("Ignored line " + lineCounter + ": " 236 + e.getMessage()); 214 237 } 215 238 } 216 239 } 217 pruneS hortSequences();240 pruneSequences(); 218 241 } 219 242 … … 223 246 * </p> 224 247 */ 225 private void pruneS hortSequences() {248 private void pruneSequences() { 226 249 Console.traceln("" + sequences.size() + " user sequences found"); 227 // prune sequences shorter than min-length 250 // prune sequences shorter than min-length and longer than maxLength 228 251 int i = 0; 229 252 while (i < sequences.size()) { 230 if (sequences.get(i).size() < minLength) { 253 if ((sequences.get(i).size() < minLength) 254 || sequences.get(i).size() > maxLength) { 231 255 sequences.remove(i); 232 256 } else { -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/commands/CMDloadSessionsFromClickstream.java
r183 r224 33 33 } 34 34 String source = (String) parameters.get(0); 35 String sequencesName = (String) parameters.get(1); 35 36 int timeout = -1; 36 37 int minLength = -1; 37 String sequencesName = "sequences"; 38 if (parameters.size() >= 3) { 39 timeout = Integer.parseInt((String) parameters.get(1)); 40 minLength = Integer.parseInt((String) parameters.get(2)); 41 } 38 int maxLength = -1; 42 39 if (parameters.size() >= 4) { 43 sequencesName = (String) parameters.get(3); 40 timeout = Integer.parseInt((String) parameters.get(2)); 41 minLength = Integer.parseInt((String) parameters.get(3)); 42 maxLength = Integer.parseInt((String) parameters.get(4)); 44 43 } 45 44 … … 48 47 parser.setTimeout(timeout); 49 48 parser.setMinLength(minLength); 49 parser.setMaxLength(maxLength); 50 50 } 51 51 try { … … 73 73 @Override 74 74 public void help() { 75 Console.println("Usage: loadSessionsFromClickstream <filename> {<timeout> <minSessionLength>} {<sequencesName>}");75 Console.println("Usage: loadSessionsFromClickstream <filename> <sequencesName> {<timeout> <minSessionLength> <maxSessionLength>}"); 76 76 } 77 77
Note: See TracChangeset
for help on using the changeset viewer.