org.apache.ignite

## Class DataRegionMetricsAdapter

- java.lang.Object
- - org.apache.ignite.DataRegionMetricsAdapter

All Implemented Interfaces:
  MemoryMetrics

    public class DataRegionMetricsAdapter
    extends Object
    implements MemoryMetrics

Converter class from `DataRegionMetrics` to legacy `MemoryMetrics`.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static Collection<MemoryMetrics>` `collectionOf(Collection<DataRegionMetrics> dataRegionMetrics)` Converts collection of `DataRegionMetrics` into collection of legacy `MemoryMetrics`.
`float` `getAllocationRate()` Gets pages allocation rate of a memory region.
`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 space that is still free and can be filled in.
`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` `getTotalAllocatedPages()` Gets a total number of allocated pages related to the memory policy.
`static DataRegionMetricsAdapter` `valueOf(DataRegionMetrics delegate)`

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

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

### Method Detail

#### collectionOf

    public static Collection<MemoryMetrics> collectionOf(Collection<DataRegionMetrics> dataRegionMetrics)

Converts collection of `DataRegionMetrics` into collection of legacy `MemoryMetrics`.

Parameters:
  `dataRegionMetrics` - Data region metrics collection.

#### valueOf

    public static DataRegionMetricsAdapter valueOf(DataRegionMetrics delegate)

Parameters:
  `delegate` - DataRegionMetrics.
Returns:
  Wrapped `DataRegionMetrics` that implements `MemoryMetrics`. Null value is not wrapped and returned as is.

#### getName

    public String getName()

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

Specified by:
  `getName` in interface `MemoryMetrics`
Returns:
  Name of the memory region.

#### getTotalAllocatedPages

    public long getTotalAllocatedPages()

Gets a total number of allocated pages related to the memory policy. 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 `MemoryMetrics`
Returns:
  Total number of allocated pages.

#### getAllocationRate

    public float getAllocationRate()

Gets pages allocation rate of a memory region.

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

#### getEvictionRate

    public float getEvictionRate()

Gets eviction rate of a given memory region.

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

#### getPagesFillFactor

    public float getPagesFillFactor()

Gets the percentage of space that is still free and can be filled in.

Specified by:
  `getPagesFillFactor` in interface `MemoryMetrics`
Returns:
  The percentage of space that is still free and can be filled in.

#### 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 `MemoryMetrics`
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 `MemoryMetrics`
Returns:
  Pages per second replace rate.

#### getPhysicalMemoryPages

    public long getPhysicalMemoryPages()

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

Specified by:
  `getPhysicalMemoryPages` in interface `MemoryMetrics`
Returns:
  Total number of pages loaded to RAM.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.6.0
Release Date | : July 10 2018