Class 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 Detail

      • module

        public static final java.lang.String module
      • 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,
                                        HttpServletRequest request,
                                        long startTime,
                                        long runningTime,
                                        GenericValue userLogin)
      • countEvent

        public static void countEvent​(java.lang.String id,
                                      HttpServletRequest request,
                                      long startTime,
                                      long runningTime,
                                      GenericValue userLogin)
      • countView

        public static void countView​(java.lang.String id,
                                     HttpServletRequest request,
                                     long startTime,
                                     long runningTime,
                                     GenericValue userLogin)
      • countEntity

        public static void countEntity​(java.lang.String id,
                                       HttpServletRequest request,
                                       long startTime,
                                       long runningTime,
                                       GenericValue userLogin)
      • countService

        public static void countService​(java.lang.String id,
                                        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()