/** * Get the parameter passed by controller. When it's executed in the * validation mode, always returns empty string. * * @return param. empty string if none. * @since 3.2.3 */ public static String getParam() { return getParam(""); }
/** * Get the process count per an agent. * * @return process assigned per an agent */ public static int getProcessCount() { return getGrinderInstance().getProperties().getInt("grinder.processes", 1); }
/** * Get the total agent count. * * @return agent count. */ public static int getAgentCount() { return getGrinderInstance().getProperties().getInt("grinder.agents", 1); }
/** * Get the parameter passed by controller. When it's executed in the * validation mode, always returns the given default value 0. * * @return param. 0 if the param was not provided. * @since 3.2.3 */ public static float getParamFloat() { return NumberUtils.toFloat(getParam("0"), 0f); }
/** * Get the thread count per a process. * * @return thread count assigned per a process */ public static int getThreadCount() { return getGrinderInstance().getProperties().getInt("grinder.threads", 1); } }
/** * Get the parameter passed by controller. When it's executed in the * validation mode, always returns the given default value 0. * * @return param. 0 if the param was not provided. * @since 3.2.3 */ public static double getParamDouble() { return NumberUtils.toDouble(getParam("0"), 0); }
/** * Get this thread unique id among all threads in the all agents. * * @return unique id b/w from 0 to total thread count. * @since 3.2.3 */ public static int getThreadUniqId() { InternalScriptContext grinder = getGrinderInstance(); GrinderProperties properties = grinder.getProperties(); if (properties != null) { int totalProcessCount = properties.getInt("grinder.processes", 1); int totalThreadCount = properties.getInt("grinder.threads", 1); int agentNumber = grinder.getAgentNumber(); int processNumber = grinder.getProcessNumber(); int threadNumber = grinder.getThreadNumber(); // Calc the current thread's unique id return (agentNumber * totalProcessCount * totalThreadCount) + (processNumber * totalThreadCount) + threadNumber; } return 0; }
/** * Get the parameter passed by controller. When it's executed in the * validation mode, always returns the given default value 0. * * @return param. 0 if the param was not provided. * @since 3.2.3 */ public static int getParamInt() { return NumberUtils.toInt(getParam("0"), 0); }
/** * Get the parameter passed by controller. When it's executed in the * validation mode, always returns the given default value 0. * * @return param. 0 if the param was not provided. * @since 3.2.3 */ public static long getParamLong() { return NumberUtils.toLong(getParam("0"), 0); }
/** * Get the parameter passed by controller. When it's executed in the * validation mode, always returns the given default value(false). * * @return param. false if the param was not provided. * @since 3.2.3 */ public static boolean getParamBoolean() { return BooleanUtils.toBoolean(getParam("false")); }