Class PartitionStatistics

    • Field Detail

      • m_nPartition

        protected int m_nPartition
        The partition ID.
      • m_ldtLastTransfer

        protected long m_ldtLastTransfer
        The time at this this partition was last transferred.
      • m_ldtSampleStart

        protected long m_ldtSampleStart
        The sample start time.
      • m_cSampleMillis

        protected long m_cSampleMillis
        The sample duration (in ms).
      • m_cbStorageDirect

        protected long m_cbStorageDirect
        The portion of the partition size that is obtained directly from partitioned maps (in bytes). This value is only updated on the service thread and doesn't have to be atomic.
      • m_cbStorageIndirect

        protected AtomicLong m_cbStorageIndirect
        The portion of the partition size that cannot be obtained directly and has to be adjusted upon each cache entry update (in bytes).
      • m_cRequests

        protected long m_cRequests
        The number of requests on this partition during the sampling period.
      • m_cExecutionTime

        protected long m_cExecutionTime
        The total amount of time (in ms) that tasks/requests were executing.
      • m_cWaitTime

        protected long m_cWaitTime
        The total amount of time (in ms) that tasks/requests spent waiting.
    • Constructor Detail

      • PartitionStatistics

        public PartitionStatistics()
        Default constructor.
      • PartitionStatistics

        public PartitionStatistics​(int nPartition,
                                   long ldtArrived)
        Constructor for the specified partition.
        Parameters:
        nPartition - the partition id
        ldtArrived - the time at which this partition was transferred in
    • Method Detail

      • copyFrom

        public PartitionStatistics copyFrom​(PartitionStatistics stats)
        Copy the statistics from the specified PartitionStatistics reference.
        Parameters:
        stats - the statistics to copy from
        Returns:
        the copied statistics
      • recordRequest

        public void recordRequest​(long cWaitMillis,
                                  long cExecMillis)
        Update the partition statistics to record the specified request.
        Parameters:
        cWaitMillis - the time (in ms) that the task/request spent waiting
        cExecMillis - the time (in ms) that the task/request spent executing
      • adjustIndirectStorageSize

        public void adjustIndirectStorageSize​(long cbDelta)
        Adjust the non-PartitionAwareBackingMap storage size of the partition by the specified amount.
        Parameters:
        cbDelta - the amount to adjust the size (could be negative)
      • setDirectStorageSize

        public PartitionStatistics setDirectStorageSize​(long cb)
        Set the PartitionAwareBackingMaps storage size of the partition.

        Note that this method is called only on the service thread at the end of sampling period.

        Parameters:
        cb - total storage size of the PartitionAwareBackingMaps in the partition
        Returns:
        the PartitionStatistics reference
      • reset

        public void reset()
        Reset the partition statistics state.
      • getPartition

        public int getPartition()
        Return the id of the partition for which these statistics apply.
        Returns:
        the partition id
      • getLastTransferTime

        public long getLastTransferTime()
        Return the time (on the primary owner) at which the partition was last transferred or restored.
        Returns:
        the time at which the specified storage was last transferred
      • getTaskExecutionTime

        public long getTaskExecutionTime()
        Return the total amount of time (in ms) that tasks/requests for this partition spent executing.
        Returns:
        the total amount of time that tasks spent waiting
      • getTaskWaitTime

        public long getTaskWaitTime()
        Return the total amount of time (in ms) that tasks/requests for this partition spent waiting before execution.
        Returns:
        the total amount of time that tasks spent waiting
      • getRequestCount

        public long getRequestCount()
        Return the number of requests/second issued for the partition.
        Returns:
        the request count/second
      • getDirectStorageSize

        protected long getDirectStorageSize()
        Return the partition size from partitioned maps.
        Returns:
        the partition size from partitioned maps
      • getIndirectStorageSize

        protected long getIndirectStorageSize()
        Return the partition size from non-PartitionAwareBackingMaps.
        Returns:
        the partition size from non-PartitionAwareBackingMaps
      • getStorageSize

        public long getStorageSize()
        Return the total size (in bytes) of the storage associated with the partition.
        Returns:
        the storage size
      • getSampleStartTime

        public long getSampleStartTime()
        Return the time (on the sampling member) at which this data collection for this sample started.
        Returns:
        the time that this sample started
      • getSampleDuration

        public long getSampleDuration()
        Return the duration (ms) over which data was collected for this sample.
        Returns:
        the sample duration
      • readExternal

        public void readExternal​(DataInput in)
                          throws IOException
        Restore the contents of this object by loading the object's state from the passed DataInput object.
        Specified by:
        readExternal in interface ExternalizableLite
        Parameters:
        in - the DataInput stream to read data from in order to restore the state of this object
        Throws:
        IOException - if an I/O exception occurs
        NotActiveException - if the object is not in its initial state, and therefore cannot be deserialized into
      • writeExternal

        public void writeExternal​(DataOutput out)
                           throws IOException
        Save the contents of this object by storing the object's state into the passed DataOutput object.
        Specified by:
        writeExternal in interface ExternalizableLite
        Parameters:
        out - the DataOutput stream to write the state of this object to
        Throws:
        IOException - if an I/O exception occurs
      • getDescription

        public String getDescription()
        Return a human-readable description of this statistics object.
        Returns:
        a human-readable description of this statistics object