What    |Removed                     |Added
                 CC|                            |

--- Comment #10 from ---
Created attachment 37237
extract the information to sort on from the QueryStats and sort on that

I resolved this bug in SlowQueryReport,using the second proposal by Felix
Schumacher -- "extract the information to sort on from the QueryStats and sort
on that information".

1, add a constructor in the inner class QueryStats for QueryStats clone
         * Create a new QueryStats object based on another QueryStats object.
         * For resolving Bug 58489,
         * @param qs
        QueryStats(QueryStats qs){
            this.query = qs.query;
            this.nrOfInvocations = qs.nrOfInvocations;
            this.maxInvocationTime = qs.maxInvocationTime;
            this.maxInvocationDate = qs.maxInvocationDate;
            this.minInvocationTime = qs.minInvocationTime;
            this.minInvocationDate = qs.minInvocationDate;
            this.totalInvocationTime = qs.totalInvocationTime;
            this.failures = qs.failures;
            this.prepareCount = qs.prepareCount;
            this.prepareTime = qs.prepareTime;
            this.lastInvocation = qs.lastInvocation;

2, modify method removeOldest
    protected void removeOldest(ConcurrentHashMap<String,QueryStats> queries) {
        ArrayList<QueryStats> list = new ArrayList<>(queries.values());
        //For resolving Bug 58489,
        //make a list of cloned QueryStats objects
        for(int i=0; i<list.size(); i++){
            list.set(i, new QueryStats(list.get(i)));
        Collections.sort(list, queryStatsComparator);
        int removeIndex = 0;
        while (queries.size() > maxQueries) {
            String sql = list.get(removeIndex).getQuery();
            if (log.isDebugEnabled()) log.debug("Removing slow query, capacity

You are receiving this mail because:
You are the assignee for the bug.
To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to