org.apache.ignite.internal.processors.query

## Class QueryHistory

- java.lang.Object
- - org.apache.ignite.internal.processors.query.QueryHistory

    public class QueryHistory
    extends Object

Query history metrics.

### Constructor Summary

Constructors
Constructor and Description
`QueryHistory(String qry, String schema, boolean loc, long startTime, long duration, boolean failed)` Constructor with metrics.

### Method Summary

All Methods Instance Methods Concrete Methods
`QueryHistory` `aggregateWithNew(QueryHistory m)` Aggregate new metrics with already existen.
`long` `executions()` Gets total number execution of query.
`long` `failures()` Gets number of times a query execution failed.
`QueryHistoryKey` `key()`
`long` `lastStartTime()` Gets latest query start time.
`ConcurrentLinkedDeque8.Node<QueryHistory>` `link()`
`boolean` `local()`
`long` `maximumTime()` Gets maximum execution time of query.
`long` `minimumTime()` Gets minimum execution time of query.
`String` `query()`
`boolean` `replaceLink(ConcurrentLinkedDeque8.Node<QueryHistory> expLink, ConcurrentLinkedDeque8.Node<QueryHistory> updatedLink)` Atomically replace link to new.
`String` `schema()`
`String` `toString()`

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

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

### Constructor Detail

#### QueryHistory

    public QueryHistory(String qry,
                        String schema,
                        boolean loc,
                        long startTime,
                        long duration,
                        boolean failed)

Constructor with metrics.

Parameters:
  `qry` - Textual query representation.
  `schema` - Schema name.
  `loc` - `true` for local query.
  `startTime` - Start time of query execution.
  `duration` - Duration of query execution.
  `failed` - `True` query executed unsuccessfully `false` otherwise.

### Method Detail

#### key

    public QueryHistoryKey key()

Returns:
  Metrics group key.

#### aggregateWithNew

    public QueryHistory aggregateWithNew(QueryHistory m)

Aggregate new metrics with already existen.

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

#### query

    public String query()

Returns:
  Textual representation of query.

#### schema

    public String schema()

Returns:
  Schema.

#### local

    public boolean local()

Returns:
  `true` For query with enabled local flag.

#### executions

    public long executions()

Gets total number execution of query.

Returns:
  Number of executions.

#### failures

    public long failures()

Gets number of times a query execution failed.

Returns:
  Number of times a query execution failed.

#### minimumTime

    public long minimumTime()

Gets minimum execution time of query.

Returns:
  Minimum execution time of query.

#### maximumTime

    public long maximumTime()

Gets maximum execution time of query.

Returns:
  Maximum execution time of query.

#### lastStartTime

    public long lastStartTime()

Gets latest query start time.

Returns:
  Latest time query was stared.

#### link

    @Nullable
    public ConcurrentLinkedDeque8.Node<QueryHistory> link()

Returns:
  Link to internal node in eviction deque.

#### replaceLink

    public boolean replaceLink(ConcurrentLinkedDeque8.Node<QueryHistory> expLink,
                               ConcurrentLinkedDeque8.Node<QueryHistory> updatedLink)

Atomically replace link to new.

Parameters:
  `expLink` - Link which should be replaced.
  `updatedLink` - New link which should be set.
Returns:
  `true` If link has been updated.

#### 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.0
Release Date | : October 15 2020