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

## Class GridCacheQueryMetricsAdapter

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

All Implemented Interfaces:
  Externalizable, Serializable, QueryMetrics

    public class GridCacheQueryMetricsAdapter
    extends Object
    implements QueryMetrics, Externalizable

Adapter for `QueryMetrics`.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridCacheQueryMetricsAdapter()`

### Method Summary

Methods
`double` `averageTime()` Gets average execution time of query.
`GridCacheQueryMetricsAdapter` `copy()` Merge with given metrics.
`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` `onQueryExecute(long duration, boolean fail)` Callback for query execution.
`void` `readExternal(ObjectInput in)`
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`

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

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

### Constructor Detail

#### GridCacheQueryMetricsAdapter

    public GridCacheQueryMetricsAdapter()

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

#### onQueryExecute

    public void onQueryExecute(long duration,
                      boolean fail)

Callback for query execution.

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

#### copy

    public GridCacheQueryMetricsAdapter copy()

Merge with given metrics.

Returns:
  Copy.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.3.0-incubating
Release Date | : July 10 2015