我正在尝试创建一个Kusto查询来比较两个Jmeter结果,我已经有了这个查询,它显示了1个测试的结果,但我不知道如何添加另一个查询并将结果保存。
随附查询和图片以供参考。
有人可以帮助我完成查询吗?
let testName = "jmeter";
let TestStartTime = "{Startime}";
requests
| where name == testName
and customDimensions.TestStartTime == TestStartTime
| summarize
Samples = count(),
Average = tolong(avg(duration)),
(L50, L90, L95, L99)
= percentiles(duration, 50, 90, 95, 99),
Min = min(duration),
Maximum = max(duration),
ErrorCount = countif(success == false),
StartTime = min(tolong(customDimensions.SampleStartTime)),
EndTime = max(tolong(customDimensions.SampleEndTime))
by Label = tostring(customDimensions.SampleLabel)
| extend s = 0
| union (
requests
| where name == testName
and customDimensions.TestStartTime == TestStartTime
| summarize
Samples = count(),
Average = tolong(avg(duration)),
(L50, L90, L95, L99)
= percentiles(duration, 50, 90, 95, 99),
Min = min(duration),
Maximum = max(duration),
ErrorCount = countif(success == false),
StartTime = min(tolong(customDimensions.SampleStartTime)),
EndTime = max(tolong(customDimensions.SampleEndTime))
| extend Label = 'TOTAL', s = 9
)
| extend
tp = Samples / ((EndTime - StartTime) / 1000.0),
KBPeriod = (EndTime - StartTime) * 1024 / 1000.0
| sort by s asc
| project
Label, Samples, Average,
Median = round(L50),
['90% Line'] = round(L90),
['95% Line'] = round(L95),
['99% Line'] = round(L99),
Min, Maximum,
['Error %'] = strcat(round(ErrorCount * 100.0 / Samples, 2), '%'),
['Throughput'] = iif(tp < 1.0,
strcat(round(tp * 60, 1), '/min'),
strcat(round(tp, 1), '/sec')
)
| project-reorder
Label, Samples, Average,
['Median'], ['90% Line'], ['95% Line'], ['99% Line'],
Min, Maximum, ['Error %'], ['Throughput']
2条答案
按热度按时间7gcisfzg1#
为了能够“比较”,你需要以某种方式区分2个不同的运行,我看不到任何指标,你可以使用。
因此,最简单的选择是首先运行Merge Results Tool,它将创建一个aggregate .jtl结果文件,然后使用KQL解析它。
可以使用JMeter Plugins Manager安装合并结果工具
ej83mcc02#
我解决了这个问题,下面是比较结果的脚本
希望这对你有帮助
Script