- Timestamp:
- 09/30/11 16:38:42 (13 years ago)
- File:
-
- 1 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 {
Note: See TracChangeset
for help on using the changeset viewer.