Hi Andrey, You are right, current implementation of metrics is questionable. Please feel free to file a ticket if you have ideas on how to improve it.
On Sun, Nov 5, 2017 at 11:17 PM, Andrey Kornev <andrewkor...@hotmail.com> wrote: > Hi, > > It appears as if the query duration metric is a bit misleading. > > GridQueryProcessor.executeQuery() doesn't actually "run" the query. It > simply delegates query execution to a closure passed in as a parameter. The > closure may or may not actually execute the query. In some (all?) cases, > the closure simply creates and returns an Iterable (how does > IgniteH2Indexing.runQueryTwoStep, for example). Actual query execution > happens at some point later when user instantiates an Iterator from the > Iterable. What's in fact recorded (by GridQueryProcessor on line 2477) as > the "query duration" is just the query parsing stage as well as some > query's AST manipulation logic that tries to convert the regular regular > query to a map/reduce style query. So, it's basically a "prepare statement > duration" that is currently reported as "query duration". > > Am I missing something? > > Thanks > Andrey >