Package de.hybris.platform.util
Class Perf
- java.lang.Object
-
- de.hybris.platform.util.Perf
-
public abstract class Perf extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidbody()voidclose()longgetExecutions()voidgo(int ms)Performsbody()with all available threads for the specified time.voidgo(int ms, int threadCount)Performsbody()with a specific amount of threads for the specified time.voidreset()
-
-
-
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.ExceptionPerformsbody()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.ExceptionPerformsbody()with a specific amount of threads for the specified time.- Parameters:
ms- the time to runthreadCount- 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()
-
-