private boolean isScriptValidation() { try { return Grinder.grinder.getProperties().getBoolean("grinder.script.validation", false); } catch (Exception e) { return false; } }
/** * 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 thread count per a process. * * @return thread count assigned per a process */ public static int getThreadCount() { return getGrinderInstance().getProperties().getInt("grinder.threads", 1); } }
protected int doRampUp() { InternalScriptContext grinder = Grinder.grinder; if (grinder != null) { GrinderProperties properties = grinder.getProperties(); int rampUpInterval = properties.getInt(GRINDER_PROP_THREAD_INCREMENT_INTERVAL, 0); int rampUpStep = properties.getInt(GRINDER_PROP_THREAD_INCREMENT, 0); int rampUpInitialThread = properties.getInt(GRINDER_PROP_INITIAL_PROCESS, 0); int rampUpInitialSleep = properties.getInt(GRINDER_PROP_INITIAL_THREAD_SLEEP_TIME, 0); return doRampUp(rampUpInterval, rampUpStep, rampUpInitialThread, rampUpInitialSleep); } return 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; }