org.apache.ignite.internal.processors.cache.query

## Class GridCacheQueryMetricsAdapter

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.query.GridCacheQueryMetricsAdapter

All Implemented Interfaces:
  QueryMetrics

    public class GridCacheQueryMetricsAdapter
    extends Object
    implements QueryMetrics

Adapter for `QueryMetrics`.

### Nested Class Summary

Nested Classes
`static class` `GridCacheQueryMetricsAdapter.QueryMetricsSnapshot` Query metrics snapshot.

### Constructor Summary

Constructors
Constructor and Description
`GridCacheQueryMetricsAdapter(GridMetricManager mmgr, String cacheName, boolean isNear)`

### Method Summary

All Methods Instance Methods Concrete Methods
`double` `averageTime()` Gets average execution time of query.
`int` `executions()` Gets total number execution of query.
`int` `fails()` Gets total number of times a query execution failed.
`long` `maximumTime()` Gets maximum execution time of query.
`long` `minimumTime()` Gets minimum execution time of query.
`void` `reset()` Resets query metrics.
`QueryMetrics` `snapshot()`
`String` `toString()`
`void` `update(long duration, boolean fail)` Update metrics.

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

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

### Constructor Detail

#### GridCacheQueryMetricsAdapter

    public GridCacheQueryMetricsAdapter(GridMetricManager mmgr,
                                        String cacheName,
                                        boolean isNear)

Parameters:
  `mmgr` - Metrics manager.
  `cacheName` - Cache name.
  `isNear` - Is near flag.

### Method Detail

#### minimumTime

    public long minimumTime()

Gets minimum execution time of query.

Specified by:
  `minimumTime` in interface `QueryMetrics`
Returns:
  Minimum execution time of query.

#### maximumTime

    public long maximumTime()

Gets maximum execution time of query.

Specified by:
  `maximumTime` in interface `QueryMetrics`
Returns:
  Maximum execution time of query.

#### averageTime

    public double averageTime()

Gets average execution time of query.

Specified by:
  `averageTime` in interface `QueryMetrics`
Returns:
  Average execution time of query.

#### executions

    public int executions()

Gets total number execution of query.

Specified by:
  `executions` in interface `QueryMetrics`
Returns:
  Number of executions.

#### fails

    public int fails()

Gets total number of times a query execution failed.

Specified by:
  `fails` in interface `QueryMetrics`
Returns:
  Total number of times a query execution failed.

#### update

    public void update(long duration,
                       boolean fail)

Update metrics.

Parameters:
  `duration` - Duration of queue execution.
  `fail` - `True` query executed unsuccessfully `false` otherwise.

#### snapshot

    public QueryMetrics snapshot()

Returns:
  Current metrics values.

#### reset

    public void reset()

Resets query metrics.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.8.1
Release Date | : May 21 2020