ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [30/50] [abbrv] ignite git commit: IGNITE-3443 Implemented metrics for queries monitoring.
Date Tue, 22 Nov 2016 11:40:19 GMT
http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index ade21ce..0d291cc 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -75,11 +75,13 @@ org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy$HolderComparator
 org.apache.ignite.cache.query.CacheQueryEntryEvent
 org.apache.ignite.cache.query.ContinuousQuery
 org.apache.ignite.cache.query.Query
+org.apache.ignite.cache.query.QueryCancelledException
 org.apache.ignite.cache.query.ScanQuery
 org.apache.ignite.cache.query.SpiQuery
 org.apache.ignite.cache.query.SqlFieldsQuery
 org.apache.ignite.cache.query.SqlQuery
 org.apache.ignite.cache.query.TextQuery
+org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore$2
 org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore$EntryMapping$1
 org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore$EntryMapping$2
 org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore$TypeKind
@@ -366,6 +368,7 @@ org.apache.ignite.internal.processors.cache.CacheWeakQueryIteratorsHolder$WeakQu
 org.apache.ignite.internal.processors.cache.CacheWeakQueryIteratorsHolder$WeakReferenceCloseableIterator
 org.apache.ignite.internal.processors.cache.DynamicCacheChangeBatch
 org.apache.ignite.internal.processors.cache.DynamicCacheChangeRequest
+org.apache.ignite.internal.processors.cache.EntryProcessorResourceInjectorProxy
 org.apache.ignite.internal.processors.cache.GridCacheAdapter
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$10
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$11
@@ -373,9 +376,9 @@ org.apache.ignite.internal.processors.cache.GridCacheAdapter$12
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$13
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$14
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$15
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$16$1
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$16
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$17
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$18
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$18$1
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$2
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$26$1
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$28
@@ -533,6 +536,7 @@ org.apache.ignite.internal.processors.cache.GridCacheUtils$8
 org.apache.ignite.internal.processors.cache.GridCacheUtils$9
 org.apache.ignite.internal.processors.cache.GridCacheValueCollection
 org.apache.ignite.internal.processors.cache.GridCacheValueCollection$1
+org.apache.ignite.internal.processors.cache.GridDeferredAckMessageSender$DeferredAckMessageBuffer
 org.apache.ignite.internal.processors.cache.IgniteCacheProxy
 org.apache.ignite.internal.processors.cache.IgniteCacheProxy$1
 org.apache.ignite.internal.processors.cache.IgniteCacheProxy$10
@@ -545,12 +549,13 @@ org.apache.ignite.internal.processors.cache.IgniteCacheProxy$8
 org.apache.ignite.internal.processors.cache.IgniteCacheProxy$9
 org.apache.ignite.internal.processors.cache.KeyCacheObject
 org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl
+org.apache.ignite.internal.processors.cache.QueryCursorImpl$State
 org.apache.ignite.internal.processors.cache.affinity.GridCacheAffinityProxy
 org.apache.ignite.internal.processors.cache.binary.BinaryMetadataKey
 org.apache.ignite.internal.processors.cache.binary.CacheDefaultBinaryAffinityKeyMapper
 org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$1
-org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$4
 org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$5
+org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$6
 org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetaDataEntryFilter
 org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetaDataPredicate
 org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetadataProcessor
@@ -630,6 +635,7 @@ org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocal$2
 org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocalAdapter
 org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocalAdapter$1
 org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocalAdapter$2
+org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxOnePhaseCommitAckRequest
 org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture$1
 org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture$2
 org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture$3
@@ -670,25 +676,23 @@ org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomic
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$27
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$28
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$29
-org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$3
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$30
+org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$31
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$4
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$5
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$6
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$7
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$8
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$9
-org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$DeferredResponseBuffer
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicDeferredUpdateResponse
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicUpdateRequest
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicUpdateResponse
+org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateFuture$1
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicSingleUpdateFuture$1
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicSingleUpdateFuture$2
-org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicSingleUpdateFuture$3
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicUpdateFuture$1
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicUpdateFuture$2
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicUpdateFuture$3
-org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicUpdateFuture$4
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicUpdateRequest
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicUpdateResponse
 org.apache.ignite.internal.processors.cache.distributed.dht.colocated.GridDhtColocatedCache
@@ -760,6 +764,7 @@ org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockFuture$
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockFuture$2
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockFuture$3
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockFuture$4
+org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockFuture$LockTimeoutObject$1
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockFuture$MiniFuture$1
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockRequest
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockResponse
@@ -772,6 +777,7 @@ org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticS
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFuture$1
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFuture$2
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFuture$3
+org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFuture$4
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFuture$MiniFuture$1
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFutureAdapter$1
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearPessimisticTxPrepareFuture$1
@@ -821,22 +827,23 @@ org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManag
 org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManager$7
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter$1
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter$ScanQueryFallbackClosableIterator
+org.apache.ignite.internal.processors.cache.query.GridCacheQueryDetailMetricsAdapter
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryFutureAdapter$1
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryFutureAdapter$2
-org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$1$1
-org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$1$2
+org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$10
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$11
-org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$12
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$13
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$14
-org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$15$1
-org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$2
-org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$3
+org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$15
+org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$16
+org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$17$1
+org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$3$1
+org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$3$2
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$4
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$5
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$6
+org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$7
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$8
-org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$9
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$CacheSqlIndexMetadata
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$CacheSqlMetadata
 org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager$CachedResult$QueueIterator
@@ -896,6 +903,8 @@ org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$12
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$13
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$14
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$15
+org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$16
+org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$17
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$2
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$3
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$4
@@ -929,9 +938,9 @@ org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter$Po
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter$PostLockClosure1$4
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter$PostLockClosure2
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter$PostMissClosure
-org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager$2
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager$3
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager$4
+org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager$5
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager$CommitListener
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager$CommittedVersion
 org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager$NodeFailureTimeoutObject$1
@@ -1005,7 +1014,6 @@ org.apache.ignite.internal.processors.datastreamer.DataStreamerEntry
 org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$1
 org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$4
 org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$5
-org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$6
 org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$Buffer$1
 org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$Buffer$2
 org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$DataStreamerPda
@@ -1084,6 +1092,7 @@ org.apache.ignite.internal.processors.datastructures.GridCacheSetProxy
 org.apache.ignite.internal.processors.datastructures.GridSetQueryPredicate
 org.apache.ignite.internal.processors.dr.GridDrType
 org.apache.ignite.internal.processors.dr.IgniteDrDataStreamerCacheUpdater
+org.apache.ignite.internal.processors.hadoop.HadoopDefaultJobInfo
 org.apache.ignite.internal.processors.hadoop.HadoopFileBlock
 org.apache.ignite.internal.processors.hadoop.HadoopInputSplit
 org.apache.ignite.internal.processors.hadoop.HadoopJobId
@@ -1119,7 +1128,6 @@ org.apache.ignite.internal.processors.igfs.IgfsFragmentizerManager$IdentityHashS
 org.apache.ignite.internal.processors.igfs.IgfsFragmentizerRequest
 org.apache.ignite.internal.processors.igfs.IgfsFragmentizerResponse
 org.apache.ignite.internal.processors.igfs.IgfsHandshakeResponse
-org.apache.ignite.internal.processors.igfs.IgfsImpl$12$1
 org.apache.ignite.internal.processors.igfs.IgfsImpl$IgfsGlobalSpaceTask
 org.apache.ignite.internal.processors.igfs.IgfsImpl$IgfsGlobalSpaceTask$1
 org.apache.ignite.internal.processors.igfs.IgfsInputStreamDescriptor
@@ -1155,6 +1163,7 @@ org.apache.ignite.internal.processors.igfs.client.IgfsClientSummaryCallable
 org.apache.ignite.internal.processors.igfs.client.IgfsClientUpdateCallable
 org.apache.ignite.internal.processors.igfs.client.meta.IgfsClientMetaIdsForPathCallable
 org.apache.ignite.internal.processors.igfs.client.meta.IgfsClientMetaInfoForPathCallable
+org.apache.ignite.internal.processors.igfs.client.meta.IgfsClientMetaUnlockCallable
 org.apache.ignite.internal.processors.igfs.data.IgfsDataPutProcessor
 org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryCreateProcessor
 org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryListingAddProcessor
@@ -1172,6 +1181,8 @@ org.apache.ignite.internal.processors.igfs.meta.IgfsMetaUpdateTimesProcessor
 org.apache.ignite.internal.processors.job.GridJobProcessor$5
 org.apache.ignite.internal.processors.job.GridJobWorker$3
 org.apache.ignite.internal.processors.jobmetrics.GridJobMetricsProcessor$SnapshotReducer
+org.apache.ignite.internal.processors.odbc.OdbcProtocolVersion
+org.apache.ignite.internal.processors.odbc.escape.OdbcEscapeType
 org.apache.ignite.internal.processors.platform.PlatformAbstractConfigurationClosure
 org.apache.ignite.internal.processors.platform.PlatformAbstractPredicate
 org.apache.ignite.internal.processors.platform.PlatformEventFilterListener
@@ -1180,7 +1191,7 @@ org.apache.ignite.internal.processors.platform.PlatformExtendedException
 org.apache.ignite.internal.processors.platform.PlatformJavaObjectFactoryProxy
 org.apache.ignite.internal.processors.platform.PlatformNativeException
 org.apache.ignite.internal.processors.platform.PlatformNoCallbackException
-org.apache.ignite.internal.processors.platform.cache.PlatformCache$1
+org.apache.ignite.internal.processors.platform.cache.PlatformCache$5
 org.apache.ignite.internal.processors.platform.cache.PlatformCacheEntryFilter
 org.apache.ignite.internal.processors.platform.cache.PlatformCacheEntryFilterImpl
 org.apache.ignite.internal.processors.platform.cache.PlatformCacheEntryProcessor
@@ -1211,6 +1222,8 @@ org.apache.ignite.internal.processors.platform.cpp.PlatformCppConfigurationClosu
 org.apache.ignite.internal.processors.platform.datastreamer.PlatformStreamReceiver
 org.apache.ignite.internal.processors.platform.datastreamer.PlatformStreamReceiverImpl
 org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore$1
+org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore$10
+org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore$11
 org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore$2
 org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore$3
 org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore$4
@@ -1218,6 +1231,7 @@ org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore$5
 org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore$6
 org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore$7
 org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore$8
+org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore$9
 org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetConfigurationClosure
 org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetService
 org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetServiceImpl
@@ -1232,19 +1246,24 @@ org.apache.ignite.internal.processors.platform.transactions.PlatformTransactions
 org.apache.ignite.internal.processors.platform.utils.PlatformFutureUtils$1
 org.apache.ignite.internal.processors.platform.utils.PlatformFutureUtils$FutureListenable$1
 org.apache.ignite.internal.processors.platform.utils.PlatformFutureUtils$InternalFutureListenable$1
+org.apache.ignite.internal.processors.platform.websession.PlatformDotNetSessionLockProcessor
+org.apache.ignite.internal.processors.platform.websession.PlatformDotNetSessionSetAndUnlockProcessor
 org.apache.ignite.internal.processors.query.GridQueryFieldMetadata
 org.apache.ignite.internal.processors.query.GridQueryIndexType
-org.apache.ignite.internal.processors.query.GridQueryProcessor$2
 org.apache.ignite.internal.processors.query.GridQueryProcessor$3
 org.apache.ignite.internal.processors.query.GridQueryProcessor$4
 org.apache.ignite.internal.processors.query.GridQueryProcessor$5
 org.apache.ignite.internal.processors.query.GridQueryProcessor$6
+org.apache.ignite.internal.processors.query.GridQueryProcessor$7
+org.apache.ignite.internal.processors.query.GridQueryProcessor$8
 org.apache.ignite.internal.processors.query.GridQueryProcessor$IndexType
 org.apache.ignite.internal.processors.query.h2.twostep.messages.GridQueryCancelRequest
 org.apache.ignite.internal.processors.query.h2.twostep.messages.GridQueryFailResponse
 org.apache.ignite.internal.processors.query.h2.twostep.messages.GridQueryNextPageRequest
 org.apache.ignite.internal.processors.query.h2.twostep.messages.GridQueryNextPageResponse
 org.apache.ignite.internal.processors.query.h2.twostep.messages.GridQueryRequest
+org.apache.ignite.internal.processors.resource.GridResourceIoc$AnnotationSet
+org.apache.ignite.internal.processors.resource.GridResourceIoc$ResourceAnnotation
 org.apache.ignite.internal.processors.rest.GridRestCommand
 org.apache.ignite.internal.processors.rest.GridRestProcessor$2$1
 org.apache.ignite.internal.processors.rest.GridRestProcessor$3
@@ -1332,7 +1351,7 @@ org.apache.ignite.internal.processors.service.ServiceDescriptorImpl
 org.apache.ignite.internal.processors.task.GridTaskProcessor$1
 org.apache.ignite.internal.processors.task.GridTaskThreadContextKey
 org.apache.ignite.internal.processors.task.GridTaskWorker$3
-org.apache.ignite.internal.processors.task.GridTaskWorker$4
+org.apache.ignite.internal.processors.task.GridTaskWorker$5
 org.apache.ignite.internal.processors.task.GridTaskWorker$State
 org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException
 org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedException
@@ -1356,6 +1375,7 @@ org.apache.ignite.internal.util.GridBoundedConcurrentOrderedMap
 org.apache.ignite.internal.util.GridBoundedConcurrentOrderedSet
 org.apache.ignite.internal.util.GridBoundedLinkedHashMap
 org.apache.ignite.internal.util.GridBoundedLinkedHashSet
+org.apache.ignite.internal.util.GridBoundedPriorityQueue
 org.apache.ignite.internal.util.GridByteArrayList
 org.apache.ignite.internal.util.GridCloseableIteratorAdapter
 org.apache.ignite.internal.util.GridCloseableIteratorAdapterEx
@@ -1407,14 +1427,14 @@ org.apache.ignite.internal.util.IgniteUtils$11
 org.apache.ignite.internal.util.IgniteUtils$12
 org.apache.ignite.internal.util.IgniteUtils$13
 org.apache.ignite.internal.util.IgniteUtils$14
-org.apache.ignite.internal.util.IgniteUtils$16
-org.apache.ignite.internal.util.IgniteUtils$2
-org.apache.ignite.internal.util.IgniteUtils$22
+org.apache.ignite.internal.util.IgniteUtils$15
+org.apache.ignite.internal.util.IgniteUtils$17
 org.apache.ignite.internal.util.IgniteUtils$23
 org.apache.ignite.internal.util.IgniteUtils$24
 org.apache.ignite.internal.util.IgniteUtils$25
 org.apache.ignite.internal.util.IgniteUtils$26
 org.apache.ignite.internal.util.IgniteUtils$27
+org.apache.ignite.internal.util.IgniteUtils$28
 org.apache.ignite.internal.util.IgniteUtils$3
 org.apache.ignite.internal.util.IgniteUtils$4
 org.apache.ignite.internal.util.IgniteUtils$5
@@ -1647,12 +1667,19 @@ org.apache.ignite.internal.visor.cache.VisorCachePartitionsTask
 org.apache.ignite.internal.visor.cache.VisorCachePartitionsTask$VisorCachePartitionsJob
 org.apache.ignite.internal.visor.cache.VisorCacheQueryConfiguration
 org.apache.ignite.internal.visor.cache.VisorCacheQueryConfigurationV2
+org.apache.ignite.internal.visor.cache.VisorCacheQueryDetailMetrics
+org.apache.ignite.internal.visor.cache.VisorCacheQueryDetailMetricsCollectorTask
+org.apache.ignite.internal.visor.cache.VisorCacheQueryDetailMetricsCollectorTask$VisorCacheQueryDetailMetricsCollectorJob
 org.apache.ignite.internal.visor.cache.VisorCacheQueryMetrics
 org.apache.ignite.internal.visor.cache.VisorCacheRebalanceConfiguration
 org.apache.ignite.internal.visor.cache.VisorCacheRebalanceTask
 org.apache.ignite.internal.visor.cache.VisorCacheRebalanceTask$VisorCachesRebalanceJob
 org.apache.ignite.internal.visor.cache.VisorCacheResetMetricsTask
 org.apache.ignite.internal.visor.cache.VisorCacheResetMetricsTask$VisorCacheResetMetricsJob
+org.apache.ignite.internal.visor.cache.VisorCacheResetQueryDetailMetricsTask
+org.apache.ignite.internal.visor.cache.VisorCacheResetQueryDetailMetricsTask$VisorCacheResetQueryDetailMetricsJob
+org.apache.ignite.internal.visor.cache.VisorCacheResetQueryMetricsTask
+org.apache.ignite.internal.visor.cache.VisorCacheResetQueryMetricsTask$VisorCacheResetQueryMetricsJob
 org.apache.ignite.internal.visor.cache.VisorCacheStartTask
 org.apache.ignite.internal.visor.cache.VisorCacheStartTask$VisorCacheStartArg
 org.apache.ignite.internal.visor.cache.VisorCacheStartTask$VisorCacheStartJob
@@ -1682,6 +1709,7 @@ org.apache.ignite.internal.visor.debug.VisorThreadLockInfo
 org.apache.ignite.internal.visor.debug.VisorThreadMonitorInfo
 org.apache.ignite.internal.visor.event.VisorGridDeploymentEvent
 org.apache.ignite.internal.visor.event.VisorGridDiscoveryEvent
+org.apache.ignite.internal.visor.event.VisorGridDiscoveryEventV2
 org.apache.ignite.internal.visor.event.VisorGridEvent
 org.apache.ignite.internal.visor.event.VisorGridEventsLost
 org.apache.ignite.internal.visor.event.VisorGridJobEvent
@@ -1769,6 +1797,7 @@ org.apache.ignite.internal.visor.util.VisorClusterGroupEmptyException
 org.apache.ignite.internal.visor.util.VisorEventMapper
 org.apache.ignite.internal.visor.util.VisorExceptionWrapper
 org.apache.ignite.internal.visor.util.VisorTaskUtils$4
+org.apache.ignite.internal.visor.util.VisorTaskUtils$5
 org.apache.ignite.internal.websession.WebSessionAttributeProcessor
 org.apache.ignite.internal.websession.WebSessionEntity
 org.apache.ignite.lang.IgniteBiClosure

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/core/src/test/java/org/apache/ignite/lang/utils/GridBoundedPriorityQueueSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/lang/utils/GridBoundedPriorityQueueSelfTest.java b/modules/core/src/test/java/org/apache/ignite/lang/utils/GridBoundedPriorityQueueSelfTest.java
new file mode 100644
index 0000000..bcaecc4
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/lang/utils/GridBoundedPriorityQueueSelfTest.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.lang.utils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Random;
+
+import org.apache.ignite.internal.util.GridBoundedPriorityQueue;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.testframework.junits.common.GridCommonTest;
+
+/**
+ * Test for {@link GridBoundedPriorityQueue}.
+ */
+@GridCommonTest(group = "Lang")
+public class GridBoundedPriorityQueueSelfTest extends GridCommonAbstractTest {
+    /** Queue items comparator. */
+    private static final Comparator<Integer> CMP = new Comparator<Integer>() {
+        @Override public int compare(Integer o1, Integer o2) {
+            return Integer.compare(o1, o2);
+        }
+    };
+
+    /** Queue items reverse order comparator. */
+    private static final Comparator<Integer> CMP_REVERSE = Collections.reverseOrder(CMP);
+
+    /**
+     * Test eviction in bounded priority queue.
+     */
+    public void testEviction() {
+        GridBoundedPriorityQueue<Integer> queue = new GridBoundedPriorityQueue<>(3, CMP);
+
+        assertTrue(queue.offer(2));
+        assertTrue(queue.offer(1));
+        assertTrue(queue.offer(3));
+        assertTrue(queue.offer(4));
+
+        assertEquals(3, queue.size());
+
+        assertFalse(queue.offer(0)); // Item with lower priority should not be put into queue.
+
+        assertEquals(3, queue.size());
+
+        assertEquals(Integer.valueOf(2), queue.poll());
+        assertEquals(Integer.valueOf(3), queue.poll());
+        assertEquals(Integer.valueOf(4), queue.poll());
+
+        assertNull(queue.poll());
+        assertTrue(queue.isEmpty());
+
+        // Test queue with reverse comparator.
+        GridBoundedPriorityQueue<Integer> queueReverse = new GridBoundedPriorityQueue<>(3, CMP_REVERSE);
+
+        assertTrue(queueReverse.offer(2));
+        assertTrue(queueReverse.offer(1));
+        assertTrue(queueReverse.offer(3));
+
+        assertFalse(queueReverse.offer(4)); // Item with lower priority should not be put into queue.
+
+        assertEquals(Integer.valueOf(3), queueReverse.poll());
+        assertEquals(Integer.valueOf(2), queueReverse.poll());
+        assertEquals(Integer.valueOf(1), queueReverse.poll());
+
+        assertNull(queueReverse.poll());
+        assertTrue(queueReverse.isEmpty());
+
+        // Test put random 100 items into GridBoundedPriorityQueue(10) and check result.
+        queue = new GridBoundedPriorityQueue<>(10, CMP);
+        queueReverse = new GridBoundedPriorityQueue<>(10, CMP_REVERSE);
+
+        Random rnd = new Random();
+
+        List<Integer> items = new ArrayList<>(100);
+
+        for (int i = 0; i < 100; i++) {
+            Integer item = rnd.nextInt(100);
+
+            items.add(item);
+            queue.offer(item);
+            queueReverse.offer(item);
+        }
+
+        Collections.sort(items);
+
+        for (int i = 0; i < 10; i++) {
+            assertEquals(items.get(90 + i), queue.poll());
+            assertEquals(items.get(9 - i), queueReverse.poll());
+        }
+
+        assertNull(queue.poll());
+        assertTrue(queue.isEmpty());
+
+        assertNull(queueReverse.poll());
+        assertTrue(queueReverse.isEmpty());
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
index 71dc964..46053b3 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
@@ -40,6 +40,7 @@ import org.apache.ignite.cache.CacheMetrics;
 import org.apache.ignite.cache.CachePeekMode;
 import org.apache.ignite.cache.query.Query;
 import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.cache.query.QueryDetailMetrics;
 import org.apache.ignite.cache.query.QueryMetrics;
 import org.apache.ignite.cluster.ClusterGroup;
 import org.apache.ignite.internal.processors.cache.CacheEntryImpl;
@@ -188,6 +189,21 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
     }
 
     /** {@inheritDoc} */
+    @Override public void resetQueryMetrics() {
+        throw new UnsupportedOperationException("Method should be supported.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public Collection<? extends QueryDetailMetrics> queryDetailMetrics() {
+        throw new UnsupportedOperationException("Method should be supported.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public void resetQueryDetailMetrics() {
+        throw new UnsupportedOperationException("Method should be supported.");
+    }
+
+    /** {@inheritDoc} */
     @Override public void localEvict(Collection<? extends K> keys) {
         compute.call(new LocalEvictTask<>(cacheName, isAsync, keys));
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteLangSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteLangSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteLangSelfTestSuite.java
index 78c0ab4..cfec1ec 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteLangSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteLangSelfTestSuite.java
@@ -32,6 +32,7 @@ import org.apache.ignite.lang.GridXSelfTest;
 import org.apache.ignite.lang.IgniteUuidSelfTest;
 import org.apache.ignite.lang.utils.GridBoundedConcurrentLinkedHashMapSelfTest;
 import org.apache.ignite.lang.utils.GridBoundedConcurrentOrderedMapSelfTest;
+import org.apache.ignite.lang.utils.GridBoundedPriorityQueueSelfTest;
 import org.apache.ignite.lang.utils.GridCircularBufferSelfTest;
 import org.apache.ignite.lang.utils.GridConcurrentLinkedHashMapSelfTest;
 import org.apache.ignite.lang.utils.GridConcurrentWeakHashSetSelfTest;
@@ -55,6 +56,7 @@ public class IgniteLangSelfTestSuite extends TestSuite {
         TestSuite suite = new TestSuite("Ignite Lang Test Suite");
 
         suite.addTest(new TestSuite(GridTupleSelfTest.class));
+        suite.addTest(new TestSuite(GridBoundedPriorityQueueSelfTest.class));
         suite.addTest(new TestSuite(GridByteArrayListSelfTest.class));
         suite.addTest(new TestSuite(GridLeanMapSelfTest.class));
         suite.addTest(new TestSuite(GridLeanIdentitySetSelfTest.class));
@@ -85,4 +87,4 @@ public class IgniteLangSelfTestSuite extends TestSuite {
 
         return suite;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryDetailMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryDetailMetricsSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryDetailMetricsSelfTest.java
new file mode 100644
index 0000000..1b870e4
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryDetailMetricsSelfTest.java
@@ -0,0 +1,572 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.query.Query;
+import org.apache.ignite.cache.query.QueryDetailMetrics;
+import org.apache.ignite.cache.query.ScanQuery;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.cache.query.SqlQuery;
+import org.apache.ignite.cache.query.TextQuery;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.internal.util.lang.GridAbsPredicate;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+
+/**
+ * Tests for cache query details metrics.
+ */
+public abstract class CacheAbstractQueryDetailMetricsSelfTest extends GridCommonAbstractTest {
+    /**  */
+    private static final int QRY_DETAIL_METRICS_SIZE = 3;
+
+    /** Grid count. */
+    protected int gridCnt;
+
+    /** Cache mode. */
+    protected CacheMode cacheMode;
+
+    /** */
+    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        startGridsMultiThreaded(gridCnt);
+
+        IgniteCache<Integer, String> cacheA = grid(0).cache("A");
+        IgniteCache<Integer, String> cacheB = grid(0).cache("B");
+
+        for (int i = 0; i < 100; i++) {
+            cacheA.put(i, String.valueOf(i));
+            cacheB.put(i, String.valueOf(i));
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * @param cacheName Cache name.
+     * @return Cache configuration.
+     */
+    private CacheConfiguration<Integer, String> configureCache(String cacheName) {
+        CacheConfiguration<Integer, String> ccfg = defaultCacheConfiguration();
+
+        ccfg.setName(cacheName);
+        ccfg.setCacheMode(cacheMode);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
+        ccfg.setIndexedTypes(Integer.class, String.class);
+        ccfg.setStatisticsEnabled(true);
+        ccfg.setQueryDetailMetricsSize(QRY_DETAIL_METRICS_SIZE);
+
+        return ccfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinder(ipFinder);
+
+        cfg.setDiscoverySpi(disco);
+
+        cfg.setCacheConfiguration(configureCache("A"), configureCache("B"));
+
+        return cfg;
+    }
+
+    /**
+     * Test metrics for SQL fields queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlFieldsQueryMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlFieldsQuery qry = new SqlFieldsQuery("select * from String");
+
+        checkQueryMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for SQL fields queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlFieldsQueryNotFullyFetchedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlFieldsQuery qry = new SqlFieldsQuery("select * from String");
+        qry.setPageSize(10);
+
+        checkQueryNotFullyFetchedMetrics(cache, qry, false);
+    }
+
+    /**
+     * Test metrics for failed SQL queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlFieldsQueryFailedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlFieldsQuery qry = new SqlFieldsQuery("select * from UNKNOWN");
+
+        checkQueryFailedMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics eviction.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testQueryMetricsEviction() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        // Execute several DIFFERENT queries with guaranteed DIFFERENT time of execution.
+        cache.query(new SqlFieldsQuery("select * from String")).getAll();
+        Thread.sleep(100);
+
+        cache.query(new SqlFieldsQuery("select count(*) from String")).getAll();
+        Thread.sleep(100);
+
+        cache.query(new SqlFieldsQuery("select * from String limit 1")).getAll();
+        Thread.sleep(100);
+
+        cache.query(new SqlFieldsQuery("select * from String limit 2")).getAll();
+        Thread.sleep(100);
+
+        cache.query(new ScanQuery()).getAll();
+        Thread.sleep(100);
+
+        cache.query(new SqlQuery("String", "from String")).getAll();
+
+        waitingFor(cache, "size", QRY_DETAIL_METRICS_SIZE);
+
+        for (int i = 0; i < QRY_DETAIL_METRICS_SIZE; i++)
+            checkMetrics(cache, QRY_DETAIL_METRICS_SIZE, i, 1, 1, 0, false);
+
+        // Check that collected metrics contains correct items: metrics for last 3 queries.
+        Collection<? extends QueryDetailMetrics> metrics = cache.queryDetailMetrics();
+
+        String lastMetrics = "";
+
+        for (QueryDetailMetrics m : metrics)
+            lastMetrics += m.queryType() +  " " + m.query() + ";";
+
+        assertTrue(lastMetrics.contains("SQL_FIELDS select * from String limit 2;"));
+        assertTrue(lastMetrics.contains("SCAN A;"));
+        assertTrue(lastMetrics.contains("SQL from String;"));
+
+        cache = grid(0).context().cache().jcache("B");
+
+        cache.query(new SqlFieldsQuery("select * from String")).getAll();
+        cache.query(new SqlFieldsQuery("select count(*) from String")).getAll();
+        cache.query(new SqlFieldsQuery("select * from String limit 1")).getAll();
+        cache.query(new SqlFieldsQuery("select * from String limit 2")).getAll();
+        cache.query(new ScanQuery()).getAll();
+        cache.query(new SqlQuery("String", "from String")).getAll();
+
+        waitingFor(cache, "size", QRY_DETAIL_METRICS_SIZE);
+
+        for (int i = 0; i < QRY_DETAIL_METRICS_SIZE; i++)
+            checkMetrics(cache, QRY_DETAIL_METRICS_SIZE, i, 1, 1, 0, false);
+
+        if (gridCnt > 1) {
+            cache = grid(1).context().cache().jcache("A");
+
+            cache.query(new SqlFieldsQuery("select * from String")).getAll();
+            cache.query(new SqlFieldsQuery("select count(*) from String")).getAll();
+            cache.query(new SqlFieldsQuery("select * from String limit 1")).getAll();
+            cache.query(new SqlFieldsQuery("select * from String limit 2")).getAll();
+            cache.query(new ScanQuery()).getAll();
+            cache.query(new SqlQuery("String", "from String")).getAll();
+
+            waitingFor(cache, "size", QRY_DETAIL_METRICS_SIZE);
+
+            for (int i = 0; i < QRY_DETAIL_METRICS_SIZE; i++)
+                checkMetrics(cache, QRY_DETAIL_METRICS_SIZE, i, 1, 1, 0, false);
+
+            cache = grid(1).context().cache().jcache("B");
+
+            cache.query(new SqlFieldsQuery("select * from String")).getAll();
+            cache.query(new SqlFieldsQuery("select count(*) from String")).getAll();
+            cache.query(new SqlFieldsQuery("select * from String limit 1")).getAll();
+            cache.query(new SqlFieldsQuery("select * from String limit 2")).getAll();
+            cache.query(new ScanQuery()).getAll();
+            cache.query(new SqlQuery("String", "from String")).getAll();
+
+            waitingFor(cache, "size", QRY_DETAIL_METRICS_SIZE);
+
+            for (int i = 0; i < QRY_DETAIL_METRICS_SIZE; i++)
+                checkMetrics(cache, QRY_DETAIL_METRICS_SIZE, i, 1, 1, 0, false);
+        }
+    }
+
+    /** */
+    private static class Worker extends Thread {
+        /** */
+        private final IgniteCache cache;
+
+        /** */
+        private final  Query qry;
+
+        /** */
+        Worker(IgniteCache cache, Query qry) {
+            this.cache = cache;
+            this.qry = qry;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void run() {
+            cache.query(qry).getAll();
+        }
+    }
+
+    /**
+     * Test metrics if queries executed from several threads.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testQueryMetricsMultithreaded() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        Collection<Worker> workers = new ArrayList<>();
+
+        int repeat = 10;
+
+        for (int k = 0; k < repeat; k++) {
+            // Execute as match queries as history size to avoid eviction.
+            for (int i = 1; i <= QRY_DETAIL_METRICS_SIZE; i++)
+                workers.add(new Worker(cache, new SqlFieldsQuery("select * from String limit " + i)));
+        }
+
+        for (Worker worker : workers)
+            worker.start();
+
+        for (Worker worker : workers)
+            worker.join();
+
+        for (int i = 0; i < QRY_DETAIL_METRICS_SIZE; i++)
+            checkMetrics(cache, QRY_DETAIL_METRICS_SIZE, i, repeat, repeat, 0, false);
+    }
+
+    /**
+     * Test metrics for Scan queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testScanQueryMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        ScanQuery<Integer, String> qry = new ScanQuery<>();
+
+        checkQueryMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for Scan queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testScanQueryNotFullyFetchedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        ScanQuery<Integer, String> qry = new ScanQuery<>();
+        qry.setPageSize(10);
+
+        checkQueryNotFullyFetchedMetrics(cache, qry, true);
+    }
+
+    /**
+     * Test metrics for failed Scan queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testScanQueryFailedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        ScanQuery<Integer, String> qry = new ScanQuery<>(Integer.MAX_VALUE);
+
+        checkQueryFailedMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for Scan queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlQueryMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlQuery<Integer, String> qry = new SqlQuery<>("String", "from String");
+
+        checkQueryMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for Scan queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlQueryNotFullyFetchedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlQuery<Integer, String> qry = new SqlQuery<>("String", "from String");
+        qry.setPageSize(10);
+
+        checkQueryNotFullyFetchedMetrics(cache, qry, true);
+    }
+
+    /**
+     * Test metrics for failed Scan queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlQueryFailedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlQuery<Integer, String> qry = new SqlQuery<>("Long", "from Long");
+
+        checkQueryFailedMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for Sql queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testTextQueryMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        TextQuery qry = new TextQuery<>("String", "1");
+
+        checkQueryMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for Sql queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testTextQueryNotFullyFetchedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        TextQuery qry = new TextQuery<>("String", "1");
+        qry.setPageSize(10);
+
+        checkQueryNotFullyFetchedMetrics(cache, qry, true);
+    }
+
+    /**
+     * Test metrics for failed Scan queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testTextQueryFailedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        TextQuery qry = new TextQuery<>("Unknown", "zzz");
+
+        checkQueryFailedMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for SQL cross cache queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlFieldsCrossCacheQueryMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"B\".String");
+
+        checkQueryMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for SQL cross cache queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlFieldsCrossCacheQueryNotFullyFetchedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"B\".String");
+        qry.setPageSize(10);
+
+        checkQueryNotFullyFetchedMetrics(cache, qry, false);
+    }
+
+    /**
+     * Test metrics for failed SQL cross cache queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlFieldsCrossCacheQueryFailedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"G\".String");
+
+        checkQueryFailedMetrics(cache, qry);
+    }
+
+    /**
+     * Check metrics.
+     *
+     * @param cache Cache to check metrics.
+     * @param sz Expected size of metrics.
+     * @param idx Index of metrics to check.
+     * @param execs Expected number of executions.
+     * @param completions Expected number of completions.
+     * @param failures Expected number of failures.
+     * @param first {@code true} if metrics checked for first query only.
+     */
+    private void checkMetrics(IgniteCache<Integer, String> cache, int sz, int idx, int execs,
+        int completions, int failures, boolean first) {
+        Collection<? extends QueryDetailMetrics> metrics = cache.queryDetailMetrics();
+
+        assertNotNull(metrics);
+        assertEquals(sz, metrics.size());
+
+        QueryDetailMetrics m = new ArrayList<>(metrics).get(idx);
+
+        info("Metrics: " + m);
+
+        assertEquals("Executions", execs, m.executions());
+        assertEquals("Completions", completions, m.completions());
+        assertEquals("Failures", failures, m.failures());
+        assertTrue(m.averageTime() >= 0);
+        assertTrue(m.maximumTime() >= 0);
+        assertTrue(m.minimumTime() >= 0);
+
+        if (first)
+            assertTrue("On first execution minTime == maxTime", m.minimumTime() == m.maximumTime());
+    }
+
+    /**
+     * @param cache Cache.
+     * @param qry Query.
+     */
+    private void checkQueryMetrics(IgniteCache<Integer, String> cache, Query qry) {
+        // Execute query.
+        cache.query(qry).getAll();
+
+        checkMetrics(cache, 1, 0, 1, 1, 0, true);
+
+        // Execute again with the same parameters.
+        cache.query(qry).getAll();
+
+        checkMetrics(cache, 1, 0, 2, 2, 0, false);
+    }
+
+    /**
+     * @param cache Cache.
+     * @param qry Query.
+     * @param waitingForCompletion Waiting for query completion.
+     */
+    private void checkQueryNotFullyFetchedMetrics(IgniteCache<Integer, String> cache, Query qry,
+        boolean waitingForCompletion) throws IgniteInterruptedCheckedException {
+        // Execute query.
+        cache.query(qry).iterator().next();
+
+        if (waitingForCompletion)
+            waitingFor(cache, "completions", 1);
+
+        checkMetrics(cache, 1, 0, 1, 1, 0, true);
+
+        // Execute again with the same parameters.
+        cache.query(qry).iterator().next();
+
+        if (waitingForCompletion)
+            waitingFor(cache, "completions", 2);
+
+        checkMetrics(cache, 1, 0, 2, 2, 0, false);
+    }
+
+    /**
+     * @param cache Cache.
+     * @param qry Query.
+     */
+    private void checkQueryFailedMetrics(IgniteCache<Integer, String> cache, Query qry) {
+        try {
+            // Execute invalid query.
+            cache.query(qry).getAll();
+        }
+        catch (Exception ignored) {
+            // No-op.
+        }
+
+        checkMetrics(cache, 1, 0, 1, 0, 1, true);
+
+        try {
+            // Execute invalid query again with the same parameters.
+            cache.query(qry).getAll();
+        }
+        catch (Exception ignored) {
+            // No-op.
+        }
+
+        checkMetrics(cache, 1, 0, 2, 0, 2, true);
+    }
+
+    /**
+     * @param cache Cache.
+     * @param cond Condition to check.
+     * @param exp Expected value.
+     */
+    private static void waitingFor(final IgniteCache<Integer, String> cache,
+        final String cond, final int exp) throws IgniteInterruptedCheckedException {
+        GridTestUtils.waitForCondition(new GridAbsPredicate() {
+            @Override public boolean apply() {
+                Collection<? extends QueryDetailMetrics> metrics = cache.queryDetailMetrics();
+
+                switch (cond) {
+                    case "size":
+                        return metrics.size() == exp;
+
+                    case "completions":
+                        int completions = 0;
+
+                        for (QueryDetailMetrics m : metrics)
+                            completions += m.completions();
+
+                        return completions == exp;
+
+                    default:
+                        return true;
+                }
+            }
+        }, 5000);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryMetricsSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryMetricsSelfTest.java
index 10f7612..e5845d3 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryMetricsSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryMetricsSelfTest.java
@@ -17,11 +17,15 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import java.util.ArrayList;
+import java.util.Collection;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cache.query.Query;
 import org.apache.ignite.cache.query.ScanQuery;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.cache.query.SqlQuery;
+import org.apache.ignite.cache.query.TextQuery;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
@@ -52,15 +56,13 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
     @Override protected void beforeTest() throws Exception {
         startGridsMultiThreaded(gridCnt);
 
-        IgniteCache<String, Integer> cacheA = grid(0).cache("A");
+        IgniteCache<Integer, String> cacheA = grid(0).cache("A");
+        IgniteCache<Integer, String> cacheB = grid(0).cache("B");
 
-        for (int i = 0; i < 100; i++)
-            cacheA.put(String.valueOf(i), i);
-
-        IgniteCache<String, Integer> cacheB = grid(0).cache("B");
-
-        for (int i = 0; i < 100; i++)
-            cacheB.put(String.valueOf(i), i);
+        for (int i = 0; i < 100; i++) {
+            cacheA.put(i, String.valueOf(i));
+            cacheB.put(i, String.valueOf(i));
+        }
     }
 
     /** {@inheritDoc} */
@@ -78,20 +80,20 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
 
         cfg.setDiscoverySpi(disco);
 
-        CacheConfiguration<String, Integer> cacheCfg1 = defaultCacheConfiguration();
+        CacheConfiguration<Integer, String> cacheCfg1 = defaultCacheConfiguration();
 
         cacheCfg1.setName("A");
         cacheCfg1.setCacheMode(cacheMode);
         cacheCfg1.setWriteSynchronizationMode(FULL_SYNC);
-        cacheCfg1.setIndexedTypes(String.class, Integer.class);
+        cacheCfg1.setIndexedTypes(Integer.class, String.class);
         cacheCfg1.setStatisticsEnabled(true);
 
-        CacheConfiguration<String, Integer> cacheCfg2 = defaultCacheConfiguration();
+        CacheConfiguration<Integer, String> cacheCfg2 = defaultCacheConfiguration();
 
         cacheCfg2.setName("B");
         cacheCfg2.setCacheMode(cacheMode);
         cacheCfg2.setWriteSynchronizationMode(FULL_SYNC);
-        cacheCfg2.setIndexedTypes(String.class, Integer.class);
+        cacheCfg2.setIndexedTypes(Integer.class, String.class);
         cacheCfg2.setStatisticsEnabled(true);
 
         cfg.setCacheConfiguration(cacheCfg1, cacheCfg2);
@@ -105,11 +107,11 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
      * @throws Exception In case of error.
      */
     public void testSqlFieldsQueryMetrics() throws Exception {
-        IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
 
-        SqlFieldsQuery qry = new SqlFieldsQuery("select * from Integer");
+        SqlFieldsQuery qry = new SqlFieldsQuery("select * from String");
 
-        testQueryMetrics(cache, qry);
+        checkQueryMetrics(cache, qry);
     }
 
     /**
@@ -118,12 +120,12 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
      * @throws Exception In case of error.
      */
     public void testSqlFieldsQueryNotFullyFetchedMetrics() throws Exception {
-        IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
 
-        SqlFieldsQuery qry = new SqlFieldsQuery("select * from Integer");
+        SqlFieldsQuery qry = new SqlFieldsQuery("select * from String");
         qry.setPageSize(10);
 
-        testQueryNotFullyFetchedMetrics(cache, qry, false);
+        checkQueryNotFullyFetchedMetrics(cache, qry, false);
     }
 
     /**
@@ -132,11 +134,11 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
      * @throws Exception In case of error.
      */
     public void testSqlFieldsQueryFailedMetrics() throws Exception {
-        IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
 
         SqlFieldsQuery qry = new SqlFieldsQuery("select * from UNKNOWN");
 
-        testQueryFailedMetrics(cache, qry);
+        checkQueryFailedMetrics(cache, qry);
     }
 
     /**
@@ -145,11 +147,11 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
      * @throws Exception In case of error.
      */
     public void testScanQueryMetrics() throws Exception {
-        IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
 
-        ScanQuery<String, Integer> qry = new ScanQuery<>();
+        ScanQuery<Integer, String> qry = new ScanQuery<>();
 
-        testQueryMetrics(cache, qry);
+        checkQueryMetrics(cache, qry);
     }
 
     /**
@@ -158,12 +160,12 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
      * @throws Exception In case of error.
      */
     public void testScanQueryNotFullyFetchedMetrics() throws Exception {
-        IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
 
-        ScanQuery<String, Integer> qry = new ScanQuery<>();
+        ScanQuery<Integer, String> qry = new ScanQuery<>();
         qry.setPageSize(10);
 
-        testQueryNotFullyFetchedMetrics(cache, qry, true);
+        checkQueryNotFullyFetchedMetrics(cache, qry, true);
     }
 
     /**
@@ -172,11 +174,91 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
      * @throws Exception In case of error.
      */
     public void testScanQueryFailedMetrics() throws Exception {
-        IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        ScanQuery<Integer, String> qry = new ScanQuery<>(Integer.MAX_VALUE);
+
+        checkQueryFailedMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for Sql queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlQueryMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlQuery qry = new SqlQuery<>("String", "from String");
+
+        checkQueryMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for Sql queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlQueryNotFullyFetchedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlQuery qry = new SqlQuery<>("String", "from String");
+        qry.setPageSize(10);
+
+        checkQueryNotFullyFetchedMetrics(cache, qry, true);
+    }
+
+    /**
+     * Test metrics for failed Scan queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testSqlQueryFailedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
 
-        ScanQuery<String, Integer> qry = new ScanQuery<>(Integer.MAX_VALUE);
+        SqlQuery qry = new SqlQuery<>("Long", "from Long");
 
-        testQueryFailedMetrics(cache, qry);
+        checkQueryFailedMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for Sql queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testTextQueryMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        TextQuery qry = new TextQuery<>("String", "1");
+
+        checkQueryMetrics(cache, qry);
+    }
+
+    /**
+     * Test metrics for Sql queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testTextQueryNotFullyFetchedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        TextQuery qry = new TextQuery<>("String", "1");
+        qry.setPageSize(10);
+
+        checkQueryNotFullyFetchedMetrics(cache, qry, true);
+    }
+
+    /**
+     * Test metrics for failed Scan queries.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testTextQueryFailedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        TextQuery qry = new TextQuery<>("Unknown", "zzz");
+
+        checkQueryFailedMetrics(cache, qry);
     }
 
     /**
@@ -184,12 +266,12 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
      *
      * @throws Exception In case of error.
      */
-    public void testSqlCrossCacheQueryMetrics() throws Exception {
-        IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+    public void testSqlFieldsCrossCacheQueryMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
 
-        SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"B\".Integer");
+        SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"B\".String");
 
-        testQueryMetrics(cache, qry);
+        checkQueryMetrics(cache, qry);
     }
 
     /**
@@ -197,13 +279,13 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
      *
      * @throws Exception In case of error.
      */
-    public void testSqlCrossCacheQueryNotFullyFetchedMetrics() throws Exception {
-        IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+    public void testSqlFieldsCrossCacheQueryNotFullyFetchedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
 
-        SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"B\".Integer");
+        SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"B\".String");
         qry.setPageSize(10);
 
-        testQueryNotFullyFetchedMetrics(cache, qry, false);
+        checkQueryNotFullyFetchedMetrics(cache, qry, false);
     }
 
     /**
@@ -211,46 +293,102 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
      *
      * @throws Exception In case of error.
      */
-    public void testSqlCrossCacheQueryFailedMetrics() throws Exception {
-        IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+    public void testSqlFieldsCrossCacheQueryFailedMetrics() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
+
+        SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"G\".String");
+
+        checkQueryFailedMetrics(cache, qry);
+    }
+
+    /** */
+    private static class Worker extends Thread {
+        /** */
+        private final IgniteCache cache;
+
+        /** */
+        private final  Query qry;
 
-        SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"G\".Integer");
+        /** */
+        Worker(IgniteCache cache, Query qry) {
+            this.cache = cache;
+            this.qry = qry;
+        }
 
-        testQueryFailedMetrics(cache, qry);
+        /** {@inheritDoc} */
+        @Override public void run() {
+            cache.query(qry).getAll();
+        }
     }
 
     /**
-     * @param cache Cache.
-     * @param qry Query.
+     * Test metrics if queries executed from several threads.
+     *
+     * @throws Exception In case of error.
      */
-    private void testQueryMetrics(IgniteCache<String, Integer> cache, Query qry) {
-        cache.query(qry).getAll();
+    public void testQueryMetricsMultithreaded() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).context().cache().jcache("A");
 
+        Collection<CacheAbstractQueryMetricsSelfTest.Worker> workers = new ArrayList<>();
+
+        int repeat = 100;
+
+        for (int i = 0; i < repeat; i++) {
+            workers.add(new CacheAbstractQueryMetricsSelfTest.Worker(cache, new SqlFieldsQuery("select * from String limit " + i)));
+            workers.add(new CacheAbstractQueryMetricsSelfTest.Worker(cache, new SqlQuery("String", "from String")));
+            workers.add(new CacheAbstractQueryMetricsSelfTest.Worker(cache, new ScanQuery()));
+            workers.add(new CacheAbstractQueryMetricsSelfTest.Worker(cache, new TextQuery("String", "1")));
+        }
+
+        for (CacheAbstractQueryMetricsSelfTest.Worker worker : workers)
+            worker.start();
+
+        for (CacheAbstractQueryMetricsSelfTest.Worker worker : workers)
+            worker.join();
+
+        checkMetrics(cache, repeat * 4, repeat * 4, 0, false);
+    }
+
+    /**
+     * Check metrics.
+     *
+     * @param cache Cache to check metrics.
+     * @param execs Expected number of executions.
+     * @param completions Expected number of completions.
+     * @param failures Expected number of failures.
+     * @param first {@code true} if metrics checked for first query only.
+     */
+    private void checkMetrics(IgniteCache<Integer, String> cache, int execs, int completions, int failures, boolean first) {
         GridCacheQueryMetricsAdapter m = (GridCacheQueryMetricsAdapter)cache.queryMetrics();
 
+        assertNotNull(m);
+
         info("Metrics: " + m);
 
-        assertEquals(1, m.executions());
-        assertEquals(1, m.completedExecutions());
-        assertEquals(0, m.fails());
+        assertEquals("Executions", execs, m.executions());
+        assertEquals("Completions", completions, m.completedExecutions());
+        assertEquals("Failures", failures, m.fails());
         assertTrue(m.averageTime() >= 0);
         assertTrue(m.maximumTime() >= 0);
         assertTrue(m.minimumTime() >= 0);
-        assertTrue("On first execution minTime == maxTime", m.minimumTime() == m.maximumTime());
 
-        // Execute again with the same parameters.
+        if (first)
+            assertTrue("On first execution minTime == maxTime", m.minimumTime() == m.maximumTime());
+    }
+
+    /**
+     * @param cache Cache.
+     * @param qry Query.
+     */
+    private void checkQueryMetrics(IgniteCache<Integer, String> cache, Query qry) {
         cache.query(qry).getAll();
 
-        m = (GridCacheQueryMetricsAdapter)cache.queryMetrics();
+        checkMetrics(cache, 1, 1, 0, true);
 
-        info("Metrics: " + m);
+        // Execute again with the same parameters.
+        cache.query(qry).getAll();
 
-        assertEquals(2, m.executions());
-        assertEquals(2, m.completedExecutions());
-        assertEquals(0, m.fails());
-        assertTrue(m.averageTime() >= 0);
-        assertTrue(m.maximumTime() >= 0);
-        assertTrue(m.minimumTime() >= 0);
+        checkMetrics(cache, 2, 2, 0, false);
     }
 
     /**
@@ -258,24 +396,14 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
      * @param qry Query.
      * @param waitingForCompletion Waiting for query completion.
      */
-    private void testQueryNotFullyFetchedMetrics(IgniteCache<String, Integer> cache, Query qry,
+    private void checkQueryNotFullyFetchedMetrics(IgniteCache<Integer, String> cache, Query qry,
         boolean waitingForCompletion) throws IgniteInterruptedCheckedException {
         cache.query(qry).iterator().next();
 
         if (waitingForCompletion)
             waitingForCompletion(cache, 1);
 
-        GridCacheQueryMetricsAdapter m = (GridCacheQueryMetricsAdapter)cache.queryMetrics();
-
-        info("Metrics: " + m);
-
-        assertEquals(1, m.executions());
-        assertEquals(1, m.completedExecutions());
-        assertEquals(0, m.fails());
-        assertTrue(m.averageTime() >= 0);
-        assertTrue(m.maximumTime() >= 0);
-        assertTrue(m.minimumTime() >= 0);
-        assertTrue("On first execution minTime == maxTime", m.minimumTime() == m.maximumTime());
+        checkMetrics(cache, 1, 1, 0, true);
 
         // Execute again with the same parameters.
         cache.query(qry).iterator().next();
@@ -283,23 +411,14 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
         if (waitingForCompletion)
             waitingForCompletion(cache, 2);
 
-        m = (GridCacheQueryMetricsAdapter)cache.queryMetrics();
-
-        info("Metrics: " + m);
-
-        assertEquals(2, m.executions());
-        assertEquals(2, m.completedExecutions());
-        assertEquals(0, m.fails());
-        assertTrue(m.averageTime() >= 0);
-        assertTrue(m.maximumTime() >= 0);
-        assertTrue(m.minimumTime() >= 0);
+        checkMetrics(cache, 2, 2, 0, false);
     }
 
     /**
      * @param cache Cache.
      * @param qry Query.
      */
-    private void testQueryFailedMetrics(IgniteCache<String, Integer> cache, Query qry) {
+    private void checkQueryFailedMetrics(IgniteCache<Integer, String> cache, Query qry) {
         try {
             cache.query(qry).getAll();
         }
@@ -307,16 +426,7 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
             // No-op.
         }
 
-        GridCacheQueryMetricsAdapter m = (GridCacheQueryMetricsAdapter)cache.queryMetrics();
-
-        info("Metrics: " + m);
-
-        assertEquals(1, m.executions());
-        assertEquals(0, m.completedExecutions());
-        assertEquals(1, m.fails());
-        assertTrue(m.averageTime() == 0);
-        assertTrue(m.maximumTime() == 0);
-        assertTrue(m.minimumTime() == 0);
+        checkMetrics(cache, 1, 0, 1, true);
 
         // Execute again with the same parameters.
         try {
@@ -326,23 +436,14 @@ public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstra
             // No-op.
         }
 
-        m = (GridCacheQueryMetricsAdapter)cache.queryMetrics();
-
-        info("Metrics: " + m);
-
-        assertEquals(2, m.executions());
-        assertEquals(0, m.completedExecutions());
-        assertEquals(2, m.fails());
-        assertTrue(m.averageTime() == 0);
-        assertTrue(m.maximumTime() == 0);
-        assertTrue(m.minimumTime() == 0);
+        checkMetrics(cache, 2, 0, 2, true);
     }
 
     /**
      * @param cache Cache.
      * @param exp Expected.
      */
-    private static void waitingForCompletion(final IgniteCache<String, Integer> cache,
+    private static void waitingForCompletion(final IgniteCache<Integer, String> cache,
         final int exp) throws IgniteInterruptedCheckedException {
         GridTestUtils.waitForCondition(new GridAbsPredicate() {
             @Override public boolean apply() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheLocalQueryDetailMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheLocalQueryDetailMetricsSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheLocalQueryDetailMetricsSelfTest.java
new file mode 100644
index 0000000..7797120
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheLocalQueryDetailMetricsSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import static org.apache.ignite.cache.CacheMode.LOCAL;
+
+/**
+ * Tests for local cache query metrics.
+ */
+public class CacheLocalQueryDetailMetricsSelfTest extends CacheAbstractQueryDetailMetricsSelfTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        gridCnt = 1;
+        cacheMode = LOCAL;
+
+        super.beforeTest();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryDetailMetricsDistributedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryDetailMetricsDistributedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryDetailMetricsDistributedSelfTest.java
new file mode 100644
index 0000000..c924487
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryDetailMetricsDistributedSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+
+/**
+ * Tests for partitioned distributed cache query metrics.
+ */
+public class CachePartitionedQueryDetailMetricsDistributedSelfTest extends CacheAbstractQueryDetailMetricsSelfTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        gridCnt = 2;
+        cacheMode = PARTITIONED;
+
+        super.beforeTest();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryDetailMetricsLocalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryDetailMetricsLocalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryDetailMetricsLocalSelfTest.java
new file mode 100644
index 0000000..4ffba3e
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryDetailMetricsLocalSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+
+/**
+ * Tests for partitioned local cache query metrics.
+ */
+public class CachePartitionedQueryDetailMetricsLocalSelfTest extends CacheAbstractQueryDetailMetricsSelfTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        gridCnt = 1;
+        cacheMode = PARTITIONED;
+
+        super.beforeTest();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryDetailMetricsDistributedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryDetailMetricsDistributedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryDetailMetricsDistributedSelfTest.java
new file mode 100644
index 0000000..32edb66
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryDetailMetricsDistributedSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
+
+/**
+ * Tests for replicated distributed cache query metrics.
+ */
+public class CacheReplicatedQueryDetailMetricsDistributedSelfTest extends CacheAbstractQueryDetailMetricsSelfTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        gridCnt = 2;
+        cacheMode = REPLICATED;
+
+        super.beforeTest();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryDetailMetricsLocalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryDetailMetricsLocalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryDetailMetricsLocalSelfTest.java
new file mode 100644
index 0000000..65c372d
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryDetailMetricsLocalSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
+
+/**
+ * Tests for replicated local cache query metrics.
+ */
+public class CacheReplicatedQueryDetailMetricsLocalSelfTest extends CacheAbstractQueryDetailMetricsSelfTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        gridCnt = 1;
+        cacheMode = REPLICATED;
+
+        super.beforeTest();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java
index be7523f..21f6864 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java
@@ -18,12 +18,17 @@
 package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;
+import org.apache.ignite.internal.processors.cache.CacheLocalQueryDetailMetricsSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheLocalQueryMetricsSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheOffheapBatchIndexingSingleTypeTest;
+import org.apache.ignite.internal.processors.cache.CachePartitionedQueryDetailMetricsDistributedSelfTest;
+import org.apache.ignite.internal.processors.cache.CachePartitionedQueryDetailMetricsLocalSelfTest;
 import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsDistributedSelfTest;
 import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsLocalSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheQueryNewClientSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheQueryOffheapEvictDataLostTest;
+import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryDetailMetricsDistributedSelfTest;
+import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryDetailMetricsLocalSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsDistributedSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsLocalSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheScanPartitionQueryFallbackSelfTest;
@@ -93,6 +98,13 @@ public class IgniteCacheQuerySelfTestSuite2 extends TestSuite {
         suite.addTestSuite(CacheReplicatedQueryMetricsDistributedSelfTest.class);
         suite.addTestSuite(CacheReplicatedQueryMetricsLocalSelfTest.class);
 
+        // Cache query metrics.
+        suite.addTestSuite(CacheLocalQueryDetailMetricsSelfTest.class);
+        suite.addTestSuite(CachePartitionedQueryDetailMetricsDistributedSelfTest.class);
+        suite.addTestSuite(CachePartitionedQueryDetailMetricsLocalSelfTest.class);
+        suite.addTestSuite(CacheReplicatedQueryDetailMetricsDistributedSelfTest.class);
+        suite.addTestSuite(CacheReplicatedQueryDetailMetricsLocalSelfTest.class);
+
         // Unmarshalling query test.
         suite.addTestSuite(IgniteCacheP2pUnmarshallingQueryErrorTest.class);
         suite.addTestSuite(IgniteCacheNoClassQuerySelfTest.class);

http://git-wip-us.apache.org/repos/asf/ignite/blob/0234f673/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
index 1fa185f..04a68ae 100755
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
@@ -22,7 +22,8 @@ import java.util.{Collection => JavaCollection, Collections, UUID}
 
 import org.apache.ignite._
 import org.apache.ignite.cluster.ClusterNode
-import org.apache.ignite.internal.util.typedef._
+import org.apache.ignite.internal.util.lang.{GridFunc => F}
+import org.apache.ignite.internal.util.typedef.X
 import org.apache.ignite.internal.visor.cache._
 import org.apache.ignite.internal.visor.util.VisorTaskUtils._
 import org.apache.ignite.lang.IgniteBiTuple
@@ -287,7 +288,7 @@ class VisorCacheCommand {
                     if (hasArgFlag("scan", argLst))
                         VisorCacheScanCommand().scan(argLst, node)
                     else {
-                        if (aggrData.nonEmpty && !aggrData.exists(cache => safeEquals(cache.name(), name) && cache.system())) {
+                        if (aggrData.nonEmpty && !aggrData.exists(cache => F.eq(cache.name(), name) && cache.system())) {
                             if (hasArgFlag("clear", argLst))
                                 VisorCacheClearCommand().clear(argLst, node)
                             else if (hasArgFlag("swap", argLst))
@@ -470,7 +471,7 @@ class VisorCacheCommand {
                     println("  Total number of executions: " + ad.execsQuery)
                     println("  Total number of failures:   " + ad.failsQuery)
 
-                    gCfg.foreach(ccfgs => ccfgs.find(ccfg => safeEquals(ccfg.name(), ad.name()))
+                    gCfg.foreach(ccfgs => ccfgs.find(ccfg => F.eq(ccfg.name(), ad.name()))
                         .foreach(ccfg => {
                             nl()
 


Mime
View raw message