org.apache.ignite.internal.processors.cache.persistence

## Class DataRegionMetricsImpl

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl

All Implemented Interfaces:
  DataRegionMetrics, AllocatedPageTracker

    public class DataRegionMetricsImpl
    extends Object
    implements DataRegionMetrics, AllocatedPageTracker

### Constructor Summary

Constructors
Constructor and Description
`DataRegionMetricsImpl(DataRegionConfiguration memPlcCfg)`
`DataRegionMetricsImpl(DataRegionConfiguration memPlcCfg, IgniteOutClosure<Float> fillFactorProvider)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `decrementDirtyPages()` Decrements dirtyPages counter.
`void` `decrementLargeEntriesPages()`
`void` `disableMetrics()` Disable metrics.
`void` `enableMetrics()` Enable metrics.
`float` `getAllocationRate()` Gets pages allocation rate of a memory region.
`long` `getCheckpointBufferPages()` Gets checkpoint buffer size in pages.
`long` `getCheckpointBufferSize()` Gets checkpoint buffer size in bytes.
`long` `getDirtyPages()` Gets the number of dirty pages (pages which contents is different from the current persistent storage state).
`float` `getEvictionRate()` Gets eviction rate of a given memory region.
`float` `getLargeEntriesPagesPercentage()` Gets percentage of pages that are fully occupied by large entries that go beyond page size.
`String` `getName()` A name of a memory region the metrics are collected for.
`float` `getPagesFillFactor()` Gets the percentage of the used space.
`int` `getPageSize()` Gets memory page size.
`float` `getPagesReplaceAge()` Gets average age (in milliseconds) for the pages being replaced from the disk storage.
`float` `getPagesReplaceRate()` Gets rate (pages per second) at which pages get replaced with other pages from persistent storage.
`long` `getPhysicalMemoryPages()` Gets total number of pages currently loaded to the RAM.
`long` `getPhysicalMemorySize()` Gets total size of pages loaded to the RAM.
`long` `getTotalAllocatedPages()` Gets a total number of allocated pages related to the data region.
`long` `getTotalAllocatedSize()` Gets a total size of memory allocated in the data region.
`void` `incrementDirtyPages()` Increments dirtyPages counter.
`void` `incrementLargeEntriesPages()`
`void` `incrementTotalAllocatedPages()` Increments totalAllocatedPages counter.
`void` `pageMemory(PageMemory pageMem)`
`void` `persistenceEnabled(boolean persistenceEnabled)`
`void` `rateTimeInterval(long rateTimeInterval)`
`void` `resetDirtyPages()` Resets dirtyPages counter to zero.
`void` `subIntervals(int subInts)` Sets number of subintervals the whole rateTimeInterval will be split into to calculate allocation rate.
`void` `updatePageReplaceRate(long pageAge)` Updates pageReplaceRate metric.
`void` `updateTotalAllocatedPages(long delta)` Increments totalAllocatedPages counter.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DataRegionMetricsImpl

    public DataRegionMetricsImpl(DataRegionConfiguration memPlcCfg)

Parameters:
  `memPlcCfg` - DataRegionConfiguration.

#### DataRegionMetricsImpl

    public DataRegionMetricsImpl(DataRegionConfiguration memPlcCfg,
                                 @Nullable
                                 IgniteOutClosure<Float> fillFactorProvider)

Parameters:
  `memPlcCfg` - DataRegionConfiguration.

### Method Detail

#### getName

    public String getName()

A name of a memory region the metrics are collected for.

Specified by:
  `getName` in interface `DataRegionMetrics`
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:
  `getTotalAllocatedPages` in interface `DataRegionMetrics`
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:
  `getTotalAllocatedSize` in interface `DataRegionMetrics`
Returns:
  Total size of memory allocated, in bytes.

#### getAllocationRate

    public float getAllocationRate()

Gets pages allocation rate of a memory region.

Specified by:
  `getAllocationRate` in interface `DataRegionMetrics`
Returns:
  Number of allocated pages per second.

#### getEvictionRate

    public float getEvictionRate()

Gets eviction rate of a given memory region.

Specified by:
  `getEvictionRate` in interface `DataRegionMetrics`
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:
  `getLargeEntriesPagesPercentage` in interface `DataRegionMetrics`
Returns:
  Percentage of pages fully occupied by large entities.

#### getPagesFillFactor

    public float getPagesFillFactor()

Gets the percentage of the used space.

Specified by:
  `getPagesFillFactor` in interface `DataRegionMetrics`
Returns:
  The percentage of the used space.

#### 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:
  `getDirtyPages` in interface `DataRegionMetrics`
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:
  `getPagesReplaceRate` in interface `DataRegionMetrics`
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:
  `getPagesReplaceAge` in interface `DataRegionMetrics`
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 to `DataRegionMetrics.getTotalAllocatedPages()`.

Specified by:
  `getPhysicalMemoryPages` in interface `DataRegionMetrics`
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 to `DataRegionMetrics.getTotalAllocatedSize()`.

Specified by:
  `getPhysicalMemorySize` in interface `DataRegionMetrics`
Returns:
  Total size of pages loaded to RAM in bytes.

#### getCheckpointBufferPages

    public long getCheckpointBufferPages()

Gets checkpoint buffer size in pages.

Specified by:
  `getCheckpointBufferPages` in interface `DataRegionMetrics`
Returns:
  Checkpoint buffer size in pages.

#### getCheckpointBufferSize

    public long getCheckpointBufferSize()

Gets checkpoint buffer size in bytes.

Specified by:
  `getCheckpointBufferSize` in interface `DataRegionMetrics`
Returns:
  Checkpoint buffer size in bytes.

#### getPageSize

    public int getPageSize()

Gets memory page size.

Specified by:
  `getPageSize` in interface `DataRegionMetrics`
Returns:
  Page size in bytes.

#### updatePageReplaceRate

    public void updatePageReplaceRate(long pageAge)

Updates pageReplaceRate metric.

#### incrementDirtyPages

    public void incrementDirtyPages()

Increments dirtyPages counter.

#### decrementDirtyPages

    public void decrementDirtyPages()

Decrements dirtyPages counter.

#### resetDirtyPages

    public void resetDirtyPages()

Resets dirtyPages counter to zero.

#### incrementTotalAllocatedPages

    public void incrementTotalAllocatedPages()

Increments totalAllocatedPages counter.

#### updateTotalAllocatedPages

    public void updateTotalAllocatedPages(long delta)

Increments totalAllocatedPages counter.

Specified by:
  `updateTotalAllocatedPages` in interface `AllocatedPageTracker`

#### 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

    public void rateTimeInterval(long rateTimeInterval)

Parameters:
  `rateTimeInterval` - Time interval (in milliseconds) used to calculate allocation/eviction rate.

#### subIntervals

    public void subIntervals(int subInts)

Sets number of subintervals the whole rateTimeInterval will be split into to calculate allocation rate.

Parameters:
  `subInts` - Number of subintervals.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.4.0
Release Date | : March 5 2018