FileDocCategorySizeDatePackage
RequestGroupInfo.javaAPI DocGlassfish v2 API17492Fri May 04 22:32:42 BST 2007org.apache.coyote

RequestGroupInfo

public class RequestGroupInfo extends Object
This can be moved to top level ( eventually with a better name ). It is currently used only as a JMX artifact, to agregate the data collected from each RequestProcessor thread.

Fields Summary
ArrayList
processors
private long
deadMaxTime
private long
deadProcessingTime
private int
deadRequestCount
private int
deadErrorCount
private long
deadBytesReceived
private long
deadBytesSent
private long
deadCount2xx
private long
deadCount3xx
private long
deadCount4xx
private long
deadCount5xx
private long
deadCountOther
private long
deadCount200
private long
deadCount302
private long
deadCount304
private long
deadCount400
private long
deadCount401
private long
deadCount403
private long
deadCount404
private long
deadCount503
private long
countOpenConnections
private long
maxOpenConnections
Constructors Summary
Methods Summary
public synchronized voidaddRequestProcessor(RequestInfo rp)

    // END S1AS


           
        processors.add( rp );
    
public synchronized voiddecreaseCountOpenConnections()

        countOpenConnections--;
    
public synchronized longgetBytesReceived()

        long bytes=deadBytesReceived;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            bytes += rp.getBytesReceived();
        }
        return bytes;
    
public synchronized longgetBytesSent()

        long bytes=deadBytesSent;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            bytes += rp.getBytesSent();
        }
        return bytes;
    
public synchronized longgetCount200()

        long ret = deadCount200;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount200();
        }
        return ret;
    
public synchronized longgetCount2xx()

        long ret = deadCount2xx;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount2xx();
        }
        return ret;
    
public synchronized longgetCount302()

        long ret = deadCount302;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount302();
        }
        return ret;
    
public synchronized longgetCount304()

        long ret = deadCount304;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount304();
        }
        return ret;
    
public synchronized longgetCount3xx()

        long ret = deadCount3xx;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount3xx();
        }
        return ret;
    
public synchronized longgetCount400()

        long ret = deadCount400;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount400();
        }
        return ret;
    
public synchronized longgetCount401()

        long ret = deadCount401;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount401();
        }
        return ret;
    
public synchronized longgetCount403()

        long ret = deadCount403;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount403();
        }
        return ret;
    
public synchronized longgetCount404()

        long ret = deadCount404;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount404();
        }
        return ret;
    
public synchronized longgetCount4xx()

        long ret = deadCount4xx;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount4xx();
        }
        return ret;
    
public synchronized longgetCount503()

        long ret = deadCount503;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount503();
        }
        return ret;
    
public synchronized longgetCount5xx()

        long ret = deadCount5xx;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCount5xx();
        }
        return ret;
    
public synchronized longgetCountOpenConnections()

        return countOpenConnections;
    
public synchronized longgetCountOther()

        long ret = deadCountOther;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            ret += rp.getCountOther();
        }
        return ret;
    
public synchronized intgetErrorCount()

        int requestCount=deadErrorCount;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            requestCount += rp.getErrorCount();
        }
        return requestCount;
    
public longgetLastRequestCompletionTime()
Gets the time when the last request was completed.

return
The time when the last request was completed.


        long lastRequestCompletionTime = 0;

        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            if (rp.getLastRequestCompletionTime() > lastRequestCompletionTime) {
                lastRequestCompletionTime = rp.getLastRequestCompletionTime();
            }
        }

        return lastRequestCompletionTime;
    
public java.lang.StringgetLastRequestMethod()
Gets the HTTP method of the last request serviced.

return
The HTTP method of the last request serviced


        long lastRequestCompletionTime = 0;
        String lastRequestMethod = null;

        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            if (rp.getLastRequestCompletionTime() > lastRequestCompletionTime) {
                lastRequestCompletionTime = rp.getLastRequestCompletionTime();
                lastRequestMethod = rp.getLastRequestMethod();
            }
        }

        return lastRequestMethod;
    
public java.lang.StringgetLastRequestURI()
Gets the URI of the last request serviced.

return
The URI of the last request serviced


        long lastRequestCompletionTime = 0;
        String lastRequestURI = null;

        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            if (rp.getLastRequestCompletionTime() > lastRequestCompletionTime) {
                lastRequestCompletionTime = rp.getLastRequestCompletionTime();
                lastRequestURI = rp.getLastRequestURI();
            }
        }

        return lastRequestURI;
    
public synchronized longgetMaxOpenConnections()

        return maxOpenConnections;
    
public synchronized longgetMaxTime()

        long maxTime=deadMaxTime;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            if( maxTime < rp.getMaxTime() ) maxTime=rp.getMaxTime();
        }
        return maxTime;
    
public synchronized longgetProcessingTime()

        long time=deadProcessingTime;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            time += rp.getProcessingTime();
        }
        return time;
    
public synchronized intgetRequestCount()

        int requestCount=deadRequestCount;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            requestCount += rp.getRequestCount();
        }
        return requestCount;
    
public synchronized voidincreaseCountOpenConnections()

        countOpenConnections++;
        if (countOpenConnections > maxOpenConnections) {
            maxOpenConnections = countOpenConnections;
        }
    
public synchronized voidremoveRequestProcessor(RequestInfo rp)

        if( rp != null ) {
            if( deadMaxTime < rp.getMaxTime() )
                deadMaxTime = rp.getMaxTime();
            deadProcessingTime += rp.getProcessingTime();
            deadRequestCount += rp.getRequestCount();
            deadErrorCount += rp.getErrorCount();
            deadBytesReceived += rp.getBytesReceived();
            deadBytesSent += rp.getBytesSent();

            // START S1AS
            deadCount2xx += rp.getCount2xx();
            deadCount3xx += rp.getCount3xx();
            deadCount4xx += rp.getCount4xx();
            deadCount5xx += rp.getCount5xx();
            deadCountOther += rp.getCountOther();
            deadCount200 += rp.getCount200();
            deadCount302 += rp.getCount302();
            deadCount304 += rp.getCount304();
            deadCount400 += rp.getCount400();
            deadCount401 += rp.getCount401();
            deadCount403 += rp.getCount403();
            deadCount404 += rp.getCount404();
            deadCount503 += rp.getCount503();
            // END S1AS

            processors.remove( rp );
        }
    
public voidresetCounters()

        this.setBytesReceived(0);
        this.setBytesSent(0);
        this.setRequestCount(0);
        this.setProcessingTime(0);
        this.setMaxTime(0);
        this.setErrorCount(0);
        // START S1AS
        this.setCount2xx(0);
        this.setCount3xx(0);
        this.setCount4xx(0);
        this.setCount5xx(0);
        this.setCountOther(0);
        this.setCount200(0);
        this.setCount302(0);
        this.setCount304(0);
        this.setCount400(0);
        this.setCount401(0);
        this.setCount403(0);
        this.setCount404(0);
        this.setCount503(0);
        this.setCountOpenConnections(0);
        this.setMaxOpenConnections(0);
        // END S1AS
    
public synchronized voidsetBytesReceived(long bytesReceived)

        deadBytesReceived = bytesReceived;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            rp.setBytesReceived( bytesReceived );
        }
    
public synchronized voidsetBytesSent(long bytesSent)

        deadBytesSent = bytesSent;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            rp.setBytesSent( bytesSent );
        }
    
public synchronized voidsetCount200(long count)

        deadCount200 = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount200(count);
        }
    
public synchronized voidsetCount2xx(long count)

        deadCount2xx = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount2xx(count);
        }
    
public synchronized voidsetCount302(long count)

        deadCount302 = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount302(count);
        }
    
public synchronized voidsetCount304(long count)

        deadCount304 = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount304(count);
        }
    
public synchronized voidsetCount3xx(long count)

        deadCount3xx = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount3xx(count);
        }
    
public synchronized voidsetCount400(long count)

        deadCount400 = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount400(count);
        }
    
public synchronized voidsetCount401(long count)

        deadCount401 = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount401(count);
        }
    
public synchronized voidsetCount403(long count)

        deadCount403 = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount403(count);
        }
    
public synchronized voidsetCount404(long count)

        deadCount404 = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount404(count);
        }
    
public synchronized voidsetCount4xx(long count)

        deadCount4xx = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount4xx(count);
        }
    
public synchronized voidsetCount503(long count)

        deadCount503 = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount503(count);
        }
    
public synchronized voidsetCount5xx(long count)

        deadCount5xx = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCount5xx(count);
        }
    
public synchronized voidsetCountOpenConnections(long count)

        countOpenConnections = count;
        if (countOpenConnections > maxOpenConnections) {
            maxOpenConnections = countOpenConnections;
        }
    
public synchronized voidsetCountOther(long count)

        deadCountOther = count;
        for (int i=0; i<processors.size(); i++) {
            RequestInfo rp = processors.get(i);
            rp.setCountOther(count);
        }
    
public synchronized voidsetErrorCount(int errorCount)

        deadErrorCount = errorCount;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            rp.setErrorCount( errorCount);
        }
    
public synchronized voidsetMaxOpenConnections(long count)

        maxOpenConnections = count;
    
public synchronized voidsetMaxTime(long maxTime)

        deadMaxTime = maxTime;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            rp.setMaxTime(maxTime);
        }
    
public synchronized voidsetProcessingTime(long totalTime)

        deadProcessingTime = totalTime;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            rp.setProcessingTime( totalTime );
        }
    
public synchronized voidsetRequestCount(int requestCount)

        deadRequestCount = requestCount;
        for( int i=0; i<processors.size(); i++ ) {
            RequestInfo rp = processors.get( i );
            rp.setRequestCount( requestCount );
        }