/** * Method is called by the JMeterEngine class when a test run is started. * Zeroes numberOfActiveThreads. * Saves current time in a field and in the JMeter property "TESTSTART.MS" */ public static synchronized void startTest() { if (testStart == 0) { numberOfActiveThreads = 0; testStart = System.currentTimeMillis(); JMeterUtils.setProperty("TESTSTART.MS",Long.toString(testStart));// $NON-NLS-1$ } }
void removeSemaphores() { synchronized (semaphoreLock) { JMeterUtils.setProperty(HONO_PREFIX + getAddress(), "0"); } } }
void addSemaphore() { synchronized (semaphoreLock) { final String receivers = (getSemaphores() + 1) + ""; JMeterUtils.setProperty(HONO_PREFIX + getAddress(), receivers); LOGGER.info("addSemaphore - receivers: {}", receivers); } }
/** {@inheritDoc} */ @Override public String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String propertyName = ((CompoundVariable) values[0]).execute(); String propertyValue = ((CompoundVariable) values[1]).execute(); boolean returnValue = false;// should we return original value? if (values.length > 2) { returnValue = ((CompoundVariable) values[2]).execute().equalsIgnoreCase("true"); //$NON-NLS-1$ } if (returnValue) { // Only obtain and cast the return if needed return (String) JMeterUtils.setProperty(propertyName, propertyValue); } else { JMeterUtils.setProperty(propertyName, propertyValue); return ""; } }
JMeterUtils.setProperty(elementName + "_totalDuration", String.valueOf(pair.getRight())); JMeterUtils.setProperty(elementName + "_cntDelayed", String.valueOf(cntDelayed)); JMeterUtils.setProperty(elementName + "_cntSent", String.valueOf(cntSent)); JMeterUtils.setProperty(elementName + "_rps", String.valueOf(rps));
public void setData(ArrayList<String> data) { setProperty(new CollectionProperty(DistributedTestControl.DATA_PROP, data)); String val = StringUtils.join(data, ","); log.debug("Setting hosts 2: " + val); JMeterUtils.setProperty(PROP_HOSTS, val); } }
public void setData(ArrayList<String> data) { setProperty(new CollectionProperty(DistributedTestControl.DATA_PROP, data)); String val = StringUtils.join(data, ","); log.debug("Setting hosts 2: " + val); JMeterUtils.setProperty(PROP_HOSTS, val); } }
public CollectionProperty getData() { CollectionProperty data = (CollectionProperty) getProperty(DATA_PROP); LinkedList<String> arr=new LinkedList<String>(); for (int n = 0; n < data.size(); n++) { arr.add(data.get(n).getStringValue()); } String val = StringUtils.join(arr, ","); log.debug("Setting hosts 1: " + val); JMeterUtils.setProperty(PROP_HOSTS, val); return data; }
public CollectionProperty getData() { CollectionProperty data = (CollectionProperty) getProperty(DATA_PROP); LinkedList<String> arr=new LinkedList<String>(); for (int n = 0; n < data.size(); n++) { arr.add(data.get(n).getStringValue()); } String val = StringUtils.join(arr, ","); log.debug("Setting hosts 1: " + val); JMeterUtils.setProperty(PROP_HOSTS, val); return data; }
/** * Extract option JMeter#REPORT_OUTPUT_FOLDER_OPT and if defined sets property * {@link JMeter#JMETER_REPORT_OUTPUT_DIR_PROPERTY} after checking folder can * be safely written to * @param parser {@link CLArgsParser} * @throws IllegalArgumentException */ private void extractAndSetReportOutputFolder(CLArgsParser parser, boolean deleteResultFile) { CLOption reportOutputFolderOpt = parser .getArgumentById(REPORT_OUTPUT_FOLDER_OPT); if(reportOutputFolderOpt != null) { String reportOutputFolder = parser.getArgumentById(REPORT_OUTPUT_FOLDER_OPT).getArgument(); File reportOutputFolderAsFile = new File(reportOutputFolder); JOrphanUtils.canSafelyWriteToFolder(reportOutputFolderAsFile, deleteResultFile); final String reportOutputFolderAbsPath = reportOutputFolderAsFile.getAbsolutePath(); log.info("Setting property '{}' to:'{}'", JMETER_REPORT_OUTPUT_DIR_PROPERTY, reportOutputFolderAbsPath); JMeterUtils.setProperty(JMETER_REPORT_OUTPUT_DIR_PROPERTY, reportOutputFolderAbsPath); } }
JMeterUtils.setProperty(JMeterUtils.THREAD_GROUP_DISTRIBUTED_PREFIX_PROPERTY_NAME, hostAndPort); backingEngine = new StandardJMeterEngine(hostAndPort);
JMeterUtils.setProperty(concName, String.valueOf(values[1].execute())); justStarted = false; JMeterUtils.setProperty(concName, String.valueOf(needed)); JMeterUtils.setProperty(tstName + "_rps", "0"); return String.valueOf(needed);
threadGroup.setName("test thread group"); JMeterContextService.getContext().setThreadGroup(threadGroup); JMeterUtils.setProperty("sample_variables", "TEST1,TEST2,TEST3"); // for Flexible File Writer Test JMeterUtils.setProperty("saveservice_properties", "/ss.props"); JMeterUtils.setProperty("upgrade_properties", "/ss.props"); JMeterUtils.setProperty("sampleresult.default.encoding", "UTF-8"); // enable multibyte
JMeterUtils.setProperty("START.MS",Long.toString(now));// $NON-NLS-1$ Date today=new Date(now); // so it agrees with above JMeterUtils.setProperty("START.YMD",new SimpleDateFormat("yyyyMMdd").format(today));// $NON-NLS-1$ $NON-NLS-2$ JMeterUtils.setProperty("START.HMS",new SimpleDateFormat("HHmmss").format(today));// $NON-NLS-1$ $NON-NLS-2$
threadGroup.setName("test thread group"); JMeterContextService.getContext().setThreadGroup(threadGroup); JMeterUtils.setProperty("sample_variables", "TEST1,TEST2,TEST3"); // for Flexible File Writer Test JMeterUtils.setProperty("saveservice_properties", "/ss.props"); JMeterUtils.setProperty("upgrade_properties", "/ss.props"); JMeterUtils.setProperty("sampleresult.default.encoding", "UTF-8"); // enable multibyte
String paramName = ctx.getParameter("header.property.reference"); if(paramName != null && !"".equals(paramName)) JMeterUtils.setProperty(paramName, concatProperties(bmc.getMessageProperties())); }else{ result.setSuccessful(false);
String paramName = ctx.getParameter("header.property.reference"); if(paramName != null && !"".equals(paramName)) JMeterUtils.setProperty(paramName, concatProperties(bmc.getMessageProperties())); }else{ result.setSuccessful(false);