fix(性能测试): 性能测试引用相同文件去重复

This commit is contained in:
CaptainB 2022-03-14 13:48:43 +08:00 committed by 刘瑞斌
parent f0d9e46699
commit 5c2be79342
1 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ export function findThreadGroup(jmxContent, handler) {
let threadGroups = [], relateFiles = []; let threadGroups = [], relateFiles = [];
travel(jmxJson.elements, threadGroups, relateFiles); travel(jmxJson.elements, threadGroups, relateFiles);
let csvFiles = []; let csvFiles = new Set;
relateFiles.forEach(f => { relateFiles.forEach(f => {
if (f.attributes.enabled === 'false') { if (f.attributes.enabled === 'false') {
return; return;
@ -46,7 +46,7 @@ export function findThreadGroup(jmxContent, handler) {
let split = filename.split('/'); let split = filename.split('/');
filename = split[split.length - 1]; filename = split[split.length - 1];
} }
csvFiles.push(filename); csvFiles.add(filename);
} }
}); });
}); });
@ -61,7 +61,7 @@ export function findThreadGroup(jmxContent, handler) {
tg.handler = handler; tg.handler = handler;
tg.enabled = tg.attributes.enabled; tg.enabled = tg.attributes.enabled;
tg.tgType = tg.name; tg.tgType = tg.name;
tg.csvFiles = csvFiles; tg.csvFiles = [...csvFiles];
tg.strategy = 'auto'; tg.strategy = 'auto';
tg.resourceNodeIndex = 0; tg.resourceNodeIndex = 0;
tg.ratios = ''; tg.ratios = '';