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 com.fasterxml.jackson.databind.ObjectMapper | 
jsonMapper  | 
protected Map<String,Number> | 
metrics  | 
protected Thread | 
ownerThread
Non final to give subclasses ability to reassign it. 
 | 
| Constructor and Description | 
|---|
DefaultQueryMetrics(com.fasterxml.jackson.databind.ObjectMapper jsonMapper)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
checkModifiedFromOwnerThread()  | 
void | 
chunkInterval(org.joda.time.Interval interval)  | 
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 | 
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 | 
queryType(QueryType query)
Sets  
Query.getType() of the given query as dimension. | 
void | 
remoteAddress(String remoteAddress)  | 
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. 
 | 
QueryMetrics<QueryType> | 
reportIntervalChunkTime(long timeNs)
Registers "interval chunk 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> | 
reportPreFilteredRows(long numRows)
Reports the number of rows to scan in the segment after applying  
QueryMetrics.preFilters(List). | 
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,
            String value)  | 
void | 
status(String status)  | 
void | 
success(boolean success)  | 
protected final com.fasterxml.jackson.databind.ObjectMapper jsonMapper
protected final ServiceMetricEvent.Builder builder
protected Thread ownerThread
public DefaultQueryMetrics(com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
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 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 chunkInterval(org.joda.time.Interval interval)
chunkInterval 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 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> reportIntervalChunkTime(long timeNs)
QueryMetricsreportIntervalChunkTime 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> reportNodeTime(long timeNs)
QueryMetricsreportNodeTime in interface QueryMetrics<QueryType extends Query<?>>protected QueryMetrics<QueryType> reportMetric(String metricName, Number value)
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 void emit(ServiceEmitter emitter)
QueryMetricsemit() call on this QueryMetrics object.emit in interface QueryMetrics<QueryType extends Query<?>>Copyright © 2011–2018. All rights reserved.