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: HystrixDashboardStream stream;
test_class.type: HystrixDashboardStream
test_class.var_name: stream
test_class.declarator: groupKey = HystrixCommandGroupKey.Factory.asKey("Dashboard")
test_class.modifier: private final static
test_class.original_string: private final static HystrixCommandGroupKey groupKey = HystrixCommandGroupKey.Factory.asKey("Dashboard");
test_class.type: HystrixCommandGroupKey
test_class.var_name: groupKey
test_class.declarator: commandKey = HystrixCommandKey.Factory.asKey("DashboardCommand")
test_class.modifier: private final static
test_class.original_string: private final static HystrixCommandKey commandKey = HystrixCommandKey.Factory.asKey("DashboardCommand");
test_class.type: HystrixCommandKey
test_class.var_name: commandKey
test_class.file: hystrix-core/src/test/java/com/netflix/hystrix/metric/consumer/HystrixDashboardStreamTest.java
test_class.identifier: HystrixDashboardStreamTest
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<HystrixDashboardStream.DashboardData> fast = stream
                  .observe()
                  .observeOn(Schedulers.newThread());
          Observable<HystrixDashboardStream.DashboardData> slow = stream
                  .observe()
                  .observeOn(Schedulers.newThread())
                  .map(new Func1<HystrixDashboardStream.DashboardData, HystrixDashboardStream.DashboardData>() {
                      @Override
                      public HystrixDashboardStream.DashboardData call(HystrixDashboardStream.DashboardData n) {
                          try {
                              Thread.sleep(100);
                              return n;
                          } catch (InterruptedException ex) {
                              return n;
                          }
                      }
                  });
  
          Observable<Boolean> checkZippedEqual = Observable.zip(fast, slow, new Func2<HystrixDashboardStream.DashboardData, HystrixDashboardStream.DashboardData, Boolean>() {
              @Override
              public Boolean call(HystrixDashboardStream.DashboardData payload, HystrixDashboardStream.DashboardData 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: HystrixDashboardStreamTest.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: delayInMs
focal_class.modifier: final
focal_class.original_string: final int delayInMs;
focal_class.type: int
focal_class.var_name: delayInMs
focal_class.declarator: singleSource
focal_class.modifier: final
focal_class.original_string: final Observable<DashboardData> singleSource;
focal_class.type: Observable<DashboardData>
focal_class.var_name: singleSource
focal_class.declarator: isSourceCurrentlySubscribed = new AtomicBoolean(false)
focal_class.modifier: final
focal_class.original_string: final AtomicBoolean isSourceCurrentlySubscribed = new AtomicBoolean(false);
focal_class.type: AtomicBoolean
focal_class.var_name: isSourceCurrentlySubscribed
focal_class.declarator: dataEmissionIntervalInMs =
              DynamicPropertyFactory.getInstance().getIntProperty("hystrix.stream.dashboard.intervalInMilliseconds", 500)
focal_class.modifier: private static final
focal_class.original_string: private static final DynamicIntProperty dataEmissionIntervalInMs =
              DynamicPropertyFactory.getInstance().getIntProperty("hystrix.stream.dashboard.intervalInMilliseconds", 500);
focal_class.type: DynamicIntProperty
focal_class.var_name: dataEmissionIntervalInMs
focal_class.declarator: INSTANCE =
              new HystrixDashboardStream(dataEmissionIntervalInMs.get())
focal_class.modifier: private static final
focal_class.original_string: private static final HystrixDashboardStream INSTANCE =
              new HystrixDashboardStream(dataEmissionIntervalInMs.get());
focal_class.type: HystrixDashboardStream
focal_class.var_name: INSTANCE
focal_class.file: hystrix-core/src/main/java/com/netflix/hystrix/metric/consumer/HystrixDashboardStream.java
focal_class.identifier: HystrixDashboardStream
focal_class.class_method_signature: HystrixDashboardStream.HystrixDashboardStream(int delayInMs)
focal_class.full_signature: private  HystrixDashboardStream(int delayInMs)
focal_class.identifier: HystrixDashboardStream
focal_class.modifiers: private
focal_class.parameters: (int delayInMs)
focal_class.signature:  HystrixDashboardStream(int delayInMs)
focal_class.class_method_signature: HystrixDashboardStream.getInstance()
focal_class.full_signature: public static HystrixDashboardStream getInstance()
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: HystrixDashboardStream
focal_class.signature: HystrixDashboardStream getInstance()
focal_class.class_method_signature: HystrixDashboardStream.getNonSingletonInstanceOnlyUsedInUnitTests(int delayInMs)
focal_class.full_signature: static HystrixDashboardStream getNonSingletonInstanceOnlyUsedInUnitTests(int delayInMs)
focal_class.identifier: getNonSingletonInstanceOnlyUsedInUnitTests
focal_class.modifiers: static
focal_class.parameters: (int delayInMs)
focal_class.return: HystrixDashboardStream
focal_class.signature: HystrixDashboardStream getNonSingletonInstanceOnlyUsedInUnitTests(int delayInMs)
focal_class.class_method_signature: HystrixDashboardStream.observe()
focal_class.full_signature: public Observable<DashboardData> observe()
focal_class.identifier: observe
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Observable<DashboardData>
focal_class.signature: Observable<DashboardData> observe()
focal_class.class_method_signature: HystrixDashboardStream.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_method.body: public Observable<DashboardData> observe() {
          return singleSource;
      }
focal_method.class_method_signature: HystrixDashboardStream.observe()
focal_method.full_signature: public Observable<DashboardData> observe()
focal_method.identifier: observe
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Observable<DashboardData>
focal_method.signature: Observable<DashboardData> observe()