Package org.jboss.dtf.testframework.utils

Examples of org.jboss.dtf.testframework.utils.PerformanceLogger


            System.out.println("Invalid iteration parameters");
        }
        else
        {
            long thisTime = 0;
            PerformanceLogger logger = new PerformanceLogger("PerformanceTest1");

            logInformation("Performing "+startIters+" - "+endIters+" (step "+incrementIters+") iterations");

            for (long iters=startIters;iters<=endIters;iters += incrementIters)
            {
                if (persistent)
                    thisTime = persistentTest(iters);
                else
                    thisTime = recoverableTest(iters);

                logInformation("Number of Iterations:"+ iters +", Time Taken:" +thisTime);

                logger.addData( iters, (double)((double)iters/((double)thisTime/1000)) );
            }

            try
            {
                logger.output(System.out);
                assertSuccess();
            }
            catch (Exception e)
            {
                System.err.println("Unexpected exception - "+e);
View Full Code Here


    {
        boolean success = false;

        try
        {
            PerformanceLogger perfLogger = new PerformanceLogger( classname + PERF_DATA_PREFIX );

            perfLogger.setXAxisLabel("Number of Threads");
            perfLogger.setYAxisLabel("Tx/sec");

            System.out.println("Threads from "+getMinimumNumberOfThreads()+" to "+getMaximumNumberOfThreads());
            for (int threadCount=getMinimumNumberOfThreads();threadCount<=getMaximumNumberOfThreads();threadCount++)
            {
                PerformanceTest perfTest = (PerformanceTest)Thread.currentThread().getContextClassLoader().loadClass( classname ).newInstance();
                perfTest.setServiceConfigs( configs );
                perfTest.setParameters( _args );

                PerformanceTestRunnerThread[] pRunner = new PerformanceTestRunnerThread[threadCount];

                long startTimeForThreadSet= System.currentTimeMillis();

                for (int count=0;count<threadCount;count++)
                {
                    pRunner[count] = new PerformanceTestRunnerThread( perfTest, getNumberOfIterations() );

                    pRunner[count].start();
                }

                for (int count=0;count<threadCount;count++)
                {
                    pRunner[count].join();
                    success &= pRunner[count].success();
                }

                long endTimeForThreadSet= System.currentTimeMillis();
                long timeTaken = endTimeForThreadSet - startTimeForThreadSet;

                long numberOfTransactions = getNumberOfIterations()*threadCount;
                System.out.println( threadCount +" \t\t "+timeTaken+" \t\t"+(float) (numberOfTransactions/(timeTaken / 1000.0))+"\t\t"+numberOfTransactions);

                double dataX, dataY;

                switch ( _xDataToLog )
                {
                    case NUMBER_OF_TRANSACTIONS :
                    {
                        dataX = numberOfTransactions;
                        break;
                    }
                    case NUMBER_OF_THREADS :
                    default:
                    {
                        dataX = threadCount;
                        break;
                    }
                }

                switch ( _yDataToLog )
                {
                    case TIME_TAKEN :
                    {
                        dataY = timeTaken;
                        break;
                    }
                    case TRANSACTIONS_PER_SECOND :
                    default:
                    {
                        dataY = (numberOfTransactions/(timeTaken / 1000.0));
                        break;
                    }
                }

                perfLogger.addData( dataX, dataY );
            }

            perfLogger.output(System.err);

            if ( _csvFilename != null )
            {
                generateCSV(_csvFilename, perfLogger);
            }
View Full Code Here

TOP

Related Classes of org.jboss.dtf.testframework.utils.PerformanceLogger

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.