I have a code that I want to measure speed while it runs continuously in automatic regression tests. The purpose of this would be to warn me of changes made to the code that had a negative impact on performance.
In pseudo code, I want something like this:
cpuTimer.start runTest cpuTimer.stop diff = cpuTimer.getDuration if diff > prevDiff
I am considering ThreadMXBean # getCurrentThreadCpuTime () for this, but the key problem is that automated tests will run on a wide range of different developers and will be automatically processed to test servers with a range of different hardware and capabilities.
Will this work, or will the numbers be wrong?
How to solve this problem? Is there a better way? Is there a standard tool for this kind of caper?
java performance testing automated-tests cpu-usage
izb
source share