Package org.apache.druid.query.topn
Class DefaultTopNQueryMetrics
java.lang.Object
org.apache.druid.query.DefaultQueryMetrics<TopNQuery>
org.apache.druid.query.topn.DefaultTopNQueryMetrics
- All Implemented Interfaces:
QueryMetrics<TopNQuery>,TopNQueryMetrics
public class DefaultTopNQueryMetrics
extends DefaultQueryMetrics<TopNQuery>
implements TopNQueryMetrics
-
Field Summary
Fields inherited from class org.apache.druid.query.DefaultQueryMetrics
builder, metrics, ownerThread, QUERY_BYTES, QUERY_CPU_TIME, QUERY_ON_DEMAND_LOAD_BATCH_TIME, QUERY_ON_DEMAND_LOAD_BYTES, QUERY_ON_DEMAND_LOAD_COUNT, QUERY_ON_DEMAND_LOAD_TIME_AVG, QUERY_ON_DEMAND_LOAD_TIME_MAX, QUERY_ON_DEMAND_WAIT_TIME_AVG, QUERY_ON_DEMAND_WAIT_TIME_MAX, QUERY_RESULT_CACHE_HIT, QUERY_SEGMENT_AND_CACHE_TIME, QUERY_SEGMENT_TIME, QUERY_TIME, QUERY_WAIT_TIME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddProcessedRows(long numRows) Called with the number of rows, processed via each cursor, processed for the query within the segment.voidalgorithm(TopNAlgorithm algorithm) voidcolumnValueSelector(ColumnValueSelector columnValueSelector) This method is called exactly once with the columnValueSelector object of each cursor, processed for the query.voidThis method is called exactly once with each cursor, processed for the query.voidSetsTopNQuery.getDimensionSpec().getDimension()of the given query as dimension.voiddimensionCardinality(int cardinality) voidgranularity(TopNQuery query) Sets the granularity ofBaseQuery.getGranularity()of the given query as dimension.voidnumComplexMetrics(TopNQuery query) Sets the number of "complex" metrics of the given topN query as dimension.voidnumMetrics(TopNQuery query) Sets the number of metrics of the given topN query as dimension.voidnumValuesPerPass(TopNParams params) This method may setTopNParams.getNumValuesPerPass()of the query as dimension.voidPulls all information from the query object into dimensions of future metrics.voidCalls to this method andTopNQueryMetrics.stopRecordingScanTime()wrap scanning of each cursor, processed for the query.Calls ofTopNQueryMetrics.startRecordingScanTime()and this method wrap scanning of each cursor, processed for the query.voidSetsTopNQuery.getThreshold()of the given query as dimension.Methods inherited from class org.apache.druid.query.DefaultQueryMetrics
checkModifiedFromOwnerThread, context, dataSource, duration, emit, getIntervalsAsStringArray, getTableNamesAsString, hasFilters, identity, interval, makeBitmapResultFactory, parallelMergeParallelism, projection, queryId, queryId, queryType, remoteAddress, reportBackPressureTime, reportBitmapConstructionTime, reportCpuTime, reportMetric, reportNodeBytes, reportNodeTime, reportNodeTimeToFirstByte, reportParallelMergeFastestPartitionTime, reportParallelMergeInputRows, reportParallelMergeInputSequences, reportParallelMergeOutputRows, reportParallelMergeParallelism, reportParallelMergeSlowestPartitionTime, reportParallelMergeTaskCount, reportParallelMergeTotalCpuTime, reportParallelMergeTotalTime, reportPreFilteredRows, reportQueriedSegmentCount, reportQueryBytes, reportQueryTime, reportResultCachePoll, reportSegmentAndCacheTime, reportSegmentOnDemandLoadBytes, reportSegmentOnDemandLoadCount, reportSegmentOnDemandLoadTime, reportSegmentOnDemandLoadTimeAvg, reportSegmentOnDemandLoadTimeMax, reportSegmentOnDemandLoadWaitTimeAvg, reportSegmentOnDemandLoadWaitTimeMax, reportSegmentRows, reportSegmentTime, reportWaitTime, segment, server, setDimension, sqlQueryId, sqlQueryId, status, statusCode, subQueryId, success, vectorizedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.query.QueryMetrics
context, dataSource, duration, emit, filterBundle, hasFilters, identity, interval, makeBitmapResultFactory, parallelMergeParallelism, postFilters, preFilters, projection, queryId, queryId, queryType, remoteAddress, reportBackPressureTime, reportBitmapConstructionTime, reportCpuTime, reportNodeBytes, reportNodeTime, reportNodeTimeToFirstByte, reportParallelMergeFastestPartitionTime, reportParallelMergeInputRows, reportParallelMergeInputSequences, reportParallelMergeOutputRows, reportParallelMergeParallelism, reportParallelMergeSlowestPartitionTime, reportParallelMergeTaskCount, reportParallelMergeTotalCpuTime, reportParallelMergeTotalTime, reportPreFilteredRows, reportQueriedSegmentCount, reportQueryBytes, reportQueryTime, reportResultCachePoll, reportSegmentAndCacheTime, reportSegmentOnDemandLoadBytes, reportSegmentOnDemandLoadCount, reportSegmentOnDemandLoadTime, reportSegmentOnDemandLoadTimeAvg, reportSegmentOnDemandLoadTimeMax, reportSegmentOnDemandLoadWaitTimeAvg, reportSegmentOnDemandLoadWaitTimeMax, reportSegmentRows, reportSegmentTime, reportWaitTime, segment, server, sqlQueryId, sqlQueryId, status, statusCode, subQueryId, success, vectorized
-
Constructor Details
-
DefaultTopNQueryMetrics
public DefaultTopNQueryMetrics()
-
-
Method Details
-
query
Description copied from interface:QueryMetricsPulls all information from the query object into dimensions of future metrics.- Specified by:
queryin interfaceQueryMetrics<TopNQuery>- Overrides:
queryin classDefaultQueryMetrics<TopNQuery>
-
threshold
Description copied from interface:TopNQueryMetricsSetsTopNQuery.getThreshold()of the given query as dimension.- Specified by:
thresholdin interfaceTopNQueryMetrics
-
dimension
Description copied from interface:TopNQueryMetricsSetsTopNQuery.getDimensionSpec().getDimension()of the given query as dimension.- Specified by:
dimensionin interfaceTopNQueryMetrics
-
numMetrics
Description copied from interface:TopNQueryMetricsSets the number of metrics of the given topN query as dimension.- Specified by:
numMetricsin interfaceTopNQueryMetrics
-
numComplexMetrics
Description copied from interface:TopNQueryMetricsSets the number of "complex" metrics of the given topN query as dimension. By default it is assumed that "complex" metric is a metric of not long or double type, but it could be redefined in the implementation of this method.- Specified by:
numComplexMetricsin interfaceTopNQueryMetrics
-
granularity
Description copied from interface:TopNQueryMetricsSets the granularity ofBaseQuery.getGranularity()of the given query as dimension.- Specified by:
granularityin interfaceTopNQueryMetrics
-
dimensionCardinality
public void dimensionCardinality(int cardinality) - Specified by:
dimensionCardinalityin interfaceTopNQueryMetrics
-
algorithm
- Specified by:
algorithmin interfaceTopNQueryMetrics
-
cursor
Description copied from interface:TopNQueryMetricsThis method is called exactly once with each cursor, processed for the query.- Specified by:
cursorin interfaceTopNQueryMetrics
-
columnValueSelector
Description copied from interface:TopNQueryMetricsThis method is called exactly once with the columnValueSelector object of each cursor, processed for the query.- Specified by:
columnValueSelectorin interfaceTopNQueryMetrics
-
numValuesPerPass
Description copied from interface:TopNQueryMetricsThis method may setTopNParams.getNumValuesPerPass()of the query as dimension.- Specified by:
numValuesPerPassin interfaceTopNQueryMetrics
-
addProcessedRows
Description copied from interface:TopNQueryMetricsCalled with the number of rows, processed via each cursor, processed for the query within the segment. The total number of processed rows, reported via this method for a TopNQueryMetrics instance, is smaller or equal toQueryMetrics.reportPreFilteredRows(long), because matchers fromQueryMetrics.filterBundle(FilterBundle.BundleInfo)are additionally applied. If there are no postFilters, preFilteredRows and processedRows are equal.- Specified by:
addProcessedRowsin interfaceTopNQueryMetrics
-
startRecordingScanTime
public void startRecordingScanTime()Description copied from interface:TopNQueryMetricsCalls to this method andTopNQueryMetrics.stopRecordingScanTime()wrap scanning of each cursor, processed for the query.- Specified by:
startRecordingScanTimein interfaceTopNQueryMetrics
-
stopRecordingScanTime
Description copied from interface:TopNQueryMetricsCalls ofTopNQueryMetrics.startRecordingScanTime()and this method wrap scanning of each cursor, processed for the query.- Specified by:
stopRecordingScanTimein interfaceTopNQueryMetrics
-