Package net.grinder.script

Examples of net.grinder.script.InternalScriptContext


        public boolean stopThread(final int threadNumber) {
          return m_threadContexts.shutdown(threadNumber);
        }
      };

      final InternalScriptContext scriptContext = new ScriptContextImplementation(workerIdentity,
          m_initialisationMessage.getFirstWorkerIdentity(), m_threadContexts, properties,
          externalLogger, m_sleeper, new SSLControlImplementation(m_threadContexts),
          scriptStatistics, m_testRegistryImplementation, delegatingThreadStarter, threadStopper,
          barrierGroups, barrierIdentityGenerator);
View Full Code Here


    public static final String GRINDER_PROP_THREAD_INCREMENT_INTERVAL = "grinder.processIncrementInterval";
    public static final String GRINDER_PROP_INITIAL_PROCESS = "grinder.initialProcesses";
    public static final String GRINDER_PROP_INITIAL_THREAD_SLEEP_TIME = "grinder.initialThreadSleepTime";

    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);
View Full Code Here

    Sleeper m_sleeper = new SleeperImplementation(m_times.getTimeAuthority(), externalLogger, 1.0d, 0.2d);

    final Statistics scriptStatistics = new ScriptStatisticsImplementation(m_threadContexts, m_statisticsServices,
        new NullSender());

    final InternalScriptContext scriptContext = new ScriptContextImplementation(new SimpleWorkerIdentity(
        "unit-test", 0), new SimpleWorkerIdentity("unit-test", 0), m_threadContexts, null,
        externalLogger, m_sleeper, new SSLControlImplementation(m_threadContexts), scriptStatistics,
        m_testRegistryImplementation, null, null, null, null);
    Grinder.grinder = scriptContext;
View Full Code Here

   *
   * @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();
    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;
  }
View Full Code Here

    // Calc the current thread's unique id
    return (agentNumber * totalProcessCount * totalThreadCount) + (processNumber * totalThreadCount) + threadNumber;
  }

  private static InternalScriptContext getGrinderInstance() {
    InternalScriptContext grinder = Grinder.grinder;
    if (grinder == null || grinder.getThreadNumber() == -1) {
      throw new RuntimeException("This method should be called in the worker thread context.");
    }
    return grinder;
  }
View Full Code Here

TOP

Related Classes of net.grinder.script.InternalScriptContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.