    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.jigsaw.http.httpdStatistics

    java.lang.Object
       |
       +----org.w3c.jigsaw.http.httpdStatistics

public class httpdStatistics
extends Object

This class maintains server wide statistics about hits. This class should probably be coded as a resource itself, and made accessible through a specific HTTPResource. I am just having fun for the time being.

##

r_max
  The maximum processing time in ms.
r_min
  The min processing time in ms.
server
start_time
  The date at which the server was started (ms since Java epoch).
t_bytes
  The total number of emited bytes.
t_hits
  The total number of hits.
t_req
  The total time spent in processing requests in ms.
u_max
  The URL that has been processed the slowest.
u_min
  The URL that has been processed the fastest.

##

getEmittedBytes()
  Get the total number of bytes emited.
getFreeThreadCount()
  Get the number of free threads in the server.
getHitCount()
  Get the total number of hits.
getIdleThreadCount()
  Get the number of idle threads in the server.
getMaxRequestTime()
  Get the max request processing time.
getMaxRequestURL()
  Get the URL of the request that took the longest time to be processed.
getMeanRequestTime()
  Get the mean request processing time.
getMinRequestTime()
  Get the min request processing time.
getMinRequestURL()
  Get the URL of the request that took the smallest time to be processed.
getServerLoad()
  Get the current server load.
getStartTime()
  Get the time at which the server was started.
getTotalThreadCount()
  Get the total number of client threads.
updateStatistics(Client, Request, Reply, int, long)
  Update the current statistics with the given request.

##

server

     protected httpd server

r_min

     protected long r_min

  The min processing time in ms.

u_min

     protected URL u_min

  The URL that has been processed the fastest.

r_max

     protected long r_max

  The maximum processing time in ms.

u_max

     protected URL u_max

  The URL that has been processed the slowest.

t_hits

     protected long t_hits

  The total number of hits.

t_bytes

     protected long t_bytes

  The total number of emited bytes.

t_req

     protected long t_req

  The total time spent in processing requests in ms.

start_time

     protected long start_time

  The date at which the server was started (ms since Java epoch).

##

updateStatistics

     protected synchronized void updateStatistics(Client client,
                                                  Request request,
                                                  Reply reply,
                                                  int nbytes,
                                                  long duration)

  Update the current statistics with the given request.

  Parameters:
    client - The client that processed the request.
    request - The request that has been processed.
    nbytes - The number of emited bytes in reply's body.
    duration - The processing time of the request.

getServerLoad

     public int getServerLoad()

  Get the current server load.

  Returns:
    A number between 1 and 4.

getFreeThreadCount

     public int getFreeThreadCount()

  Get the number of free threads in the server.

  Returns:
    The number of threads ready to server client requests.

getIdleThreadCount

     public int getIdleThreadCount()

  Get the number of idle threads in the server. Idle threads are the threads ready to accept more requests on a given connection.

  Returns:
    The number of idle threads.

getTotalThreadCount

     public int getTotalThreadCount()

  Get the total number of client threads.

  Returns:
    The total number of created threads.

getHitCount

     public long getHitCount()

  Get the total number of hits.

  Returns:
    The total number of processed requests since the server is up.

getMeanRequestTime

     public long getMeanRequestTime()

  Get the mean request processing time.

  Returns:
    The average time to process a request.

getMaxRequestTime

     public long getMaxRequestTime()

  Get the max request processing time.

  Returns:
    A long giving the maximum duration for a request.

getMaxRequestURL

     public URL getMaxRequestURL()

  Get the URL of the request that took the longest time to be processed.

  Returns:
    A String giving the URL of the corresponding request, or null if no request has been processed yet.

getMinRequestTime

     public long getMinRequestTime()

  Get the min request processing time.

  Returns:
    A long giving the minimum request processing time.

getMinRequestURL

     public URL getMinRequestURL()

  Get the URL of the request that took the smallest time to be processed.

  Returns:
    A String giving the URL of the corresponding request, or null if no request has been processed yet.

getEmittedBytes

     public long getEmittedBytes()

  Get the total number of bytes emited.

  Returns:
    A long giving the total number of bytes emited by the server. This count that not include the reply's header, but only the reply's body (or entity size).

getStartTime

     public long getStartTime()

  Get the time at which the server was started.

  Returns:
    A number of milliseconds since java epoch, giving the date at which the server started.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index