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

## Class GridCacheQueryDetailMetricsAdapter

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

All Implemented Interfaces:
  Externalizable, Serializable, QueryDetailMetrics

    public class GridCacheQueryDetailMetricsAdapter
    extends Object
    implements QueryDetailMetrics, Externalizable

Adapter for `QueryDetailMetrics`.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridCacheQueryDetailMetricsAdapter()` Required by `Externalizable`.
`GridCacheQueryDetailMetricsAdapter(GridCacheQueryType qryType, String qry, String cache, int execs, int completions, int failures, long minTime, long maxTime, long totalTime, long lastStartTime, GridCacheQueryDetailMetricsKey key)` Copy constructor.
`GridCacheQueryDetailMetricsAdapter(GridCacheQueryType qryType, String qry, String cache, long startTime, long duration, boolean failed)` Constructor with metrics.

### Method Summary

All Methods Instance Methods Concrete Methods
`GridCacheQueryDetailMetricsAdapter` `aggregate(QueryDetailMetrics m)` Aggregate metrics.
`double` `averageTime()` Gets average execution time of query.
`String` `cache()`
`int` `completions()` Gets number of completed execution of query.
`int` `executions()` Gets total number execution of query.
`int` `failures()` Gets number of times a query execution failed.
`GridCacheQueryDetailMetricsKey` `key()`
`long` `lastStartTime()` Gets latest query start time.
`long` `maximumTime()` Gets maximum execution time of query.
`long` `minimumTime()` Gets minimum execution time of query.
`String` `query()`
`String` `queryType()`
`void` `readExternal(ObjectInput in)`
`String` `toString()`
`long` `totalTime()` Gets total time of all query executions.
`void` `writeExternal(ObjectOutput out)`

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

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

### Constructor Detail

#### GridCacheQueryDetailMetricsAdapter

    public GridCacheQueryDetailMetricsAdapter()

Required by `Externalizable`.

#### GridCacheQueryDetailMetricsAdapter

    public GridCacheQueryDetailMetricsAdapter(GridCacheQueryType qryType,
                                              String qry,
                                              String cache,
                                              long startTime,
                                              long duration,
                                              boolean failed)

Constructor with metrics.

Parameters:
  `qryType` - Query type.
  `qry` - Textual query representation.
  `cache` - Cache name where query was executed.
  `startTime` - Duration of queue execution.
  `duration` - Duration of queue execution.
  `failed` - `True` query executed unsuccessfully `false` otherwise.

#### GridCacheQueryDetailMetricsAdapter

    public GridCacheQueryDetailMetricsAdapter(GridCacheQueryType qryType,
                                              String qry,
                                              String cache,
                                              int execs,
                                              int completions,
                                              int failures,
                                              long minTime,
                                              long maxTime,
                                              long totalTime,
                                              long lastStartTime,
                                              GridCacheQueryDetailMetricsKey key)

Copy constructor.

Parameters:
  `qryType` - Query type.
  `qry` - Textual query representation.
  `cache` - Cache name where query was executed.

### Method Detail

#### key

    public GridCacheQueryDetailMetricsKey key()

Returns:
  Metrics group key.

#### aggregate

    public GridCacheQueryDetailMetricsAdapter aggregate(QueryDetailMetrics m)

Aggregate metrics.

Parameters:
  `m` - Other metrics to take into account.
Returns:
  Aggregated metrics.

#### queryType

    public String queryType()

Specified by:
  `queryType` in interface `QueryDetailMetrics`
Returns:
  Query type.

#### query

    public String query()

Specified by:
  `query` in interface `QueryDetailMetrics`
Returns:
  Textual representation of query.

#### cache

    public String cache()

Specified by:
  `cache` in interface `QueryDetailMetrics`
Returns:
  Cache where query was executed.

#### executions

    public int executions()

Gets total number execution of query.

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

#### completions

    public int completions()

Gets number of completed execution of query.

Specified by:
  `completions` in interface `QueryDetailMetrics`
Returns:
  Number of completed executions.

#### failures

    public int failures()

Gets number of times a query execution failed.

Specified by:
  `failures` in interface `QueryDetailMetrics`
Returns:
  Number of times a query execution failed.

#### minimumTime

    public long minimumTime()

Gets minimum execution time of query.

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

#### maximumTime

    public long maximumTime()

Gets maximum execution time of query.

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

#### averageTime

    public double averageTime()

Gets average execution time of query.

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

#### totalTime

    public long totalTime()

Gets total time of all query executions.

Specified by:
  `totalTime` in interface `QueryDetailMetrics`
Returns:
  Total time of all query executions.

#### lastStartTime

    public long lastStartTime()

Gets latest query start time.

Specified by:
  `lastStartTime` in interface `QueryDetailMetrics`
Returns:
  Latest time query was stared.

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

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020