This benchmark explains the speed and data size of the Performance profile future when querying the analysis tree.
Environment:
CPU: 8 cores, 3.1 GHz
Memory: 16GB
Elasticsearch: 7.5.2 (single node)
Java: 1.8.0_65
Profile thread code:
Runs in Spring's Controller and uses recursion to simulate higher stack depths. Through multiple different sub-methods to simulate multiple child nodes in the generated profile tree.
Use `select sleep (duration)` in MySQL for thread waiting.
private void circleCall(int currentCount, int totalCount) throws InterruptedException { if (currentCount >= totalCount) { userRepo.sleepLong(); return; } testSleep1(); testSleep2(); ... testSleep10(); circleCall(currentCount + 1, totalCount); } private void testSleep1() throws InterruptedException { userRepo.sleepMini(); } private void testSleep2() throws InterruptedException { userRepo.sleepMini(); } ... private void testSleep10() throws InterruptedException { userRepo.sleepMini(); }
Profile analyze result:
Profile running time: 2 minutes
Total snapshot count: 14000+
Analyze max snapshot count: 12000
Query analyze total time: avg(4-5s)
Query snapshot time: avg(2.5s)
Analyze snapshot time: avg(0.8s)
Analyze result: 6MB