Package com.tangosol.net.partition
Class PartitionStatistics
java.lang.Object
com.tangosol.net.partition.PartitionStatistics
- All Implemented Interfaces:
- ExternalizableLite,- Serializable
PartitionStatistics encapsulates the statistics gathered for a given partition
 in a PartitionedService.  Partition statistics are collected and managed by a
 
DistributionManager and can be used by a PartitionAssignmentStrategy
 to drive decisions about partition distribution.- Since:
- Coherence 12.2.1
- Author:
- rhl 2011.08.14
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected longThe portion of the partition size that is obtained directly frompartitionedmaps (in bytes).protected AtomicLongThe portion of the partition size that cannot be obtained directly and has to be adjusted upon each cache entry update (in bytes).protected longThe total amount of time (in ms) that tasks/requests were executing.protected longThe number of requests on this partition during the sampling period.protected longThe sample duration (in ms).protected longThe total amount of time (in ms) that tasks/requests spent waiting.protected longThe time at this this partition was last transferred.protected longThe sample start time.protected intThe partition ID.
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor.PartitionStatistics(int nPartition, long ldtArrived) Constructor for the specified partition.
- 
Method SummaryModifier and TypeMethodDescriptionvoidadjustIndirectStorageSize(long cbDelta) Adjust the non-PartitionAwareBackingMap storage size of the partition by the specified amount.copyFrom(PartitionStatistics stats) Copy the statistics from the specified PartitionStatistics reference.Return a human-readable description of this statistics object.protected longReturn the partition size from partitioned maps.protected longReturn the partition size from non-PartitionAwareBackingMaps.longReturn the time (on the primary owner) at which the partition was last transferred or restored.intReturn the id of the partition for which these statistics apply.longReturn the number of requests/second issued for the partition.longReturn the duration (ms) over which data was collected for this sample.longReturn the time (on the sampling member) at which this data collection for this sample started.longReturn the total size (in bytes) of the storage associated with the partition.longReturn the total amount of time (in ms) that tasks/requests for this partition spent executing.longReturn the total amount of time (in ms) that tasks/requests for this partition spent waiting before execution.voidRestore the contents of this object by loading the object's state from the passed DataInput object.voidrecordRequest(long cWaitMillis, long cExecMillis) Update the partition statistics to record the specified request.voidreset()Reset the partition statistics state.setDirectStorageSize(long cb) Set the PartitionAwareBackingMaps storage size of the partition.toString()voidwriteExternal(DataOutput out) Save the contents of this object by storing the object's state into the passed DataOutput object.
- 
Field Details- 
m_nPartitionprotected int m_nPartitionThe partition ID.
- 
m_ldtLastTransferprotected long m_ldtLastTransferThe time at this this partition was last transferred.
- 
m_ldtSampleStartprotected long m_ldtSampleStartThe sample start time.
- 
m_cSampleMillisprotected long m_cSampleMillisThe sample duration (in ms).
- 
m_cbStorageDirectprotected long m_cbStorageDirectThe portion of the partition size that is obtained directly frompartitionedmaps (in bytes). This value is only updated on the service thread and doesn't have to be atomic.
- 
m_cbStorageIndirectThe portion of the partition size that cannot be obtained directly and has to be adjusted upon each cache entry update (in bytes).
- 
m_cRequestsprotected long m_cRequestsThe number of requests on this partition during the sampling period.
- 
m_cExecutionTimeprotected long m_cExecutionTimeThe total amount of time (in ms) that tasks/requests were executing.
- 
m_cWaitTimeprotected long m_cWaitTimeThe total amount of time (in ms) that tasks/requests spent waiting.
 
- 
- 
Constructor Details- 
PartitionStatisticspublic PartitionStatistics()Default constructor.
- 
PartitionStatisticspublic 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 Details- 
copyFromCopy the statistics from the specified PartitionStatistics reference.- Parameters:
- stats- the statistics to copy from
- Returns:
- the copied statistics
 
- 
recordRequestpublic 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
 
- 
adjustIndirectStorageSizepublic 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)
 
- 
setDirectStorageSizeSet 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
 
- 
resetpublic void reset()Reset the partition statistics state.
- 
getPartitionpublic int getPartition()Return the id of the partition for which these statistics apply.- Returns:
- the partition id
 
- 
getLastTransferTimepublic 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
 
- 
getTaskExecutionTimepublic 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
 
- 
getTaskWaitTimepublic 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
 
- 
getRequestCountpublic long getRequestCount()Return the number of requests/second issued for the partition.- Returns:
- the request count/second
 
- 
getDirectStorageSizeprotected long getDirectStorageSize()Return the partition size from partitioned maps.- Returns:
- the partition size from partitioned maps
 
- 
getIndirectStorageSizeprotected long getIndirectStorageSize()Return the partition size from non-PartitionAwareBackingMaps.- Returns:
- the partition size from non-PartitionAwareBackingMaps
 
- 
getStorageSizepublic long getStorageSize()Return the total size (in bytes) of the storage associated with the partition.- Returns:
- the storage size
 
- 
getSampleStartTimepublic 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
 
- 
getSampleDurationpublic long getSampleDuration()Return the duration (ms) over which data was collected for this sample.- Returns:
- the sample duration
 
- 
readExternalRestore the contents of this object by loading the object's state from the passed DataInput object.- Specified by:
- readExternalin 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
 
- 
writeExternalSave the contents of this object by storing the object's state into the passed DataOutput object.- Specified by:
- writeExternalin interface- ExternalizableLite
- Parameters:
- out- the DataOutput stream to write the state of this object to
- Throws:
- IOException- if an I/O exception occurs
 
- 
toString
- 
getDescriptionReturn a human-readable description of this statistics object.- Returns:
- a human-readable description of this statistics object
 
 
-