test_class.declarator: stream
test_class.original_string: RollingCommandLatencyDistributionStream stream;
test_class.type: RollingCommandLatencyDistributionStream
test_class.var_name: stream
test_class.declarator: context
test_class.original_string: HystrixRequestContext context;
test_class.type: HystrixRequestContext
test_class.var_name: context
test_class.declarator: groupKey = HystrixCommandGroupKey.Factory.asKey("CommandLatency")
test_class.modifier: static
test_class.original_string: static HystrixCommandGroupKey groupKey = HystrixCommandGroupKey.Factory.asKey("CommandLatency");
test_class.type: HystrixCommandGroupKey
test_class.var_name: groupKey
test_class.file: hystrix-core/src/test/java/com/netflix/hystrix/metric/consumer/RollingCommandLatencyDistributionStreamTest.java
test_class.identifier: RollingCommandLatencyDistributionStreamTest
test_class.superclass: extends CommandStreamTest
test_case.body: @Test
      public void testEmptyStreamProducesEmptyDistributions() {
          HystrixCommandKey key = HystrixCommandKey.Factory.asKey("CMD-Latency-A");
          stream = RollingCommandLatencyDistributionStream.getInstance(key, 10, 100);
          stream.startCachingStreamValuesIfUnstarted();
  
          final CountDownLatch latch = new CountDownLatch(1);
          stream.observe().take(10).subscribe(new Subscriber<CachedValuesHistogram>() {
              @Override
              public void onCompleted() {
                  latch.countDown();
              }
  
              @Override
              public void onError(Throwable e) {
                  fail(e.getMessage());
              }
  
              @Override
              public void onNext(CachedValuesHistogram distribution) {
                  System.out.println("OnNext @ " + System.currentTimeMillis());
                  assertEquals(0, distribution.getTotalCount());
              }
          });
  
          //no writes
  
          try {
              assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
          } catch (InterruptedException ex) {
              fail("Interrupted ex");
          }
          assertEquals(0, stream.getLatest().getTotalCount());
      }
test_case.class_method_signature: RollingCommandLatencyDistributionStreamTest.testEmptyStreamProducesEmptyDistributions()
test_case.full_signature: @Test public void testEmptyStreamProducesEmptyDistributions()
test_case.identifier: testEmptyStreamProducesEmptyDistributions
test_case.invocations: asKey getInstance startCachingStreamValuesIfUnstarted subscribe take observe countDown fail getMessage println currentTimeMillis assertEquals getTotalCount assertTrue await fail assertEquals getTotalCount getLatest
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEmptyStreamProducesEmptyDistributions()
focal_class.declarator: streams = new ConcurrentHashMap<String, RollingCommandLatencyDistributionStream>()
focal_class.modifier: private static final
focal_class.original_string: private static final ConcurrentMap<String, RollingCommandLatencyDistributionStream> streams = new ConcurrentHashMap<String, RollingCommandLatencyDistributionStream>();
focal_class.type: ConcurrentMap<String, RollingCommandLatencyDistributionStream>
focal_class.var_name: streams
focal_class.declarator: addValuesToBucket = new Func2<Histogram, HystrixCommandCompletion, Histogram>() {
          @Override
          public Histogram call(Histogram initialDistribution, HystrixCommandCompletion event) {
              if (event.didCommandExecute() && event.getExecutionLatency() > -1) {
                  initialDistribution.recordValue(event.getExecutionLatency());
              }
              return initialDistribution;
          }
      }
focal_class.modifier: private static final
focal_class.original_string: private static final Func2<Histogram, HystrixCommandCompletion, Histogram> addValuesToBucket = new Func2<Histogram, HystrixCommandCompletion, Histogram>() {
          @Override
          public Histogram call(Histogram initialDistribution, HystrixCommandCompletion event) {
              if (event.didCommandExecute() && event.getExecutionLatency() > -1) {
                  initialDistribution.recordValue(event.getExecutionLatency());
              }
              return initialDistribution;
          }
      };
focal_class.type: Func2<Histogram, HystrixCommandCompletion, Histogram>
focal_class.var_name: addValuesToBucket
focal_class.file: hystrix-core/src/main/java/com/netflix/hystrix/metric/consumer/RollingCommandLatencyDistributionStream.java
focal_class.identifier: RollingCommandLatencyDistributionStream
focal_class.class_method_signature: RollingCommandLatencyDistributionStream.getInstance(HystrixCommandKey commandKey, HystrixCommandProperties properties)
focal_class.full_signature: public static RollingCommandLatencyDistributionStream getInstance(HystrixCommandKey commandKey, HystrixCommandProperties properties)
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: (HystrixCommandKey commandKey, HystrixCommandProperties properties)
focal_class.return: RollingCommandLatencyDistributionStream
focal_class.signature: RollingCommandLatencyDistributionStream getInstance(HystrixCommandKey commandKey, HystrixCommandProperties properties)
focal_class.class_method_signature: RollingCommandLatencyDistributionStream.getInstance(HystrixCommandKey commandKey, int numBuckets, int bucketSizeInMs)
focal_class.full_signature: public static RollingCommandLatencyDistributionStream getInstance(HystrixCommandKey commandKey, int numBuckets, int bucketSizeInMs)
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: (HystrixCommandKey commandKey, int numBuckets, int bucketSizeInMs)
focal_class.return: RollingCommandLatencyDistributionStream
focal_class.signature: RollingCommandLatencyDistributionStream getInstance(HystrixCommandKey commandKey, int numBuckets, int bucketSizeInMs)
focal_class.class_method_signature: RollingCommandLatencyDistributionStream.reset()
focal_class.full_signature: public static void reset()
focal_class.identifier: reset
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void reset()
focal_class.class_method_signature: RollingCommandLatencyDistributionStream.RollingCommandLatencyDistributionStream(HystrixCommandKey commandKey, int numPercentileBuckets, int percentileBucketSizeInMs)
focal_class.full_signature: private  RollingCommandLatencyDistributionStream(HystrixCommandKey commandKey, int numPercentileBuckets, int percentileBucketSizeInMs)
focal_class.identifier: RollingCommandLatencyDistributionStream
focal_class.modifiers: private
focal_class.parameters: (HystrixCommandKey commandKey, int numPercentileBuckets, int percentileBucketSizeInMs)
focal_class.signature:  RollingCommandLatencyDistributionStream(HystrixCommandKey commandKey, int numPercentileBuckets, int percentileBucketSizeInMs)
focal_class.superclass: extends RollingDistributionStream<HystrixCommandCompletion>
focal_method.body: public static RollingCommandLatencyDistributionStream getInstance(HystrixCommandKey commandKey, HystrixCommandProperties properties) {
          final int percentileMetricWindow = properties.metricsRollingPercentileWindowInMilliseconds().get();
          final int numPercentileBuckets = properties.metricsRollingPercentileWindowBuckets().get();
          final int percentileBucketSizeInMs = percentileMetricWindow / numPercentileBuckets;
  
          return getInstance(commandKey, numPercentileBuckets, percentileBucketSizeInMs);
      }
focal_method.class_method_signature: RollingCommandLatencyDistributionStream.getInstance(HystrixCommandKey commandKey, HystrixCommandProperties properties)
focal_method.full_signature: public static RollingCommandLatencyDistributionStream getInstance(HystrixCommandKey commandKey, HystrixCommandProperties properties)
focal_method.identifier: getInstance
focal_method.invocations: get metricsRollingPercentileWindowInMilliseconds get metricsRollingPercentileWindowBuckets getInstance
focal_method.modifiers: public static
focal_method.parameters: (HystrixCommandKey commandKey, HystrixCommandProperties properties)
focal_method.return: RollingCommandLatencyDistributionStream
focal_method.signature: RollingCommandLatencyDistributionStream getInstance(HystrixCommandKey commandKey, HystrixCommandProperties properties)