org.apache.ignite

## Interface DataRegionMetrics

All Known Subinterfaces:
  DataRegionMetricsMXBean

All Known Implementing Classes:
  DataRegionMetricsImpl, DataRegionMetricsSnapshot

    public interface DataRegionMetrics

This interface provides page memory related metrics of a specific Apache Ignite node. The overall page memory architecture is covered in `DataStorageConfiguration`.

Since there are can be several memory regions configured with `DataRegionConfiguration` on an individual Apache Ignite node, the metrics for every region will be collected and obtained separately.

There are two ways to get the metrics of an Apache Ignite node.

1. First, a collection of the metrics can be obtained through `Ignite.dataRegionMetrics()` method. Note that the method returns data region metrics snapshots rather than just in time memory state.
2. Second, all `DataRegionMetrics` of a local Apache Ignite node are visible through JMX interface. Refer to `DataRegionMetricsMXBean` for more details.

Data region metrics collection is not a free operation and might affect performance of an application. This is the reason why the metrics are turned off by default. To enable the collection you can use both `DataRegionConfiguration.setMetricsEnabled(boolean)` configuration property or `DataRegionMetricsMXBean.enableMetrics()` method of a respective JMX bean.

### Method Summary

All Methods Instance Methods Abstract Methods
`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.
`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.

### Method Detail

#### getName

    String getName()

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

Returns:
  Name of the memory region.

#### getTotalAllocatedPages

    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.

Returns:
  Total number of allocated pages.

#### getTotalAllocatedSize

    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.

Returns:
  Total size of memory allocated, in bytes.

#### getAllocationRate

    float getAllocationRate()

Gets pages allocation rate of a memory region.

Returns:
  Number of allocated pages per second.

#### getEvictionRate

    float getEvictionRate()

Gets eviction rate of a given memory region.

Returns:
  Number of evicted pages per second.

#### getLargeEntriesPagesPercentage

    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.

Returns:
  Percentage of pages fully occupied by large entities.

#### getPagesFillFactor

    float getPagesFillFactor()

Gets the percentage of the used space.

Returns:
  The percentage of the used space.

#### getDirtyPages

    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.

Returns:
  Current number of dirty pages.

#### getPagesReplaceRate

    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.

Returns:
  Pages per second replace rate.

#### getPagesReplaceAge

    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.

Returns:
  Replaced pages age in milliseconds.

#### getPhysicalMemoryPages

    long getPhysicalMemoryPages()

Gets total number of pages currently loaded to the RAM. When persistence is disabled, this metric is equal to `getTotalAllocatedPages()`.

Returns:
  Total number of pages loaded to RAM.

#### getPhysicalMemorySize

    long getPhysicalMemorySize()

Gets total size of pages loaded to the RAM. When persistence is disabled, this metric is equal to `getTotalAllocatedSize()`.

Returns:
  Total size of pages loaded to RAM in bytes.

#### getCheckpointBufferPages

    long getCheckpointBufferPages()

Gets checkpoint buffer size in pages.

Returns:
  Checkpoint buffer size in pages.

#### getCheckpointBufferSize

    long getCheckpointBufferSize()

Gets checkpoint buffer size in bytes.

Returns:
  Checkpoint buffer size in bytes.

#### getPageSize

    int getPageSize()

Gets memory page size.

Returns:
  Page size in bytes.

#### getPagesRead

    long getPagesRead()

The number of read pages from last restart.

Returns:
  The number of read pages from last restart.

#### getPagesWritten

    long getPagesWritten()

The number of written pages from last restart.

Returns:
  The number of written pages from last restart.

#### getPagesReplaced

    long getPagesReplaced()

The number of replaced pages from last restart .

Returns:
  The number of replaced pages from last restart .

#### getOffHeapSize

    long getOffHeapSize()

Total offheap size in bytes.

Returns:
  Total offheap size in bytes.

#### getOffheapUsedSize

    long getOffheapUsedSize()

Total used offheap size in bytes.

Returns:
  Total used offheap size in bytes.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018