public void exit() throws ErrorEntryFreeException { exit(1, OBJECTS0); }
@Override public void onExit(Context context, ResourceWrapper resourceWrapper, int count, Object... args) { if (context.getCurEntry().getError() == null) { ParameterMetric parameterMetric = ParamFlowSlot.getParamMetric(resourceWrapper); if (parameterMetric != null) { parameterMetric.decreaseThreadCount(args); } } } }
@Override public void exit(Context context, ResourceWrapper resourceWrapper, int count, Object... args) { System.out.println("Exiting for entry on DemoSlot: " + context.getCurEntry().getResourceWrapper().getName()); fireExit(context, resourceWrapper, count, args); } }
DefaultNode node = (DefaultNode)context.getCurNode(); if (context.getCurEntry().getError() == null) { long rt = TimeUtil.currentTimeMillis() - context.getCurEntry().getCreateTime(); if (rt > Constants.TIME_DROP_VALVE) { rt = Constants.TIME_DROP_VALVE; if (context.getCurEntry().getOriginNode() != null) { context.getCurEntry().getOriginNode().addRtAndSuccess(rt, count); if (context.getCurEntry().getOriginNode() != null) { context.getCurEntry().getOriginNode().decreaseThreadNum();
DefaultNode node = (DefaultNode)context.getCurNode(); if (context.getCurEntry().getError() == null) { long rt = TimeUtil.currentTimeMillis() - context.getCurEntry().getCreateTime(); if (rt > Constants.TIME_DROP_VALVE) { rt = Constants.TIME_DROP_VALVE; if (context.getCurEntry().getOriginNode() != null) { context.getCurEntry().getOriginNode().addRtAndSuccess(rt, count); if (context.getCurEntry().getOriginNode() != null) { context.getCurEntry().getOriginNode().decreaseThreadNum();
public void exit(int count) throws ErrorEntryFreeException { exit(count, OBJECTS0); }
@Override public void entry(Context context, ResourceWrapper resourceWrapper, DefaultNode node, int count, boolean prioritized, Object... args) throws Throwable { System.out.println("Current context: " + context.getName()); System.out.println("Current entry resource: " + context.getCurEntry().getResourceWrapper().getName()); fireEntry(context, resourceWrapper, node, count, prioritized, args); }
@RequestMapping("/link") @ResponseBody public String link() throws BlockException { Entry entry = SphU.entry("head1", EntryType.IN); Entry entry1 = SphU.entry("head2", EntryType.IN); Entry entry2 = SphU.entry("head3", EntryType.IN); Entry entry3 = SphU.entry("head4", EntryType.IN); entry3.exit(); entry2.exit(); entry1.exit(); entry.exit(); return "successfully create a call link"; }
String curEntryNameInContext = context.getCurEntry() == null ? null : context.getCurEntry().getResourceWrapper().getName();
@Override public void run() { while (true) { Entry entry = null; try { TimeUnit.MILLISECONDS.sleep(5); entry = SphU.entry(KEY); // token acquired pass.incrementAndGet(); // sleep 600 ms, as rt TimeUnit.MILLISECONDS.sleep(600); } catch (Exception e) { block.incrementAndGet(); } finally { total.incrementAndGet(); if (entry != null) { entry.exit(); } } } }
String curEntryNameInContext = context.getCurEntry() == null ? null : context.getCurEntry().getResourceWrapper().getName();
@Override public void run() { while (!stop) { Entry entry = null; try { entry = SphU.entry(resourceName); // token acquired, means pass pass.addAndGet(1); } catch (BlockException e1) { block.incrementAndGet(); } catch (Exception e2) { // biz exception } finally { total.incrementAndGet(); if (entry != null) { entry.exit(); } } Random random2 = new Random(); try { TimeUnit.MILLISECONDS.sleep(random2.nextInt(50)); } catch (InterruptedException e) { // ignore } } } }
@Override public void run() { while (!stop) { Entry entry = null; try { entry = SphU.entry(KEY); pass.addAndGet(1); } catch (BlockException e1) { block.incrementAndGet(); } catch (Exception e2) { // biz exception } finally { total.incrementAndGet(); if (entry != null) { entry.exit(); } } Random random2 = new Random(); try { TimeUnit.MILLISECONDS.sleep(random2.nextInt(50)); } catch (InterruptedException e) { // ignore } } } }
@Override public void run() { while (true) { Entry methodA = null; try { TimeUnit.MILLISECONDS.sleep(5); methodA = SphU.entry("methodA"); activeThread.incrementAndGet(); Entry methodB = SphU.entry("methodB"); TimeUnit.MILLISECONDS.sleep(methodBRunningTime); methodB.exit(); pass.addAndGet(1); } catch (BlockException e1) { block.incrementAndGet(); } catch (Exception e2) { // biz exception } finally { total.incrementAndGet(); if (methodA != null) { methodA.exit(); activeThread.decrementAndGet(); } } } } });
@Override public void run() { while (!stop) { Entry entry = null; try { entry = SphU.entry(KEY); pass.addAndGet(1); } catch (BlockException e1) { block.incrementAndGet(); } catch (Exception e2) { // biz exception } finally { total.incrementAndGet(); if (entry != null) { entry.exit(); } } Random random2 = new Random(); try { TimeUnit.MILLISECONDS.sleep(random2.nextInt(50)); } catch (InterruptedException e) { // ignore } } } }
@Override public void run() { while (!stop) { Entry entry = null; try { entry = SphU.entry(KEY); // token acquired, means pass pass.addAndGet(1); } catch (BlockException e1) { block.incrementAndGet(); } catch (Exception e2) { // biz exception } finally { total.incrementAndGet(); if (entry != null) { entry.exit(); } } Random random2 = new Random(); try { TimeUnit.MILLISECONDS.sleep(random2.nextInt(50)); } catch (InterruptedException e) { // ignore } } } }
@Override public void run() { while (!stop) { Entry entry = null; try { entry = SphU.entry(resourceName); // token acquired, means pass pass.addAndGet(1); } catch (BlockException e1) { block.incrementAndGet(); } catch (Exception e2) { // biz exception } finally { total.incrementAndGet(); if (entry != null) { entry.exit(); } } Random random2 = new Random(); try { TimeUnit.MILLISECONDS.sleep(random2.nextInt(50)); } catch (InterruptedException e) { // ignore } } } }
@Override public void run() { while (!stop) { Entry entry = null; try { entry = SphU.entry(KEY); // token acquired, means pass pass.addAndGet(1); } catch (BlockException e1) { block.incrementAndGet(); } catch (Exception e2) { // biz exception } finally { total.incrementAndGet(); if (entry != null) { entry.exit(); } } Random random2 = new Random(); try { TimeUnit.MILLISECONDS.sleep(random2.nextInt(2000)); } catch (InterruptedException e) { // ignore } } } }
@Override public void run() { while (!stop) { Entry entry = null; try { entry = SphU.entry(KEY); // token acquired, means pass pass.addAndGet(1); } catch (BlockException e1) { block.incrementAndGet(); } catch (Exception e2) { // biz exception } finally { total.incrementAndGet(); if (entry != null) { entry.exit(); } } Random random2 = new Random(); try { TimeUnit.MILLISECONDS.sleep(random2.nextInt(50)); } catch (InterruptedException e) { // ignore } } } }
@Override public void run() { while (!stop) { Entry entry = null; try { entry = SphU.entry(KEY); // token acquired, means pass pass.addAndGet(1); } catch (BlockException e1) { block.incrementAndGet(); } catch (Exception e2) { // biz exception } finally { total.incrementAndGet(); if (entry != null) { entry.exit(); } } Random random2 = new Random(); try { TimeUnit.MILLISECONDS.sleep(random2.nextInt(2000)); } catch (InterruptedException e) { // ignore } } } }