jmeter-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 62390] jmeter threads use overloaded run method but not CachedThreadPool
Date Sun, 20 May 2018 21:38:21 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=62390

--- Comment #1 from Srijon <srijondas@gmail.com> ---
/* This is the original way multithreading was implemented in jMeter by
implementing the Runnable interface

    public void runTest() throws JMeterEngineException {
        if (host != null){
            long now=System.currentTimeMillis();
            System.out.println("Starting the test on host " + host + " @ "+new
Date(now)+" ("+now+")"); // NOSONAR Intentional
        }
        try {
            Thread runningThread = new Thread(this, "StandardJMeterEngine");
            runningThread.start();
        } catch (Exception err) {
            stopTest();
            throw new JMeterEngineException(err);
        }
    }

  */

  /*This is the proposed way to implentation using executors, this will allow
jmeter threads to be paused during execution*/

      @Override
    public void runTest() throws JMeterEngineException {
        if (host != null){
            long now=System.currentTimeMillis();
            System.out.println("Starting the test on host " + host + " @ "+new
Date(now)+" ("+now+")"); // NOSONAR Intentional
        }

        ExecutorService execService = Executors.newCachedThreadPool(); //using
newCachedThreadPool to implement multi-threading in jMeter
        execService.execute(this);

    }

-- 
You are receiving this mail because:
You are the assignee for the bug.
Mime
View raw message