Changeset 232 for trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/commands/CMDloadSessionsFromClickstream.java
- Timestamp:
- 10/05/11 00:39:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/commands/CMDloadSessionsFromClickstream.java
r226 r232 5 5 import java.security.InvalidParameterException; 6 6 import java.text.ParseException; 7 import java.util.Collection; 7 8 import java.util.List; 8 9 9 10 import de.ugoe.cs.eventbench.data.GlobalDataContainer; 10 11 import de.ugoe.cs.eventbench.web.WeblogParser; 12 import de.ugoe.cs.eventbench.web.data.WebEvent; 11 13 import de.ugoe.cs.util.console.Command; 12 14 import de.ugoe.cs.util.console.Console; … … 38 40 int minLength = -1; 39 41 int maxLength = -1; 40 if( parameters.size()>=3 ) { 42 boolean generateFrequentUsers = false; 43 int frequentUserThreshold = 20; 44 if (parameters.size() >= 3) { 41 45 serverUrl = (String) parameters.get(2); 42 46 } 43 if (parameters.size() >= 5) {47 if (parameters.size() >= 6) { 44 48 timeout = Integer.parseInt((String) parameters.get(3)); 45 49 minLength = Integer.parseInt((String) parameters.get(4)); 46 50 maxLength = Integer.parseInt((String) parameters.get(5)); 47 51 } 52 if (parameters.size() >= 8) { 53 generateFrequentUsers = Boolean.parseBoolean((String) parameters 54 .get(6)); 55 frequentUserThreshold = Integer 56 .parseInt((String) parameters.get(7)); 57 } 48 58 49 59 WeblogParser parser = new WeblogParser(); 50 if ( serverUrl!=null) {60 if (serverUrl != null) { 51 61 parser.setUrl(serverUrl); 52 62 } … … 55 65 parser.setMinLength(minLength); 56 66 parser.setMaxLength(maxLength); 67 } 68 if (generateFrequentUsers) { 69 parser.setFrequentUserThreshold(frequentUserThreshold); 57 70 } 58 71 try { … … 71 84 Console.traceln("Old data \"" + sequencesName + "\" overwritten"); 72 85 } 86 if (generateFrequentUsers) { 87 List<String> frequentUserIDs = parser.getFrequentUsers(); 88 List<Collection<List<WebEvent>>> frequentUserSessions = parser 89 .getFrequentUserSequences(); 90 for (int i = 0; i < frequentUserIDs.size(); i++) { 91 GlobalDataContainer.getInstance().addData( 92 sequencesName + "_" + frequentUserIDs.get(i), 93 frequentUserSessions.get(i)); 94 } 95 } 73 96 } 74 97 … … 80 103 @Override 81 104 public void help() { 82 Console.println("Usage: loadSessionsFromClickstream <filename> <sequencesName> {<serverUrl>} {<timeout> <minSessionLength> <maxSessionLength>} ");105 Console.println("Usage: loadSessionsFromClickstream <filename> <sequencesName> {<serverUrl>} {<timeout> <minSessionLength> <maxSessionLength>} {<generateFrequentUsers> <frequentUserThreshold>}"); 83 106 } 84 107
Note: See TracChangeset
for help on using the changeset viewer.