Package org.apache.ofbiz.webapp.stats
Class ServerHitBin
- java.lang.Object
-
- org.apache.ofbiz.webapp.stats.ServerHitBin
-
public class ServerHitBin extends java.lang.Object
Counts server hits and tracks statistics for request, events and views
Handles total stats since the server started and binned stats according to settings in the serverstats.properties file.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ENTITY
static java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Deque<ServerHitBin>>
entityHistory
static java.util.concurrent.ConcurrentMap<java.lang.String,ServerHitBin>
entitySinceStarted
static int
EVENT
static java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Deque<ServerHitBin>>
eventHistory
static java.util.concurrent.ConcurrentMap<java.lang.String,ServerHitBin>
eventSinceStarted
static java.lang.String
module
static int
REQUEST
static java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Deque<ServerHitBin>>
requestHistory
static java.util.concurrent.ConcurrentMap<java.lang.String,ServerHitBin>
requestSinceStarted
static int
SERVICE
static java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Deque<ServerHitBin>>
serviceHistory
static java.util.concurrent.ConcurrentMap<java.lang.String,ServerHitBin>
serviceSinceStarted
static int
VIEW
static java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Deque<ServerHitBin>>
viewHistory
static java.util.concurrent.ConcurrentMap<java.lang.String,ServerHitBin>
viewSinceStarted
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
countEntity(java.lang.String id, javax.servlet.http.HttpServletRequest request, long startTime, long runningTime, GenericValue userLogin)
static void
countEvent(java.lang.String id, javax.servlet.http.HttpServletRequest request, long startTime, long runningTime, GenericValue userLogin)
static void
countRequest(java.lang.String id, javax.servlet.http.HttpServletRequest request, long startTime, long runningTime, GenericValue userLogin)
static void
countService(java.lang.String id, javax.servlet.http.HttpServletRequest request, long startTime, long runningTime, GenericValue userLogin)
static void
countView(java.lang.String id, javax.servlet.http.HttpServletRequest request, long startTime, long runningTime, GenericValue userLogin)
double
getAvgTime()
double
getAvgTimeSeconds()
long
getBinLength()
returns endTime - startTimedouble
getBinLengthMinutes()
returns (endTime - startTime)/60000Delegator
getDelegator()
long
getEndTime()
Returns the end time if the length of the bin is limited, otherwise returns the current system timejava.lang.String
getEndTimeString()
Returns the end time if the length of the bin is limited, otherwise returns the current system timedouble
getHitsPerMinute()
return the hits per minute using the entire length of the bin as returned by getBinLengthMinutes()java.lang.String
getId()
long
getMaxTime()
double
getMaxTimeSeconds()
long
getMinTime()
double
getMinTimeSeconds()
long
getNumberHits()
long
getStartTime()
returns the startTime of the binjava.lang.String
getStartTimeString()
returns the startTime of the binlong
getTotalRunningTime()
int
getType()
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
REQUEST
public static final int REQUEST
- See Also:
- Constant Field Values
-
EVENT
public static final int EVENT
- See Also:
- Constant Field Values
-
VIEW
public static final int VIEW
- See Also:
- Constant Field Values
-
ENTITY
public static final int ENTITY
- See Also:
- Constant Field Values
-
SERVICE
public static final int SERVICE
- See Also:
- Constant Field Values
-
requestHistory
public static final java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Deque<ServerHitBin>> requestHistory
-
eventHistory
public static final java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Deque<ServerHitBin>> eventHistory
-
viewHistory
public static final java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Deque<ServerHitBin>> viewHistory
-
entityHistory
public static final java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Deque<ServerHitBin>> entityHistory
-
serviceHistory
public static final java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Deque<ServerHitBin>> serviceHistory
-
requestSinceStarted
public static final java.util.concurrent.ConcurrentMap<java.lang.String,ServerHitBin> requestSinceStarted
-
eventSinceStarted
public static final java.util.concurrent.ConcurrentMap<java.lang.String,ServerHitBin> eventSinceStarted
-
viewSinceStarted
public static final java.util.concurrent.ConcurrentMap<java.lang.String,ServerHitBin> viewSinceStarted
-
entitySinceStarted
public static final java.util.concurrent.ConcurrentMap<java.lang.String,ServerHitBin> entitySinceStarted
-
serviceSinceStarted
public static final java.util.concurrent.ConcurrentMap<java.lang.String,ServerHitBin> serviceSinceStarted
-
-
Method Detail
-
countRequest
public static void countRequest(java.lang.String id, javax.servlet.http.HttpServletRequest request, long startTime, long runningTime, GenericValue userLogin)
-
countEvent
public static void countEvent(java.lang.String id, javax.servlet.http.HttpServletRequest request, long startTime, long runningTime, GenericValue userLogin)
-
countView
public static void countView(java.lang.String id, javax.servlet.http.HttpServletRequest request, long startTime, long runningTime, GenericValue userLogin)
-
countEntity
public static void countEntity(java.lang.String id, javax.servlet.http.HttpServletRequest request, long startTime, long runningTime, GenericValue userLogin)
-
countService
public static void countService(java.lang.String id, javax.servlet.http.HttpServletRequest request, long startTime, long runningTime, GenericValue userLogin)
-
getDelegator
public Delegator getDelegator()
-
getId
public java.lang.String getId()
-
getType
public int getType()
-
getStartTime
public long getStartTime()
returns the startTime of the bin
-
getEndTime
public long getEndTime()
Returns the end time if the length of the bin is limited, otherwise returns the current system time
-
getStartTimeString
public java.lang.String getStartTimeString()
returns the startTime of the bin
-
getEndTimeString
public java.lang.String getEndTimeString()
Returns the end time if the length of the bin is limited, otherwise returns the current system time
-
getBinLength
public long getBinLength()
returns endTime - startTime
-
getBinLengthMinutes
public double getBinLengthMinutes()
returns (endTime - startTime)/60000
-
getNumberHits
public long getNumberHits()
-
getMinTime
public long getMinTime()
-
getMaxTime
public long getMaxTime()
-
getTotalRunningTime
public long getTotalRunningTime()
-
getMinTimeSeconds
public double getMinTimeSeconds()
-
getMaxTimeSeconds
public double getMaxTimeSeconds()
-
getAvgTime
public double getAvgTime()
-
getAvgTimeSeconds
public double getAvgTimeSeconds()
-
getHitsPerMinute
public double getHitsPerMinute()
return the hits per minute using the entire length of the bin as returned by getBinLengthMinutes()
-
-