public interface PerIndexStats
Index
.Modifier and Type | Field and Description |
---|---|
static PerIndexStats |
EMPTY
Empty no-op internal index stats instance.
|
Modifier and Type | Method and Description |
---|---|
IndexOperationStats |
createOperationStats()
Creates a new per-operation stats instance.
|
long |
getCreationTime()
Returns the creation time of the index.
|
long |
getHitCount()
Returns the total number of hits into the index.
|
long |
getInsertCount()
Returns the number of insert operations performed on the index.
|
long |
getMemoryCost()
Returns the memory cost of the index in bytes.
|
long |
getQueryCount()
Returns the total number of queries served by the index.
|
long |
getRemoveCount()
Returns the number of remove operations performed on the index.
|
long |
getTotalHitLatency()
Returns the total hit latency for the index.
|
long |
getTotalInsertLatency()
Returns the total latency (in nanoseconds) of insert operations performed
on the index.
|
double |
getTotalNormalizedHitCardinality()
Returns the total normalized cardinality of the hits served by the index.
|
long |
getTotalRemoveLatency()
Returns the total latency (in nanoseconds) of remove operations performed
on the index.
|
long |
getTotalUpdateLatency()
Returns the total latency (in nanoseconds) of update operations performed
on the index.
|
long |
getUpdateCount()
Returns the number of update operations performed on the index.
|
void |
incrementQueryCount()
Increments the query count for the index.
|
long |
makeTimestamp()
Returns a new timestamp.
|
void |
onClear()
Invoked by the associated index after the index was cleared.
|
void |
onIndexHit(long timestamp,
long hitCardinality)
Invoked by the associated index after every index hit.
|
void |
onInsert(long timestamp,
IndexOperationStats operationStats,
Index.OperationSource operationSource)
Invoked by the associated index after every insert operation.
|
void |
onRemove(long timestamp,
IndexOperationStats operationStats,
Index.OperationSource operationSource)
Invoked by the associated index after every remove operation.
|
void |
onUpdate(long timestamp,
IndexOperationStats operationStats,
Index.OperationSource operationSource)
Invoked by the associated index after every update operation.
|
void |
resetPerQueryStats()
Resets the per-query stats, if any, currently tracked by this internal
index stats instance.
|
MemoryAllocator |
wrapMemoryAllocator(MemoryAllocator memoryAllocator)
Wraps the given memory allocator.
|
static final PerIndexStats EMPTY
long makeTimestamp()
Used for latency measurement, expressed in nanoseconds.
long getCreationTime()
The value is relative to midnight, January 1, 1970 UTC and expressed in milliseconds.
long getQueryCount()
The returned value may be less than the one returned by getHitCount()
since a single query may hit the same index more than once.
void incrementQueryCount()
long getHitCount()
The returned value may be greater than the one returned by getQueryCount()
since a single query may hit the same index more than once.
long getTotalHitLatency()
double getTotalNormalizedHitCardinality()
Normalized hit cardinality is calculated as hit_cardinality /
entry_count
at the time of the hit. The returned value is a sum of all
individual normalized hit cardinalities.
long getInsertCount()
long getTotalInsertLatency()
To compute the average latency divide the returned value by insert operation count
.
long getUpdateCount()
long getTotalUpdateLatency()
To compute the average latency divide the returned value by update operation count
.
long getRemoveCount()
long getTotalRemoveLatency()
To compute the average latency divide the returned value by remove operation count
.
long getMemoryCost()
Currently, for on-heap indexes (OBJECT and BINARY storages), the returned value is just a best-effort approximation and doesn't indicate a precise on-heap memory usage of the index.
void onInsert(long timestamp, IndexOperationStats operationStats, Index.OperationSource operationSource)
timestamp
- the time at which the insert operation was started.operationStats
- the operation stats to track the stats.operationSource
- the operation source.makeTimestamp()
,
Index.putEntry(com.hazelcast.query.impl.QueryableEntry, java.lang.Object, com.hazelcast.query.impl.Index.OperationSource)
void onUpdate(long timestamp, IndexOperationStats operationStats, Index.OperationSource operationSource)
timestamp
- the time at which the update operation was started.operationStats
- the operation stats to track the stats.operationSource
- the operation source.makeTimestamp()
,
Index.putEntry(com.hazelcast.query.impl.QueryableEntry, java.lang.Object, com.hazelcast.query.impl.Index.OperationSource)
void onRemove(long timestamp, IndexOperationStats operationStats, Index.OperationSource operationSource)
timestamp
- the time at which the remove operation was started.operationStats
- the operation stats to track the stats.operationSource
- the operation source.makeTimestamp()
,
Index.removeEntry(com.hazelcast.nio.serialization.Data, java.lang.Object, com.hazelcast.query.impl.Index.OperationSource)
void onClear()
Index.clear()
void onIndexHit(long timestamp, long hitCardinality)
Following operations generate a hit:
timestamp
- the time at which the hit-producing operation was
started.hitCardinality
- the cardinality of the hit.makeTimestamp()
void resetPerQueryStats()
MemoryAllocator wrapMemoryAllocator(MemoryAllocator memoryAllocator)
Used for the off-heap memory cost tracking.
memoryAllocator
- the memory allocator to wrap.IndexOperationStats createOperationStats()
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.