log.debug("Cache hit thr#{}: {} => {}", JMeterContextService.getContext().getThreadNum(), host, Arrays.toString(result)); InetAddress[] staticAddresses = fromStaticHost(host); if (log.isDebugEnabled()) { log.debug("Cache miss thr#{}: (static) {} => {}", JMeterContextService.getContext().getThreadNum(), host, Arrays.toString(staticAddresses)); InetAddress[] addresses = requestLookup(host); if (log.isDebugEnabled()) { log.debug("Cache miss thr#{}: {} => {}", JMeterContextService.getContext().getThreadNum(), host, Arrays.toString(addresses));
/** * @see org.apache.jmeter.control.GenericController#initialize() */ @Override public void initialize() { super.initialize(); // get a different start index if(getInterleaveAccrossThreads()) { this.current = getThreadContext().getThreadNum() % getSubControllers().size(); } } }
private CollectionProperty getValues() { CollectionProperty threadValues = (CollectionProperty) getProperty(THREAD_VALUES); if (threadValues.size() > 0) { return (CollectionProperty) threadValues.get(getThreadContext().getThreadNum() % threadValues.size()); } return new CollectionProperty("noname", new LinkedList<>()); }
public void setupTest(String host, String clientId, int size) { try { JMeterContext jmcx = JMeterContextService.getContext(); this.connectionArray= new FutureConnection[size]; if(size==1){ this.connectionArray[0]= createConnection(host,clientId+jmcx.getThreadNum()); this.connectionArray[0].connect().await(); this.getLogger().info("NUMBER CONNECTION: "+PublisherSampler.numberOfConnection.getAndIncrement()); } else { for(int i = 0;i< size;i++){ this.connectionArray[i]= createConnection(host,clientId+jmcx.getThreadNum()+i); this.connectionArray[i].connect().await(); this.getLogger().info("NUMBER CONNECTION: "+PublisherSampler.numberOfConnection.getAndIncrement()); } } } catch (Exception e) { getLogger().error(e.getMessage()); } } public void setupTest(String host, String clientId, String user, String password, int size) {
if (log.isDebugEnabled()) { log.debug("Cache miss: {} Thread #{}, resolved with system resolver into {}", host, JMeterContextService.getContext().getThreadNum(), Arrays.toString(addresses));
public void setupTest(String host, String clientId, String user, String password, int size) { try { JMeterContext jmcx = JMeterContextService.getContext(); this.connectionArray= new FutureConnection[size]; if(size==1){ this.connectionArray[0]= createConnection(host,clientId+jmcx.getThreadNum(),user,password); this.connectionArray[0].connect().await(); this.getLogger().info("NUMBER CONNECTION: "+PublisherSampler.numberOfConnection.getAndIncrement()); } else { for(int i = 0;i< size;i++){ this.connectionArray[i]= createConnection(host,clientId+jmcx.getThreadNum()+i,user,password); this.connectionArray[i].connect().await(); this.getLogger().info("NUMBER CONNECTION: "+PublisherSampler.numberOfConnection.getAndIncrement()); } } getLogger().info("Connection successful.."); } catch (Exception e) { getLogger().error(e.getMessage()); } }
if (size == 1) { this.connectionArray[0] = createConnection(host, clientId + jmcx.getThreadNum(), durable); this.connectionArray[0].listener(new ListenerforSubscribe()); CallbackforSubscribe cbs = new CallbackforSubscribe(); for (int j = 0; j < size; j++) { this.connectionArray[j] = createConnection(host, clientId + jmcx.getThreadNum() + j, durable); this.connectionArray[j] .listener(new ListenerforSubscribe()); String[] topicArray = topic.split("\\s*,\\s*"); this.connectionArray[r] = createConnection(host, clientId + jmcx.getThreadNum() + r, durable); this.connectionArray[r].listener(new ListenerforSubscribe()); CallbackforSubscribe cbs = new CallbackforSubscribe();
if (size == 1) { this.connectionArray[0] = createConnection(host, clientId + jmcx.getThreadNum(), durable, user, password); this.connectionArray[0].listener(new ListenerforSubscribe()); CallbackforSubscribe cbs = new CallbackforSubscribe(); for (int j = 0; j < size; j++) { this.connectionArray[j] = createConnection(host, clientId + jmcx.getThreadNum() + j, durable, user, password); this.connectionArray[j] .listener(new ListenerforSubscribe()); int r = rand.nextInt(size); this.connectionArray[r] = createConnection(host, clientId + jmcx.getThreadNum() + r, durable, user, password); this.connectionArray[r] .listener(new ListenerforSubscribe());
/** * Update the worker thread jmeter context with the main thread one * @param isInit if true the context a full copy is done, if false only update is done */ private void syncContext(boolean isInit) { // jmeter context synchronisation JMeterContext current = JMeterContextService.getContext(); JMeterContext ctx = this.getThreadContext(); if (isInit) { current.setCurrentSampler(ctx.getCurrentSampler()); current.setEngine(ctx.getEngine()); current.setRestartNextLoop(ctx.isRestartNextLoop()); current.setSamplingStarted(ctx.isSamplingStarted()); current.setThread(ctx.getThread()); current.setThreadGroup(ctx.getThreadGroup()); current.setThreadNum(ctx.getThreadNum()); } current.setVariables(ctx.getVariables()); current.setPreviousResult(ctx.getPreviousResult()); //current.getSamplerContext().putAll(ctx.getSamplerContext()); } @Override
/** * Update the worker thread jmeter context with the main thread one * @param isInit if true the context a full copy is done, if false only update is done */ private void syncContext(boolean isInit) { // jmeter context synchronisation JMeterContext current = JMeterContextService.getContext(); JMeterContext ctx = this.getThreadContext(); if (isInit) { current.setCurrentSampler(ctx.getCurrentSampler()); current.setEngine(ctx.getEngine()); current.setRestartNextLoop(ctx.isRestartNextLoop()); current.setSamplingStarted(ctx.isSamplingStarted()); current.setThread(ctx.getThread()); current.setThreadGroup(ctx.getThreadGroup()); current.setThreadNum(ctx.getThreadNum()); } current.setVariables(ctx.getVariables()); current.setPreviousResult(ctx.getPreviousResult()); //current.getSamplerContext().putAll(ctx.getSamplerContext()); }
/** * Update the worker thread jmeter context with the main thread one * @param isInit if true the context a full copy is done, if false only update is done */ private void syncContext(boolean isInit) { // jmeter context synchronisation JMeterContext current = JMeterContextService.getContext(); JMeterContext ctx = this.getThreadContext(); if (isInit) { current.setCurrentSampler(ctx.getCurrentSampler()); current.setEngine(ctx.getEngine()); current.setRestartNextLoop(ctx.isRestartNextLoop()); current.setSamplingStarted(ctx.isSamplingStarted()); current.setThread(ctx.getThread()); current.setThreadGroup(ctx.getThreadGroup()); current.setThreadNum(ctx.getThreadNum()); } current.setVariables(ctx.getVariables()); current.setPreviousResult(ctx.getPreviousResult()); //current.getSamplerContext().putAll(ctx.getSamplerContext()); }