mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
增加benchmark的示例代码
This commit is contained in:
@@ -50,6 +50,11 @@ public class CommonBenchmark {
|
||||
flowExecutor.execute2Resp("chain2");
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void test3(){
|
||||
flowExecutor.execute2Resp("chain3");
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) throws RunnerException {
|
||||
Options opt = new OptionsBuilder()
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yomahub.liteflow.benchmark.cmp;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeIteratorComponent;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
@LiteflowComponent("d")
|
||||
public class DCmp extends NodeIteratorComponent {
|
||||
@Override
|
||||
public Iterator<?> processIterator() throws Exception {
|
||||
return ListUtil.toList("1","2","3").iterator();
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,5 @@
|
||||
liteflow.rule-source=flow.xml
|
||||
liteflow.print-execution-log=false
|
||||
|
||||
liteflow.global-thread-pool-size=500
|
||||
liteflow.global-thread-pool-queue-size=1000
|
||||
@@ -38,8 +38,12 @@ public class ParallelLoopELSpringbootTest extends BaseTest {
|
||||
//测试并行FOR循环,循环次数直接在el中定义
|
||||
@Test
|
||||
public void testParallelLoop1() throws Exception {
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assertions.assertTrue(response.isSuccess());
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assertions.assertTrue(response.isSuccess());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//测试并行FOR循环,循环次数由For组件定义
|
||||
|
||||
Reference in New Issue
Block a user