Class Perf


  • public abstract class Perf
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Perf​(int poolThreads)
      Creates a new instance using Jalo scoped thread pool of specified size.
      Perf​(int poolThreads, boolean useJalo)
      Creates a new instance using either Jalo or non-Jalo scoped thread pool of specified size.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void body()  
      void close()  
      long getExecutions()  
      void go​(int ms)
      Performs body() with all available threads for the specified time.
      void go​(int ms, int threadCount)
      Performs body() with a specific amount of threads for the specified time.
      void reset()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Perf

        public Perf​(int poolThreads)
        Creates a new instance using Jalo scoped thread pool of specified size.
        Parameters:
        poolThreads - the number of thread to provide.
      • Perf

        public Perf​(int poolThreads,
                    boolean useJalo)
        Creates a new instance using either Jalo or non-Jalo scoped thread pool of specified size.
        Parameters:
        poolThreads - the number of thread to provide.
        useJalo - if true a Jalo scoped thread pool is used
    • Method Detail

      • body

        public abstract void body()
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • go

        public void go​(int ms)
                throws java.lang.Exception
        Performs body() with all available threads for the specified time.
        Parameters:
        ms - the time to run
        Throws:
        java.lang.Exception
      • go

        public void go​(int ms,
                       int threadCount)
                throws java.lang.Exception
        Performs body() with a specific amount of threads for the specified time.
        Parameters:
        ms - the time to run
        threadCount - the number of threads to use - must be smaller or equal to number of available ones!
        Throws:
        java.lang.Exception
      • close

        public void close()
      • getExecutions

        public long getExecutions()
      • reset

        public void reset()