Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
17 years ago

print out TPS to log

I am running a test case in a load test and one of the step is to print out the current thread index and the current TPS for some specified test step.

How Can I do this.

THanks

Ali

2 Replies

  • alibaba82's avatar
    alibaba82
    Super Contributor
    sorry. I mean print the following
    - current thread count
    - current tps for specified test step
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Ali,

    Try the following:

    import com.eviware.soapui.impl.wsdl.loadtest.data.LoadTestStatistics.Statistic

    // this only works when running under a LoadTest
    if( context.LoadTestContext == null )
      return

    def ltr = context.LoadTestContext.getLoadTestRunner()
    def stats = ltr.loadTest.statisticsModel

    log.info( "Thread Count:" + ltr.runningThreadCount )
    log.info( "TPS for step 0: " + stats.getStatistic( 0,  Statistic.TPS ))

    You'll need to disable disabling if the groovy log during LoadTests (in the UI Settings Tab) to see any output during LoadTests..

    Hope this helps!

    regards,

    /Ole
    eviware.com