Changeset 68 for trunk/EventBenchConsole/src/de
- Timestamp:
- 06/15/11 16:54:11 (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
r54 r68 14 14 15 15 import de.ugoe.cs.eventbench.web.data.WebEvent; 16 import de.ugoe.cs.util.console.Console; 16 17 17 18 public class WeblogParser { 18 19 19 20 private long timeout; 21 22 private int minLength = 2; 20 23 21 24 private List<List<WebEvent>> sequences; … … 31 34 public List<List<WebEvent>> getSequences() { 32 35 return sequences; 36 } 37 38 public void setTimeout(long timeout) { 39 this.timeout = timeout; 40 } 41 42 public void setMinLength(int minLength) { 43 this.minLength = minLength; 33 44 } 34 45 … … 89 100 } 90 101 } 102 Console.traceln(""+sequences.size()+ " user sequences found"); 103 // prune sequences shorter than min-length 104 for( int i=0; i<sequences.size(); i++ ) { 105 if( sequences.get(i).size()<minLength ) { 106 sequences.remove(i); 107 } 108 } 109 Console.traceln(""+sequences.size()+ " remaining after pruning of sequences shorter than " + minLength); 91 110 } 92 111 } -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/commands/CMDloadSessionsFromClickstream.java
r54 r68 16 16 @Override 17 17 public void run(List<Object> parameters) { 18 // TODO Auto-generated method stub19 18 if( parameters.size() < 1 ) { 20 19 throw new InvalidParameterException(); 21 20 } 22 21 String source = (String) parameters.get(0); 22 int timeout = -1; 23 int minLength = -1; 24 if( parameters.size() ==3 ) { 25 timeout = Integer.parseInt((String) parameters.get(1)); 26 minLength = Integer.parseInt((String) parameters.get(2)); 27 } 23 28 24 WeblogParser parser = new WeblogParser(); 29 WeblogParser parser = new WeblogParser();; 30 if( timeout!=-1 ) { 31 parser.setTimeout(timeout); 32 parser.setMinLength(minLength); 33 } 25 34 try { 26 35 parser.parseFile(source); … … 39 48 @Override 40 49 public void help() { 41 // TODO Auto-generated method stub 42 50 Console.println("Usage: loadSessionsFromClickstream <filename> {<timeout> <minSessionLength>}"); 43 51 } 44 52
Note: See TracChangeset
for help on using the changeset viewer.