test_class.declarator: ctx = new HystrixRequestContextRule()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public HystrixRequestContextRule ctx = new HystrixRequestContextRule();
test_class.type: HystrixRequestContextRule
test_class.var_name: ctx
test_class.declarator: stream
test_class.original_string: HystrixUtilizationStream stream;
test_class.type: HystrixUtilizationStream
test_class.var_name: stream
test_class.declarator: groupKey = HystrixCommandGroupKey.Factory.asKey("Util")
test_class.modifier: private final static
test_class.original_string: private final static HystrixCommandGroupKey groupKey = HystrixCommandGroupKey.Factory.asKey("Util");
test_class.type: HystrixCommandGroupKey
test_class.var_name: groupKey
test_class.declarator: commandKey = HystrixCommandKey.Factory.asKey("Command")
test_class.modifier: private final static
test_class.original_string: private final static HystrixCommandKey commandKey = HystrixCommandKey.Factory.asKey("Command");
test_class.type: HystrixCommandKey
test_class.var_name: commandKey
test_class.file: hystrix-core/src/test/java/com/netflix/hystrix/metric/sample/HystrixUtilizationStreamTest.java
test_class.identifier: HystrixUtilizationStreamTest
test_class.superclass: extends CommandStreamTest
test_case.body: @Test
      public void testTwoSubscribersOneSlowOneFast() throws Exception {
          final CountDownLatch latch = new CountDownLatch(1);
          final AtomicBoolean foundError = new AtomicBoolean(false);
  
          Observable<HystrixUtilization> fast = stream
                  .observe()
                  .observeOn(Schedulers.newThread());
          Observable<HystrixUtilization> slow = stream
                  .observe()
                  .observeOn(Schedulers.newThread())
                  .map(new Func1<HystrixUtilization, HystrixUtilization>() {
                      @Override
                      public HystrixUtilization call(HystrixUtilization util) {
                          try {
                              Thread.sleep(100);
                              return util;
                          } catch (InterruptedException ex) {
                              return util;
                          }
                      }
                  });
  
          Observable<Boolean> checkZippedEqual = Observable.zip(fast, slow, new Func2<HystrixUtilization, HystrixUtilization, Boolean>() {
              @Override
              public Boolean call(HystrixUtilization payload, HystrixUtilization payload2) {
                  return payload == payload2;
              }
          });
  
          Subscription s1 = checkZippedEqual
                  .take(10000)
                  .subscribe(new Subscriber<Boolean>() {
                      @Override
                      public void onCompleted() {
                          System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " : OnCompleted");
                          latch.countDown();
                      }
  
                      @Override
                      public void onError(Throwable e) {
                          System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " : OnError : " + e);
                          e.printStackTrace();
                          foundError.set(true);
                          latch.countDown();
                      }
  
                      @Override
                      public void onNext(Boolean b) {
                          //System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " : OnNext : " + b);
                      }
                  });
  
          for (int i = 0; i < 50; i++) {
              HystrixCommand<Integer> cmd = Command.from(groupKey, commandKey, HystrixEventType.SUCCESS, 50);
              cmd.execute();
          }
  
          latch.await(10000, TimeUnit.MILLISECONDS);
          assertFalse(foundError.get());
      }
test_case.class_method_signature: HystrixUtilizationStreamTest.testTwoSubscribersOneSlowOneFast()
test_case.full_signature: @Test public void testTwoSubscribersOneSlowOneFast()
test_case.identifier: testTwoSubscribersOneSlowOneFast
test_case.invocations: observeOn observe newThread map observeOn observe newThread sleep zip subscribe take println currentTimeMillis getName currentThread countDown println currentTimeMillis getName currentThread printStackTrace set countDown from execute await assertFalse get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testTwoSubscribersOneSlowOneFast()
focal_class.declarator: intervalInMilliseconds
focal_class.modifier: private final
focal_class.original_string: private final int intervalInMilliseconds;
focal_class.type: int
focal_class.var_name: intervalInMilliseconds
focal_class.declarator: allUtilizationStream
focal_class.modifier: private final
focal_class.original_string: private final Observable<HystrixUtilization> allUtilizationStream;
focal_class.type: Observable<HystrixUtilization>
focal_class.var_name: allUtilizationStream
focal_class.declarator: isSourceCurrentlySubscribed = new AtomicBoolean(false)
focal_class.modifier: private final
focal_class.original_string: private final AtomicBoolean isSourceCurrentlySubscribed = new AtomicBoolean(false);
focal_class.type: AtomicBoolean
focal_class.var_name: isSourceCurrentlySubscribed
focal_class.declarator: dataEmissionIntervalInMs =
              DynamicPropertyFactory.getInstance().getIntProperty("hystrix.stream.utilization.intervalInMilliseconds", 500)
focal_class.modifier: private static final
focal_class.original_string: private static final DynamicIntProperty dataEmissionIntervalInMs =
              DynamicPropertyFactory.getInstance().getIntProperty("hystrix.stream.utilization.intervalInMilliseconds", 500);
focal_class.type: DynamicIntProperty
focal_class.var_name: dataEmissionIntervalInMs
focal_class.declarator: getAllUtilization =
              new Func1<Long, HystrixUtilization>() {
                  @Override
                  public HystrixUtilization call(Long timestamp) {
                      return HystrixUtilization.from(
                              getAllCommandUtilization.call(timestamp),
                              getAllThreadPoolUtilization.call(timestamp)
                      );
                  }
              }
focal_class.modifier: private static final
focal_class.original_string: private static final Func1<Long, HystrixUtilization> getAllUtilization =
              new Func1<Long, HystrixUtilization>() {
                  @Override
                  public HystrixUtilization call(Long timestamp) {
                      return HystrixUtilization.from(
                              getAllCommandUtilization.call(timestamp),
                              getAllThreadPoolUtilization.call(timestamp)
                      );
                  }
              };
focal_class.type: Func1<Long, HystrixUtilization>
focal_class.var_name: getAllUtilization
focal_class.declarator: INSTANCE =
              new HystrixUtilizationStream(dataEmissionIntervalInMs.get())
focal_class.modifier: private static final
focal_class.original_string: private static final HystrixUtilizationStream INSTANCE =
              new HystrixUtilizationStream(dataEmissionIntervalInMs.get());
focal_class.type: HystrixUtilizationStream
focal_class.var_name: INSTANCE
focal_class.declarator: getAllCommandUtilization =
              new Func1<Long, Map<HystrixCommandKey, HystrixCommandUtilization>>() {
                  @Override
                  public Map<HystrixCommandKey, HystrixCommandUtilization> call(Long timestamp) {
                      Map<HystrixCommandKey, HystrixCommandUtilization> commandUtilizationPerKey = new HashMap<HystrixCommandKey, HystrixCommandUtilization>();
                      for (HystrixCommandMetrics commandMetrics: HystrixCommandMetrics.getInstances()) {
                          HystrixCommandKey commandKey = commandMetrics.getCommandKey();
                          commandUtilizationPerKey.put(commandKey, sampleCommandUtilization(commandMetrics));
                      }
                      return commandUtilizationPerKey;
                  }
              }
focal_class.modifier: private static final
focal_class.original_string: private static final Func1<Long, Map<HystrixCommandKey, HystrixCommandUtilization>> getAllCommandUtilization =
              new Func1<Long, Map<HystrixCommandKey, HystrixCommandUtilization>>() {
                  @Override
                  public Map<HystrixCommandKey, HystrixCommandUtilization> call(Long timestamp) {
                      Map<HystrixCommandKey, HystrixCommandUtilization> commandUtilizationPerKey = new HashMap<HystrixCommandKey, HystrixCommandUtilization>();
                      for (HystrixCommandMetrics commandMetrics: HystrixCommandMetrics.getInstances()) {
                          HystrixCommandKey commandKey = commandMetrics.getCommandKey();
                          commandUtilizationPerKey.put(commandKey, sampleCommandUtilization(commandMetrics));
                      }
                      return commandUtilizationPerKey;
                  }
              };
focal_class.type: Func1<Long, Map<HystrixCommandKey, HystrixCommandUtilization>>
focal_class.var_name: getAllCommandUtilization
focal_class.declarator: getAllThreadPoolUtilization =
              new Func1<Long, Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization>>() {
                  @Override
                  public Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization> call(Long timestamp) {
                      Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization> threadPoolUtilizationPerKey = new HashMap<HystrixThreadPoolKey, HystrixThreadPoolUtilization>();
                      for (HystrixThreadPoolMetrics threadPoolMetrics: HystrixThreadPoolMetrics.getInstances()) {
                          HystrixThreadPoolKey threadPoolKey = threadPoolMetrics.getThreadPoolKey();
                          threadPoolUtilizationPerKey.put(threadPoolKey, sampleThreadPoolUtilization(threadPoolMetrics));
                      }
                      return threadPoolUtilizationPerKey;
                  }
              }
focal_class.modifier: private static final
focal_class.original_string: private static final Func1<Long, Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization>> getAllThreadPoolUtilization =
              new Func1<Long, Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization>>() {
                  @Override
                  public Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization> call(Long timestamp) {
                      Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization> threadPoolUtilizationPerKey = new HashMap<HystrixThreadPoolKey, HystrixThreadPoolUtilization>();
                      for (HystrixThreadPoolMetrics threadPoolMetrics: HystrixThreadPoolMetrics.getInstances()) {
                          HystrixThreadPoolKey threadPoolKey = threadPoolMetrics.getThreadPoolKey();
                          threadPoolUtilizationPerKey.put(threadPoolKey, sampleThreadPoolUtilization(threadPoolMetrics));
                      }
                      return threadPoolUtilizationPerKey;
                  }
              };
focal_class.type: Func1<Long, Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization>>
focal_class.var_name: getAllThreadPoolUtilization
focal_class.declarator: getOnlyCommandUtilization =
              new Func1<HystrixUtilization, Map<HystrixCommandKey, HystrixCommandUtilization>>() {
                  @Override
                  public Map<HystrixCommandKey, HystrixCommandUtilization> call(HystrixUtilization hystrixUtilization) {
                      return hystrixUtilization.getCommandUtilizationMap();
                  }
              }
focal_class.modifier: private static final
focal_class.original_string: private static final Func1<HystrixUtilization, Map<HystrixCommandKey, HystrixCommandUtilization>> getOnlyCommandUtilization =
              new Func1<HystrixUtilization, Map<HystrixCommandKey, HystrixCommandUtilization>>() {
                  @Override
                  public Map<HystrixCommandKey, HystrixCommandUtilization> call(HystrixUtilization hystrixUtilization) {
                      return hystrixUtilization.getCommandUtilizationMap();
                  }
              };
focal_class.type: Func1<HystrixUtilization, Map<HystrixCommandKey, HystrixCommandUtilization>>
focal_class.var_name: getOnlyCommandUtilization
focal_class.declarator: getOnlyThreadPoolUtilization =
              new Func1<HystrixUtilization, Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization>>() {
                  @Override
                  public Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization> call(HystrixUtilization hystrixUtilization) {
                      return hystrixUtilization.getThreadPoolUtilizationMap();
                  }
              }
focal_class.modifier: private static final
focal_class.original_string: private static final Func1<HystrixUtilization, Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization>> getOnlyThreadPoolUtilization =
              new Func1<HystrixUtilization, Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization>>() {
                  @Override
                  public Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization> call(HystrixUtilization hystrixUtilization) {
                      return hystrixUtilization.getThreadPoolUtilizationMap();
                  }
              };
focal_class.type: Func1<HystrixUtilization, Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization>>
focal_class.var_name: getOnlyThreadPoolUtilization
focal_class.file: hystrix-core/src/main/java/com/netflix/hystrix/metric/sample/HystrixUtilizationStream.java
focal_class.identifier: HystrixUtilizationStream
focal_class.class_method_signature: HystrixUtilizationStream.HystrixUtilizationStream(final int intervalInMilliseconds)
focal_class.full_signature: @Deprecated //deprecated in 1.5.4. public  HystrixUtilizationStream(final int intervalInMilliseconds)
focal_class.identifier: HystrixUtilizationStream
focal_class.modifiers: @Deprecated //deprecated in 1.5.4. public
focal_class.parameters: (final int intervalInMilliseconds)
focal_class.signature:  HystrixUtilizationStream(final int intervalInMilliseconds)
focal_class.class_method_signature: HystrixUtilizationStream.getInstance()
focal_class.full_signature: public static HystrixUtilizationStream getInstance()
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: HystrixUtilizationStream
focal_class.signature: HystrixUtilizationStream getInstance()
focal_class.class_method_signature: HystrixUtilizationStream.getNonSingletonInstanceOnlyUsedInUnitTests(int delayInMs)
focal_class.full_signature: static HystrixUtilizationStream getNonSingletonInstanceOnlyUsedInUnitTests(int delayInMs)
focal_class.identifier: getNonSingletonInstanceOnlyUsedInUnitTests
focal_class.modifiers: static
focal_class.parameters: (int delayInMs)
focal_class.return: HystrixUtilizationStream
focal_class.signature: HystrixUtilizationStream getNonSingletonInstanceOnlyUsedInUnitTests(int delayInMs)
focal_class.class_method_signature: HystrixUtilizationStream.observe()
focal_class.full_signature: public Observable<HystrixUtilization> observe()
focal_class.identifier: observe
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Observable<HystrixUtilization>
focal_class.signature: Observable<HystrixUtilization> observe()
focal_class.class_method_signature: HystrixUtilizationStream.observeCommandUtilization()
focal_class.full_signature: public Observable<Map<HystrixCommandKey, HystrixCommandUtilization>> observeCommandUtilization()
focal_class.identifier: observeCommandUtilization
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Observable<Map<HystrixCommandKey, HystrixCommandUtilization>>
focal_class.signature: Observable<Map<HystrixCommandKey, HystrixCommandUtilization>> observeCommandUtilization()
focal_class.class_method_signature: HystrixUtilizationStream.observeThreadPoolUtilization()
focal_class.full_signature: public Observable<Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization>> observeThreadPoolUtilization()
focal_class.identifier: observeThreadPoolUtilization
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Observable<Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization>>
focal_class.signature: Observable<Map<HystrixThreadPoolKey, HystrixThreadPoolUtilization>> observeThreadPoolUtilization()
focal_class.class_method_signature: HystrixUtilizationStream.getIntervalInMilliseconds()
focal_class.full_signature: public int getIntervalInMilliseconds()
focal_class.identifier: getIntervalInMilliseconds
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getIntervalInMilliseconds()
focal_class.class_method_signature: HystrixUtilizationStream.isSourceCurrentlySubscribed()
focal_class.full_signature: public boolean isSourceCurrentlySubscribed()
focal_class.identifier: isSourceCurrentlySubscribed
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isSourceCurrentlySubscribed()
focal_class.class_method_signature: HystrixUtilizationStream.sampleCommandUtilization(HystrixCommandMetrics commandMetrics)
focal_class.full_signature: private static HystrixCommandUtilization sampleCommandUtilization(HystrixCommandMetrics commandMetrics)
focal_class.identifier: sampleCommandUtilization
focal_class.modifiers: private static
focal_class.parameters: (HystrixCommandMetrics commandMetrics)
focal_class.return: HystrixCommandUtilization
focal_class.signature: HystrixCommandUtilization sampleCommandUtilization(HystrixCommandMetrics commandMetrics)
focal_class.class_method_signature: HystrixUtilizationStream.sampleThreadPoolUtilization(HystrixThreadPoolMetrics threadPoolMetrics)
focal_class.full_signature: private static HystrixThreadPoolUtilization sampleThreadPoolUtilization(HystrixThreadPoolMetrics threadPoolMetrics)
focal_class.identifier: sampleThreadPoolUtilization
focal_class.modifiers: private static
focal_class.parameters: (HystrixThreadPoolMetrics threadPoolMetrics)
focal_class.return: HystrixThreadPoolUtilization
focal_class.signature: HystrixThreadPoolUtilization sampleThreadPoolUtilization(HystrixThreadPoolMetrics threadPoolMetrics)
focal_method.body: public Observable<HystrixUtilization> observe() {
          return allUtilizationStream;
      }
focal_method.class_method_signature: HystrixUtilizationStream.observe()
focal_method.full_signature: public Observable<HystrixUtilization> observe()
focal_method.identifier: observe
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Observable<HystrixUtilization>
focal_method.signature: Observable<HystrixUtilization> observe()