Only emit query metrics for uncached queries.

This commit is contained in:
Gian Merlino 2014-08-04 16:42:38 -07:00
parent b5ecf000ad
commit 6c8222788b
1 changed files with 22 additions and 22 deletions

View File

@ -390,6 +390,15 @@ public class ServerManager implements QuerySegmentWalker
{ {
SpecificSegmentSpec segmentSpec = new SpecificSegmentSpec(segmentDescriptor); SpecificSegmentSpec segmentSpec = new SpecificSegmentSpec(segmentDescriptor);
return new SpecificSegmentQueryRunner<T>( return new SpecificSegmentQueryRunner<T>(
new BySegmentQueryRunner<T>(
adapter.getIdentifier(),
adapter.getDataInterval().getStart(),
new CachingQueryRunner<T>(
adapter.getIdentifier(),
segmentDescriptor,
objectMapper,
cache,
toolChest,
new MetricsEmittingQueryRunner<T>( new MetricsEmittingQueryRunner<T>(
emitter, emitter,
new Function<Query<T>, ServiceMetricEvent.Builder>() new Function<Query<T>, ServiceMetricEvent.Builder>()
@ -400,20 +409,11 @@ public class ServerManager implements QuerySegmentWalker
return toolChest.makeMetricBuilder(input); return toolChest.makeMetricBuilder(input);
} }
}, },
new BySegmentQueryRunner<T>( new ReferenceCountingSegmentQueryRunner<T>(factory, adapter)
adapter.getIdentifier(), ).withWaitMeasuredFromNow(),
adapter.getDataInterval().getStart(),
new CachingQueryRunner<T>(
adapter.getIdentifier(),
segmentDescriptor,
objectMapper,
cache,
toolChest,
new ReferenceCountingSegmentQueryRunner<T>(factory, adapter),
cacheConfig cacheConfig
) )
) ),
).withWaitMeasuredFromNow(),
segmentSpec segmentSpec
); );
} }