从Jmeter jtl日志文件计算吞吐量 [英] Calculating throughput from Jmeter jtl log file

查看:580
本文介绍了从Jmeter jtl日志文件计算吞吐量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图根据以下参数得出一个公式,该公式基于jtl日志中的某些属性来计算吞吐量(请求数/时间单位):

I was trying to come out with a formula to calculate the throughput (number requests/time unit) based on some properties from the jtl log based on the following parameters:

  • 时间戳(ts)
  • 时间(t)
  • 请求总数

看看时间戳记,我不确定是指请求发送或接收响应的时间(这里我的主要困惑).看一下这些值,第一种选择似乎更有可能.因此假设如此,我得出以下结论:

Taking a look at the timestamps I was not completely sure if it refers to the time when the request was sent or when it received the response (my main point of confusion here). Taking a look at the values the first options seems more likely. So assuming this, I've come out with the following:

Throughput = (NumRequests / (max(ts + t) - min(ts)) ) * 1000

有人可以告诉我我是否正确吗?

Can anyone tell me if I'm right with this?

更新(感谢@BlackGaff的回复)

重点是我需要在非GUI环境中执行测试并为一些自动化流程收集结果,因此我不能真正使用Aggregate Report(除非有一种方法可以从命令中运行它)线).使用max& min是尝试从一组请求中找到ts值的尝试(在同一测试中).另外,如果我将采样器配置为具有一个不等于0的上升周期(因此负载是分布式的),则我得到的ts的数字是不同的.是的,正如您之前已经提到的,我正在有效地寻找第一个样本的startTime和最后一个样本的endTime之间的差异.除此之外,我在jmeter.properties中找到了一个参数:

The point is that I need to execute my tests and gather the results in a non-gui environment for some automated processes, so I can't really use the Aggregate Report (unless there is a way to run it from the command line). The use of max & min is an attempt to find the ts values from a set of requests (within the same test). Also, if I configure the samplers to have a ramp up period different than 0 (so the load is distributed), the numbers I get for ts are different. And yes, as you already mentioned before, I'm effectively looking for the difference between startTime of the first sample and endTime of the last sample. Apart from that I found a parameter in jmeter.properties:

# Put the start time stamp in logs instead of the end
#sampleresult.timestamp.start=true

因此,根据该参数,我似乎还应该更改计算以获取开始时间和结束时间.

So depending on this parameter it seems I should also change the calculation to get the start and end times.

注意:我很好奇如何基于jtl文件进行计算,但是如果有人需要从命令行获取这些数字,请尝试添加"Generate Summary Report"侦听器,并在jmeter日志中获得一个在执行结束时,类似于以下内容的行:

NOTE: I'm curious about how to calculate this based on the jtl file but if anyone needs to get these numbers from the command line try adding the "Generate Summary Report" listener, and in the jmeter logs you will get a line similar to the following at the end of the execution:

2011/03/10 22:31:42 INFO  - jmeter.reporters.Summariser: Generate Summary Results =   200 in   9.8s =   20.5/s Avg:    95 Min:    75 Max:   315 Err:     0 (0.00%)

推荐答案

在Jmeter的聚合"报告中打开JTL日志可能会更容易,它将为您计算吞吐量,然后将其保存回去?

Might it be easier to open the JTL log in Jmeter's Aggregate report, which will calculate the Throughput for you, and then save it back out?

但是,关于这个问题.

当前,您的公式具有时间单位/请求.给定您想要的请求/时间,您的公式应为:

Currently, your formula has units of time / requests. Given you want requests/time, you the formula should read:

Throughput = (NumRequests / (max(ts + t) - min(ts) ) ) * 1000

我不确定您为什么要使用max和min,因为您只提供一个值,而这些函数从一组值中返回max/min.鉴于TS是相同的值,使用EXCEL,您最终得到:

I'm not entirely sure why you're using max and min, since you're only providing one value and those functions return the max/min from a set. Given that TS is the same value, using EXCEL, you end up with:

Throughput = (NumRequests/t*1000)

我相信您真正想要的是第一个样本的startTime与最后一个样本的endTime之间的差异)

I believe what you really want is the difference between startTime of the first sample and endTime of the last sample)

根据词汇表:

通过量计算为 请求/时间单位.现在的时间是 从第一个开始算起 采样到最后一个采样的末尾. 这包括之间的任何间隔 样品,因为它应该 代表服务器上的负载.这 公式为:吞吐量=( 请求)/(总时间).

Throughput is calculated as requests/unit of time. The time is calculated from the start of the first sample to the end of the last sample. This includes any intervals between samples, as it is supposed to represent the load on the server. The formula is: Throughput = (number of requests) / (total time).

给出最终公式:

endTime = lastSampleStartTime + lastSampleLoadTime
startTime = firstSampleStartTime
converstion = unit time conversion value

Throughput = Numrequests / ((endTime - startTime)*conversion)

这篇关于从Jmeter jtl日志文件计算吞吐量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆