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

## Class DataRegionMetricsSnapshot

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

All Implemented Interfaces:
  DataRegionMetrics

    public class DataRegionMetricsSnapshot
    extends Object
    implements DataRegionMetrics

### Constructor Summary

Constructors
Constructor and Description
`DataRegionMetricsSnapshot(DataRegionMetrics metrics)`

### Method Summary

All Methods Instance Methods Concrete Methods
`float` `getAllocationRate()` Gets pages allocation rate of a memory region.
`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.
`long` `getOffHeapSize()` Total offheap size in bytes.
`long` `getOffheapUsedSize()` Total used offheap size in bytes.
`float` `getPagesFillFactor()` Gets the percentage of the used space.
`int` `getPageSize()` Gets memory page size.
`long` `getPagesRead()` The number of read pages from last restart.
`float` `getPagesReplaceAge()` Gets average age (in milliseconds) for the pages being replaced from the disk storage.
`long` `getPagesReplaced()` The number of replaced pages from last restart .
`float` `getPagesReplaceRate()` Gets rate (pages per second) at which pages get replaced with other pages from persistent storage.
`long` `getPagesWritten()` The number of written pages from last restart.
`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.
`long` `getTotalUsedPages()` Gets a total number of pages used for storing the data.
`long` `getUsedCheckpointBufferPages()` Gets used checkpoint buffer size in pages.
`long` `getUsedCheckpointBufferSize()` Gets used checkpoint buffer size in bytes.

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

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

### Constructor Detail

#### DataRegionMetricsSnapshot

    public DataRegionMetricsSnapshot(DataRegionMetrics metrics)

Parameters:
  `metrics` - Metrics instance to take a copy.

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

#### 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:
  `getTotalUsedPages` in interface `DataRegionMetrics`
Returns:
  Total number of used 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.

#### getUsedCheckpointBufferPages

    public long getUsedCheckpointBufferPages()

Gets used checkpoint buffer size in pages.

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

#### getUsedCheckpointBufferSize

    public long getUsedCheckpointBufferSize()

Gets used checkpoint buffer size in bytes.

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

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

#### getPagesRead

    public long getPagesRead()

The number of read pages from last restart.

Specified by:
  `getPagesRead` in interface `DataRegionMetrics`
Returns:
  The number of read pages from last restart.

#### getPagesWritten

    public long getPagesWritten()

The number of written pages from last restart.

Specified by:
  `getPagesWritten` in interface `DataRegionMetrics`
Returns:
  The number of written pages from last restart.

#### getPagesReplaced

    public long getPagesReplaced()

The number of replaced pages from last restart .

Specified by:
  `getPagesReplaced` in interface `DataRegionMetrics`
Returns:
  The number of replaced pages from last restart .

#### getOffHeapSize

    public long getOffHeapSize()

Total offheap size in bytes.

Specified by:
  `getOffHeapSize` in interface `DataRegionMetrics`
Returns:
  Total offheap size in bytes.

#### getOffheapUsedSize

    public long getOffheapUsedSize()

Total used offheap size in bytes.

Specified by:
  `getOffheapUsedSize` in interface `DataRegionMetrics`
Returns:
  Total used offheap size in bytes.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022