Class DataRegionMetricsImpl
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl
-
- All Implemented Interfaces:
DataRegionMetrics
public class DataRegionMetricsImpl extends Object implements DataRegionMetrics
-
-
Field Summary
Fields Modifier and Type Field Description static StringDATAREGION_METRICS_PREFIXData region metrics prefix.
-
Constructor Summary
Constructors Constructor Description DataRegionMetricsImpl(DataRegionConfiguration dataRegionCfg, GridKernalContext kernalCtx)Same asDataRegionMetricsImpl(DataRegionConfiguration, GridKernalContext, DataRegionMetricsProvider)but uses a no-op implementation for theDataRegionMetricsProvider.DataRegionMetricsImpl(DataRegionConfiguration dataRegionCfg, GridKernalContext kernalCtx, DataRegionMetricsProvider dataRegionMetricsProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddThrottlingTime(long time)PageMetricscacheGrpPageMetrics(int cacheGrpId)Returns memory page metrics associated with the given cache group.voidclear()Clear metrics.voiddecrementDirtyPages()Decrements dirtyPages counter.voiddecrementLargeEntriesPages()voiddecrementPagesWithTimestamp(long ts)Decrement count of pages with given last access time.voiddisableMetrics()Disable metrics.voidenableMetrics()Enable metrics.floatgetAllocationRate()Gets pages allocation rate of a memory region.longgetCheckpointBufferSize()Gets checkpoint buffer size in bytes.longgetDirtyPages()Gets the number of dirty pages (pages which contents is different from the current persistent storage state).floatgetEvictionRate()Gets eviction rate of a given memory region.floatgetLargeEntriesPagesPercentage()Gets percentage of pages that are fully occupied by large entries that go beyond page size.StringgetName()A name of a memory region the metrics are collected for.longgetOffHeapSize()Total offheap size in bytes.longgetOffheapUsedSize()Total used offheap size in bytes.floatgetPagesFillFactor()Returns the ratio of space occupied by user and system data to the size of all pages that contain this data.intgetPageSize()Gets memory page size.longgetPagesRead()The number of read pages from last restart.floatgetPagesReplaceAge()Gets average age (in milliseconds) for the pages being replaced from the disk storage.longgetPagesReplaced()The number of replaced pages from last restart .floatgetPagesReplaceRate()Gets rate (pages per second) at which pages get replaced with other pages from persistent storage.longgetPagesWritten()The number of written pages from last restart.longgetPhysicalMemoryPages()Gets total number of pages currently loaded to the RAM.longgetPhysicalMemorySize()Gets total size of pages loaded to the RAM.longgetTotalAllocatedPages()Gets a total number of allocated pages related to the data region.longgetTotalAllocatedSize()Gets a total size of memory allocated in the data region.longgetTotalUsedPages()Gets a total number of pages used for storing the data.longgetTotalUsedSize()Returns the total amount of bytes occupied by the non-empty pages.longgetUsedCheckpointBufferPages()Gets used checkpoint buffer size in pages.longgetUsedCheckpointBufferSize()Gets used checkpoint buffer size in bytes.voidincrementDirtyPages()Increments dirtyPages counter.voidincrementLargeEntriesPages()voidincrementPagesWithTimestamp(long ts)Increment count of pages with given last access time.voidonPageRead(long nanos)Updates page read.voidonPageReplaced(long pageAge, long nanos)Updates page replacement metrics.voidonPageWritten()Updates page written.voidpageMemory(PageMemory pageMem)PageMetricspageMetrics()Memory page metrics associated with the data region.Collection<PagesTimestampHistogramView>pagesTimestampHistogramView()Creates pages timestamp histogram view.voidpersistenceEnabled(boolean persistenceEnabled)voidrateTimeInterval(long rateTimeInterval)Deprecated.UseMetricsMxBean.configureHitRateMetric(String, long)instead.voidremove()Removes all metric for data region.voidremoveCacheGrpPageMetrics(Integer grpId)Removes all memory page metrics associated with the given cache group.voidresetDirtyPages()Resets dirtyPages counter to zero.voidsubIntervals(int subInts)Deprecated.UseMetricsMxBean.configureHitRateMetric(String, long)instead.voidupdateCheckpointBufferSize(long size)voidupdateEvictionRate()Updates eviction rate metric.voidupdateOffHeapSize(long size)
-
-
-
Field Detail
-
DATAREGION_METRICS_PREFIX
public static final String DATAREGION_METRICS_PREFIX
Data region metrics prefix. Full name will containDataRegionConfiguration.getName()also."io.dataregion.default", for example.
-
-
Constructor Detail
-
DataRegionMetricsImpl
@TestOnly public DataRegionMetricsImpl(DataRegionConfiguration dataRegionCfg, GridKernalContext kernalCtx)
Same asDataRegionMetricsImpl(DataRegionConfiguration, GridKernalContext, DataRegionMetricsProvider)but uses a no-op implementation for theDataRegionMetricsProvider.
-
DataRegionMetricsImpl
public DataRegionMetricsImpl(DataRegionConfiguration dataRegionCfg, GridKernalContext kernalCtx, DataRegionMetricsProvider dataRegionMetricsProvider)
- Parameters:
dataRegionCfg- DataRegionConfiguration.kernalCtx- Kernal context.dataRegionMetricsProvider- Data region metrics provider.
-
-
Method Detail
-
getName
public String getName()
A name of a memory region the metrics are collected for.- Specified by:
getNamein interfaceDataRegionMetrics- Returns:
- Name of the memory region.
-
getTotalAllocatedPages
public long getTotalAllocatedPages()
Gets a total number of allocated pages related to the data region. When persistence is disabled, this metric shows the total number of pages in memory. When persistence is enabled, this metric shows the total number of pages in memory and on disk.- Specified by:
getTotalAllocatedPagesin interfaceDataRegionMetrics- Returns:
- Total number of allocated pages.
-
getTotalAllocatedSize
public long getTotalAllocatedSize()
Gets a total size of memory allocated in the data region. When persistence is disabled, this metric shows the total size of pages in memory. When persistence is enabled, this metric shows the total size of pages in memory and on disk.- Specified by:
getTotalAllocatedSizein interfaceDataRegionMetrics- Returns:
- Total size of memory allocated, in bytes.
-
getTotalUsedPages
public long getTotalUsedPages()
Gets a total number of pages used for storing the data. It includes allocated pages except of empty pages that are not used yet or pages that can be reused.E. g. data region contains 1000 allocated pages, and 200 pages are used to store some data, this metric shows 200 used pages. Then the data was partially deleted and 50 pages were totally freed, hence this metric should show 150 used pages.
- Specified by:
getTotalUsedPagesin interfaceDataRegionMetrics- Returns:
- Total number of used pages.
-
getTotalUsedSize
public long getTotalUsedSize()
Returns the total amount of bytes occupied by the non-empty pages. This value is directly tied to theDataRegionMetrics.getTotalUsedPages()and does not take page fragmentation into account (i.e. if some data is removed from a page, but it is not completely empty, it will still show the whole page bytes as being occupied).- Specified by:
getTotalUsedSizein interfaceDataRegionMetrics- Returns:
- Total amount of bytes occupied by the non-empty pages
-
getAllocationRate
public float getAllocationRate()
Gets pages allocation rate of a memory region.- Specified by:
getAllocationRatein interfaceDataRegionMetrics- Returns:
- Number of allocated pages per second.
-
getEvictionRate
public float getEvictionRate()
Gets eviction rate of a given memory region.- Specified by:
getEvictionRatein interfaceDataRegionMetrics- Returns:
- Number of evicted pages per second.
-
getLargeEntriesPagesPercentage
public float getLargeEntriesPagesPercentage()
Gets percentage of pages that are fully occupied by large entries that go beyond page size. The large entities are split into fragments in a way so that each fragment can fit into a single page.- Specified by:
getLargeEntriesPagesPercentagein interfaceDataRegionMetrics- Returns:
- Percentage of pages fully occupied by large entities.
-
getPagesFillFactor
public float getPagesFillFactor()
Returns the ratio of space occupied by user and system data to the size of all pages that contain this data.This metric can help to determine how much space of a data page is occupied on average. Low fill factor can indicate that data pages are very fragmented (i.e. there is a lot of empty space across all data pages).
- Specified by:
getPagesFillFactorin interfaceDataRegionMetrics- Returns:
- Ratio of space occupied by user and system data to the size of all pages that contain ant data.
-
getDirtyPages
public long getDirtyPages()
Gets the number of dirty pages (pages which contents is different from the current persistent storage state). This metric is enabled only for Ignite nodes with enabled persistence.- Specified by:
getDirtyPagesin interfaceDataRegionMetrics- Returns:
- Current number of dirty pages.
-
getPagesReplaceRate
public float getPagesReplaceRate()
Gets rate (pages per second) at which pages get replaced with other pages from persistent storage. The rate effectively represents the rate at which pages get 'evicted' in favor of newly needed pages. This metric is enabled only for Ignite nodes with enabled persistence.- Specified by:
getPagesReplaceRatein interfaceDataRegionMetrics- Returns:
- Pages per second replace rate.
-
getPagesReplaceAge
public float getPagesReplaceAge()
Gets average age (in milliseconds) for the pages being replaced from the disk storage. This number effectively represents the average time between the moment when a page is read from the disk and the time when the page is evicted. Note that if a page is never evicted, it does not contribute to this metric. This metric is enabled only for Ignite nodes with enabled persistence.- Specified by:
getPagesReplaceAgein interfaceDataRegionMetrics- Returns:
- Replaced pages age in milliseconds.
-
getPhysicalMemoryPages
public long getPhysicalMemoryPages()
Gets total number of pages currently loaded to the RAM. When persistence is disabled, this metric is equal toDataRegionMetrics.getTotalAllocatedPages().- Specified by:
getPhysicalMemoryPagesin interfaceDataRegionMetrics- Returns:
- Total number of pages loaded to RAM.
-
getPhysicalMemorySize
public long getPhysicalMemorySize()
Gets total size of pages loaded to the RAM. When persistence is disabled, this metric is equal toDataRegionMetrics.getTotalAllocatedSize().- Specified by:
getPhysicalMemorySizein interfaceDataRegionMetrics- Returns:
- Total size of pages loaded to RAM in bytes.
-
getUsedCheckpointBufferPages
public long getUsedCheckpointBufferPages()
Gets used checkpoint buffer size in pages.- Specified by:
getUsedCheckpointBufferPagesin interfaceDataRegionMetrics- Returns:
- Checkpoint buffer size in pages.
-
getUsedCheckpointBufferSize
public long getUsedCheckpointBufferSize()
Gets used checkpoint buffer size in bytes.- Specified by:
getUsedCheckpointBufferSizein interfaceDataRegionMetrics- Returns:
- Checkpoint buffer size in bytes.
-
getCheckpointBufferSize
public long getCheckpointBufferSize()
Gets checkpoint buffer size in bytes.- Specified by:
getCheckpointBufferSizein interfaceDataRegionMetrics- Returns:
- Checkpoint buffer size in bytes.
-
getPageSize
public int getPageSize()
Gets memory page size.- Specified by:
getPageSizein interfaceDataRegionMetrics- Returns:
- Page size in bytes.
-
getPagesRead
public long getPagesRead()
The number of read pages from last restart.- Specified by:
getPagesReadin interfaceDataRegionMetrics- Returns:
- The number of read pages from last restart.
-
getPagesWritten
public long getPagesWritten()
The number of written pages from last restart.- Specified by:
getPagesWrittenin interfaceDataRegionMetrics- Returns:
- The number of written pages from last restart.
-
getPagesReplaced
public long getPagesReplaced()
The number of replaced pages from last restart .- Specified by:
getPagesReplacedin interfaceDataRegionMetrics- Returns:
- The number of replaced pages from last restart .
-
getOffHeapSize
public long getOffHeapSize()
Total offheap size in bytes.- Specified by:
getOffHeapSizein interfaceDataRegionMetrics- Returns:
- Total offheap size in bytes.
-
getOffheapUsedSize
public long getOffheapUsedSize()
Total used offheap size in bytes.- Specified by:
getOffheapUsedSizein interfaceDataRegionMetrics- Returns:
- Total used offheap size in bytes.
-
updateOffHeapSize
public void updateOffHeapSize(long size)
- Parameters:
size- Region size.
-
updateCheckpointBufferSize
public void updateCheckpointBufferSize(long size)
- Parameters:
size- Checkpoint buffer size.
-
pageMetrics
public PageMetrics pageMetrics()
Memory page metrics associated with the data region.
-
onPageReplaced
public void onPageReplaced(long pageAge, long nanos)Updates page replacement metrics.
-
onPageRead
public void onPageRead(long nanos)
Updates page read.- Parameters:
nanos- Time consumed by page reading.
-
onPageWritten
public void onPageWritten()
Updates page written.
-
incrementDirtyPages
public void incrementDirtyPages()
Increments dirtyPages counter.
-
decrementDirtyPages
public void decrementDirtyPages()
Decrements dirtyPages counter.
-
resetDirtyPages
public void resetDirtyPages()
Resets dirtyPages counter to zero.
-
cacheGrpPageMetrics
public PageMetrics cacheGrpPageMetrics(int cacheGrpId)
Returns memory page metrics associated with the given cache group.
-
removeCacheGrpPageMetrics
public void removeCacheGrpPageMetrics(Integer grpId)
Removes all memory page metrics associated with the given cache group.
-
updateEvictionRate
public void updateEvictionRate()
Updates eviction rate metric.
-
incrementLargeEntriesPages
public void incrementLargeEntriesPages()
-
decrementLargeEntriesPages
public void decrementLargeEntriesPages()
-
enableMetrics
public void enableMetrics()
Enable metrics.
-
disableMetrics
public void disableMetrics()
Disable metrics.
-
persistenceEnabled
public void persistenceEnabled(boolean persistenceEnabled)
- Parameters:
persistenceEnabled- Persistence enabled.
-
pageMemory
public void pageMemory(PageMemory pageMem)
- Parameters:
pageMem- Page mem.
-
rateTimeInterval
@Deprecated public void rateTimeInterval(long rateTimeInterval)
Deprecated.UseMetricsMxBean.configureHitRateMetric(String, long)instead.- Parameters:
rateTimeInterval- Time interval (in milliseconds) used to calculate allocation/eviction rate.
-
subIntervals
@Deprecated public void subIntervals(int subInts)
Deprecated.UseMetricsMxBean.configureHitRateMetric(String, long)instead.Sets number of subintervals the whole rateTimeInterval will be split into to calculate allocation rate.- Parameters:
subInts- Number of subintervals.
-
clear
public void clear()
Clear metrics.
-
remove
public void remove()
Removes all metric for data region.
-
addThrottlingTime
public void addThrottlingTime(long time)
- Parameters:
time- Time to add tototalThrottlingTimemetric in milliseconds.
-
incrementPagesWithTimestamp
public void incrementPagesWithTimestamp(long ts)
Increment count of pages with given last access time.- Parameters:
ts- Last access timestamp.
-
decrementPagesWithTimestamp
public void decrementPagesWithTimestamp(long ts)
Decrement count of pages with given last access time.- Parameters:
ts- Last access timestamp.
-
pagesTimestampHistogramView
public Collection<PagesTimestampHistogramView> pagesTimestampHistogramView()
Creates pages timestamp histogram view.
-
-