Jmeter + InfluxDB:缺少响应代码
Jmeter + InfluxDB: Response Codes are missing
我安装了 InfluxDB v1.7.9,我的 Jmeter v5.2 通过默认的后端监听器 (org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender) 正确地向它发送数据。我在查询数据库时可以看到数据。
样本在这里:
time application avg count countError endedT hit max maxAT meanAT min minAT pct10.0 pct90.0 pct95.0 pct99.0 rb responseCode responseMessage sb startedT statut transaction
---- ----------- --- ----- ---------- ------ --- --- ----- ------ --- ----- ------- ------- ------- ------- -- ------------ --------------- -- -------- ------ -----------
1579001235935000000 grafanapoc-14-01-2020-1126 0 0 0 0 0 internal
1579001240085000000 grafanapoc-14-01-2020-1126 0 0 0 0 11 internal
1579001245091000000 grafanapoc-14-01-2020-1126 586.3529411764706 17 0 195 1177 197 246.6 1126.6 1177 1177 6302301 64159 all all
1579001245098000000 grafanapoc-14-01-2020-1126 197 1 197 197 197 197 197 197 10470 633 all GET - Page
1579001245100000000 grafanapoc-14-01-2020-1126 197 1 197 197 197 197 197 197 ok GET - Page
1579001245102000000 grafanapoc-14-01-2020-1126 259 1 259 259 259 259 259 259 9827 643 all GET - Privacy
1579001245102000000 grafanapoc-14-01-2020-1126 259 1 259 259 259 259 259 259 ok GET - Privacy
1579001245104000000 grafanapoc-14-01-2020-1126 710.8333333333334 12 1177 434 452.6 1158.1000000000001 1177 1177 6168994 56448 all GET - Homepage
1579001245106000000 grafanapoc-14-01-2020-1126 710.8333333333334 12 1177 434 452.6 1158.1000000000001 1177 1177 ok GET - Homepage
1579001245107000000 grafanapoc-14-01-2020-1126 327.3333333333333 3 387 273 273 387 387 387 ok GET - Contact
1579001245107000000 grafanapoc-14-01-2020-1126 327.3333333333333 3 387 273 273 387 387 387 113010 6435 all GET - Contact
1579001245109000000 grafanapoc-14-01-2020-1126 0 23 18 12 23 internal
1579001250083000000 grafanapoc-14-01-2020-1126 411.16666666666674 25 0 197 1177 143 179 712.0000000000001 1059.7000000000005 1177 5350040 69699 all all
但是,正如您从该示例中看到的那样,'responseCode' 列是空的,仅在发生错误(500、404、非 HTTP 响应代码等)时显示数据。
我有兴趣记录所有的响应代码,而不仅仅是错误。
我试图修改 jmeter.properties 文件默认值,但没有成功。任何人都可以帮助我确定未解析成功请求的响应代码的原因吗?
根据JMeter 5.2 response code and message are stored only for failed samplers:
private void addErrorMetric(String transaction, ErrorMetric err, long count) {
//
tag.append(TAG_RESPONSE_CODE).append(AbstractInfluxdbMetricsSender.tagToStringValue(err.getResponseCode()));
tag.append(TAG_RESPONSE_MESSAGE).append(AbstractInfluxdbMetricsSender.tagToStringValue(err.getResponseMessage()));
//
很遗憾,这不是您可以通过 JMeter Properties, if you want to change this behaviour you need to amend InfluxdbBackendListenerClient and rebuild JMeter from source code
控制的
我安装了 InfluxDB v1.7.9,我的 Jmeter v5.2 通过默认的后端监听器 (org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender) 正确地向它发送数据。我在查询数据库时可以看到数据。 样本在这里:
time application avg count countError endedT hit max maxAT meanAT min minAT pct10.0 pct90.0 pct95.0 pct99.0 rb responseCode responseMessage sb startedT statut transaction
---- ----------- --- ----- ---------- ------ --- --- ----- ------ --- ----- ------- ------- ------- ------- -- ------------ --------------- -- -------- ------ -----------
1579001235935000000 grafanapoc-14-01-2020-1126 0 0 0 0 0 internal
1579001240085000000 grafanapoc-14-01-2020-1126 0 0 0 0 11 internal
1579001245091000000 grafanapoc-14-01-2020-1126 586.3529411764706 17 0 195 1177 197 246.6 1126.6 1177 1177 6302301 64159 all all
1579001245098000000 grafanapoc-14-01-2020-1126 197 1 197 197 197 197 197 197 10470 633 all GET - Page
1579001245100000000 grafanapoc-14-01-2020-1126 197 1 197 197 197 197 197 197 ok GET - Page
1579001245102000000 grafanapoc-14-01-2020-1126 259 1 259 259 259 259 259 259 9827 643 all GET - Privacy
1579001245102000000 grafanapoc-14-01-2020-1126 259 1 259 259 259 259 259 259 ok GET - Privacy
1579001245104000000 grafanapoc-14-01-2020-1126 710.8333333333334 12 1177 434 452.6 1158.1000000000001 1177 1177 6168994 56448 all GET - Homepage
1579001245106000000 grafanapoc-14-01-2020-1126 710.8333333333334 12 1177 434 452.6 1158.1000000000001 1177 1177 ok GET - Homepage
1579001245107000000 grafanapoc-14-01-2020-1126 327.3333333333333 3 387 273 273 387 387 387 ok GET - Contact
1579001245107000000 grafanapoc-14-01-2020-1126 327.3333333333333 3 387 273 273 387 387 387 113010 6435 all GET - Contact
1579001245109000000 grafanapoc-14-01-2020-1126 0 23 18 12 23 internal
1579001250083000000 grafanapoc-14-01-2020-1126 411.16666666666674 25 0 197 1177 143 179 712.0000000000001 1059.7000000000005 1177 5350040 69699 all all
但是,正如您从该示例中看到的那样,'responseCode' 列是空的,仅在发生错误(500、404、非 HTTP 响应代码等)时显示数据。 我有兴趣记录所有的响应代码,而不仅仅是错误。
我试图修改 jmeter.properties 文件默认值,但没有成功。任何人都可以帮助我确定未解析成功请求的响应代码的原因吗?
根据JMeter 5.2 response code and message are stored only for failed samplers:
private void addErrorMetric(String transaction, ErrorMetric err, long count) {
//
tag.append(TAG_RESPONSE_CODE).append(AbstractInfluxdbMetricsSender.tagToStringValue(err.getResponseCode()));
tag.append(TAG_RESPONSE_MESSAGE).append(AbstractInfluxdbMetricsSender.tagToStringValue(err.getResponseMessage()));
//
很遗憾,这不是您可以通过 JMeter Properties, if you want to change this behaviour you need to amend InfluxdbBackendListenerClient and rebuild JMeter from source code
控制的