Ignore:
Timestamp:
09/30/11 16:38:42 (13 years ago)
Author:
sherbold
Message:
  • added parameter maxLength to command loadSessionsFromClickstream and the WeblogParser? for pruning of unexplained very long sequences
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/WeblogParser.java

    r203 r224  
    4545        /** 
    4646         * <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> 
    4755         * Collection of generated sequences. 
    4856         * </p> 
     
    121129        public void setMinLength(int minLength) { 
    122130                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; 
    123144        } 
    124145 
     
    181202                                        String path = uri.getPath(); 
    182203                                        List<String> getVars = extractGetVarsFromUri(uri); 
    183          
     204 
    184205                                        WebEvent event = new WebEvent(path, timestamp, postedVars, 
    185206                                                        getVars); 
    186          
     207 
    187208                                        // find session and add event 
    188209                                        List<Integer> sessionIds = cookieSessionMap.get(cookie); 
     
    196217                                        Integer lastSessionIndex = sessionIds 
    197218                                                        .get(sessionIds.size() - 1); 
    198                                         List<WebEvent> lastSession = sequences.get(lastSessionIndex); 
     219                                        List<WebEvent> lastSession = sequences 
     220                                                        .get(lastSessionIndex); 
    199221                                        long lastEventTime = timestamp; 
    200222                                        if (!lastSession.isEmpty()) { 
     
    211233                                        } 
    212234                                } catch (URISyntaxException e) { 
    213                                         Console.traceln("Ignored line " + lineCounter + ": " + e.getMessage()); 
     235                                        Console.traceln("Ignored line " + lineCounter + ": " 
     236                                                        + e.getMessage()); 
    214237                                } 
    215238                        } 
    216239                } 
    217                 pruneShortSequences(); 
     240                pruneSequences(); 
    218241        } 
    219242 
     
    223246         * </p> 
    224247         */ 
    225         private void pruneShortSequences() { 
     248        private void pruneSequences() { 
    226249                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 
    228251                int i = 0; 
    229252                while (i < sequences.size()) { 
    230                         if (sequences.get(i).size() < minLength) { 
     253                        if ((sequences.get(i).size() < minLength) 
     254                                        || sequences.get(i).size() > maxLength) { 
    231255                                sequences.remove(i); 
    232256                        } else { 
Note: See TracChangeset for help on using the changeset viewer.