public class DefaultQueryMetrics<QueryType extends Query<?>> extends Object implements QueryMetrics<QueryType>
ownerThread
field should be updated.| Modifier and Type | Field and Description |
|---|---|
protected ServiceMetricEvent.Builder |
builder |
protected Map<String,Number> |
metrics |
protected Thread |
ownerThread
Non final to give subclasses ability to reassign it.
|
| Constructor and Description |
|---|
DefaultQueryMetrics() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkModifiedFromOwnerThread() |
void |
context(QueryType query)
Sets
Query.getContext() of the given query as dimension. |
void |
dataSource(QueryType query)
Sets
Query.getDataSource() of the given query as dimension. |
void |
duration(QueryType query)
Sets
Query.getDuration() of the given query as dimension. |
void |
emit(ServiceEmitter emitter)
Emits all metrics, registered since the last
emit() call on this QueryMetrics object. |
void |
hasFilters(QueryType query)
Sets
Query.hasFilters() of the given query as dimension. |
void |
identity(String identity)
Sets identity of the requester for a query.
|
void |
interval(QueryType query)
Sets
Query.getIntervals() of the given query as dimension. |
BitmapResultFactory<?> |
makeBitmapResultFactory(BitmapFactory factory)
Creates a
BitmapResultFactory which may record some information along bitmap construction from QueryMetrics.preFilters(List). |
void |
parallelMergeParallelism(int parallelism)
Sets broker merge parallelism, if parallel merges are enabled.
|
void |
postFilters(List<Filter> postFilters) |
void |
preFilters(List<Filter> preFilters) |
void |
query(QueryType query)
Pulls all information from the query object into dimensions of future metrics.
|
void |
queryId(QueryType query)
Sets
Query.getId() of the given query as dimension. |
void |
queryId(String queryId)
Sets id of the given query as dimension.
|
void |
queryType(QueryType query)
Sets
Query.getType() of the given query as dimension. |
void |
remoteAddress(String remoteAddress) |
QueryMetrics<QueryType> |
reportBackPressureTime(long timeNs)
Registers "time that channel is unreadable (backpressure)" metric.
|
QueryMetrics<QueryType> |
reportBitmapConstructionTime(long timeNs)
Reports the time spent constructing bitmap from
QueryMetrics.preFilters(List) of the query. |
QueryMetrics<QueryType> |
reportCpuTime(long timeNs)
Registers "cpu time" metric.
|
protected QueryMetrics<QueryType> |
reportMetric(String metricName,
Number value) |
QueryMetrics<QueryType> |
reportNodeBytes(long byteCount)
Registers "node bytes" metric.
|
QueryMetrics<QueryType> |
reportNodeTime(long timeNs)
Registers "node time" metric.
|
QueryMetrics<QueryType> |
reportNodeTimeToFirstByte(long timeNs)
Registers "time to first byte" metric.
|
QueryMetrics<QueryType> |
reportParallelMergeFastestPartitionTime(long timeNs)
Reports broker "wall" time in nanoseconds for the fastest parallel merge sequence partition to be 'initialized',
where 'initialized' is time to the first result batch is populated from data servers and merging can begin.
|
QueryMetrics<QueryType> |
reportParallelMergeInputRows(long numRows)
Reports total number of input rows processed by the broker during parallel merge.
|
QueryMetrics<QueryType> |
reportParallelMergeInputSequences(long numSequences)
Reports total number of input sequences processed by the broker during parallel merge.
|
QueryMetrics<QueryType> |
reportParallelMergeOutputRows(long numRows)
Reports broker total number of output rows after merging and combining input sequences (should be less than or
equal to the value supplied to
QueryMetrics.reportParallelMergeInputRows(long). |
QueryMetrics<QueryType> |
reportParallelMergeParallelism(int parallelism)
Reports number of parallel tasks the broker used to process the query during parallel merge.
|
QueryMetrics<QueryType> |
reportParallelMergeSlowestPartitionTime(long timeNs)
Reports broker "wall" time in nanoseconds for the slowest parallel merge sequence partition to be 'initialized',
where 'initialized' is time to the first result batch is populated from data servers and merging can begin.
|
QueryMetrics<QueryType> |
reportParallelMergeTaskCount(long numTasks)
Reports broker total number of fork join pool tasks required to complete query
|
QueryMetrics<QueryType> |
reportParallelMergeTotalCpuTime(long timeNs)
Reports broker total CPU time in nanoseconds where fork join merge combine tasks were doing work
|
QueryMetrics<QueryType> |
reportParallelMergeTotalTime(long timeNs)
Reports broker total "wall" time in nanoseconds from parallel merge start sequence creation to total
consumption.
|
QueryMetrics<QueryType> |
reportPreFilteredRows(long numRows)
Reports the number of rows to scan in the segment after applying
QueryMetrics.preFilters(List). |
QueryMetrics<QueryType> |
reportQueriedSegmentCount(long segmentCount)
Registers "segments queried count" metric.
|
QueryMetrics<QueryType> |
reportQueryBytes(long byteCount)
Registers "query bytes" metric.
|
QueryMetrics<QueryType> |
reportQueryTime(long timeNs)
Registers "query time" metric.
|
QueryMetrics<QueryType> |
reportSegmentAndCacheTime(long timeNs)
Registers "segmentAndCache time" metric.
|
QueryMetrics<QueryType> |
reportSegmentRows(long numRows)
Reports the total number of rows in the processed segment.
|
QueryMetrics<QueryType> |
reportSegmentTime(long timeNs)
Registers "segment time" metric.
|
QueryMetrics<QueryType> |
reportWaitTime(long timeNs)
Registers "wait time" metric.
|
void |
segment(String segmentIdentifier) |
void |
server(String host) |
protected void |
setDimension(String dimension,
Object value) |
void |
sqlQueryId(QueryType query)
Sets
Query.getSqlQueryId() of the given query as dimension |
void |
sqlQueryId(String sqlQueryId)
Sets sqlQueryId as a dimension
|
void |
status(String status) |
void |
subQueryId(QueryType query)
Sets
Query.getSubQueryId() of the given query as dimension. |
void |
success(boolean success) |
void |
vectorized(boolean vectorized)
Sets whether or not a segment scan has been vectorized.
|
protected final ServiceMetricEvent.Builder builder
protected Thread ownerThread
protected void checkModifiedFromOwnerThread()
public void query(QueryType query)
QueryMetricsquery in interface QueryMetrics<QueryType extends Query<?>>public void dataSource(QueryType query)
QueryMetricsQuery.getDataSource() of the given query as dimension.dataSource in interface QueryMetrics<QueryType extends Query<?>>public void queryType(QueryType query)
QueryMetricsQuery.getType() of the given query as dimension.queryType in interface QueryMetrics<QueryType extends Query<?>>public void interval(QueryType query)
QueryMetricsQuery.getIntervals() of the given query as dimension.interval in interface QueryMetrics<QueryType extends Query<?>>public void hasFilters(QueryType query)
QueryMetricsQuery.hasFilters() of the given query as dimension.hasFilters in interface QueryMetrics<QueryType extends Query<?>>public void duration(QueryType query)
QueryMetricsQuery.getDuration() of the given query as dimension.duration in interface QueryMetrics<QueryType extends Query<?>>public void queryId(QueryType query)
QueryMetricsQuery.getId() of the given query as dimension.queryId in interface QueryMetrics<QueryType extends Query<?>>public void queryId(String queryId)
QueryMetricsqueryId in interface QueryMetrics<QueryType extends Query<?>>public void subQueryId(QueryType query)
QueryMetricsQuery.getSubQueryId() of the given query as dimension.subQueryId in interface QueryMetrics<QueryType extends Query<?>>public void sqlQueryId(QueryType query)
QueryMetricsQuery.getSqlQueryId() of the given query as dimensionsqlQueryId in interface QueryMetrics<QueryType extends Query<?>>public void sqlQueryId(String sqlQueryId)
QueryMetricssqlQueryId in interface QueryMetrics<QueryType extends Query<?>>public void context(QueryType query)
QueryMetricsQuery.getContext() of the given query as dimension.context in interface QueryMetrics<QueryType extends Query<?>>public void server(String host)
server in interface QueryMetrics<QueryType extends Query<?>>public void remoteAddress(String remoteAddress)
remoteAddress in interface QueryMetrics<QueryType extends Query<?>>public void status(String status)
status in interface QueryMetrics<QueryType extends Query<?>>public void success(boolean success)
success in interface QueryMetrics<QueryType extends Query<?>>public void segment(String segmentIdentifier)
segment in interface QueryMetrics<QueryType extends Query<?>>public void preFilters(List<Filter> preFilters)
preFilters in interface QueryMetrics<QueryType extends Query<?>>public void postFilters(List<Filter> postFilters)
postFilters in interface QueryMetrics<QueryType extends Query<?>>public void identity(String identity)
QueryMetricsAuthenticationResult.identity in interface QueryMetrics<QueryType extends Query<?>>public void vectorized(boolean vectorized)
QueryMetricsvectorized in interface QueryMetrics<QueryType extends Query<?>>public void parallelMergeParallelism(int parallelism)
QueryMetricsQueryMetrics.reportParallelMergeParallelism(int) metric value, but optionally also available as a
dimension.parallelMergeParallelism in interface QueryMetrics<QueryType extends Query<?>>public BitmapResultFactory<?> makeBitmapResultFactory(BitmapFactory factory)
QueryMetricsBitmapResultFactory which may record some information along bitmap construction from QueryMetrics.preFilters(List). The returned BitmapResultFactory may add some dimensions to this QueryMetrics from it's BitmapResultFactory.toImmutableBitmap(Object) method. See BitmapResultFactory Javadoc for more
information.makeBitmapResultFactory in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportQueryTime(long timeNs)
QueryMetricsreportQueryTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportQueryBytes(long byteCount)
QueryMetricsreportQueryBytes in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportWaitTime(long timeNs)
QueryMetricsreportWaitTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportSegmentTime(long timeNs)
QueryMetricsreportSegmentTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportSegmentAndCacheTime(long timeNs)
QueryMetricsreportSegmentAndCacheTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportCpuTime(long timeNs)
QueryMetricsreportCpuTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportNodeTimeToFirstByte(long timeNs)
QueryMetricsreportNodeTimeToFirstByte in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportBackPressureTime(long timeNs)
QueryMetricsreportBackPressureTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportNodeTime(long timeNs)
QueryMetricsreportNodeTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportNodeBytes(long byteCount)
QueryMetricsreportNodeBytes in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportBitmapConstructionTime(long timeNs)
QueryMetricsQueryMetrics.preFilters(List) of the query. Not reported, if there are
no preFilters.reportBitmapConstructionTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportSegmentRows(long numRows)
QueryMetricsreportSegmentRows in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportPreFilteredRows(long numRows)
QueryMetricsQueryMetrics.preFilters(List). If the are no
preFilters, this metric is equal to QueryMetrics.reportSegmentRows(long).reportPreFilteredRows in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportParallelMergeParallelism(int parallelism)
QueryMetricsQueryMetrics.parallelMergeParallelism(int) dimension value, but optionally also available as a metric.reportParallelMergeParallelism in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportParallelMergeInputSequences(long numSequences)
QueryMetricsreportParallelMergeInputSequences in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportParallelMergeInputRows(long numRows)
QueryMetricsreportParallelMergeInputRows in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportParallelMergeOutputRows(long numRows)
QueryMetricsQueryMetrics.reportParallelMergeInputRows(long).reportParallelMergeOutputRows in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportParallelMergeTaskCount(long numTasks)
QueryMetricsreportParallelMergeTaskCount in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportParallelMergeTotalCpuTime(long timeNs)
QueryMetricsreportParallelMergeTotalCpuTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportParallelMergeTotalTime(long timeNs)
QueryMetricsreportParallelMergeTotalTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportParallelMergeFastestPartitionTime(long timeNs)
QueryMetricsreportParallelMergeFastestPartitionTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportParallelMergeSlowestPartitionTime(long timeNs)
QueryMetricsreportParallelMergeSlowestPartitionTime in interface QueryMetrics<QueryType extends Query<?>>public QueryMetrics<QueryType> reportQueriedSegmentCount(long segmentCount)
QueryMetricsreportQueriedSegmentCount in interface QueryMetrics<QueryType extends Query<?>>public void emit(ServiceEmitter emitter)
QueryMetricsemit() call on this QueryMetrics object.emit in interface QueryMetrics<QueryType extends Query<?>>protected QueryMetrics<QueryType> reportMetric(String metricName, Number value)
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.