[GitHub] jmeter pull request #434: Truncate response message to avoid too large udp p...

2018-11-24 Thread FSchumacher
Github user FSchumacher commented on a diff in the pull request:

https://github.com/apache/jmeter/pull/434#discussion_r236044166
  
--- Diff: 
src/components/org/apache/jmeter/visualizers/backend/influxdb/InfluxdbBackendListenerClient.java
 ---
@@ -196,12 +196,18 @@ private void addMetrics(String transaction, 
SamplerMetric metric) {
 }
 
 private void addErrorMetric(String transaction, String responseCode, 
String responseMessage, long count) {
+final int MAX_RES_CODE_LENGTH_FOR_UDP = 50;
--- End diff --

The rounding should probably done in a different pull request and it should 
probably take the magnitude of the number into account. That is the method 
taken by HdrHistogram as suggested to use in #380.


---


[GitHub] jmeter pull request #434: Truncate response message to avoid too large udp p...

2018-11-24 Thread mybreeze77
Github user mybreeze77 commented on a diff in the pull request:

https://github.com/apache/jmeter/pull/434#discussion_r236041964
  
--- Diff: 
src/components/org/apache/jmeter/visualizers/backend/influxdb/InfluxdbBackendListenerClient.java
 ---
@@ -196,12 +196,18 @@ private void addMetrics(String transaction, 
SamplerMetric metric) {
 }
 
 private void addErrorMetric(String transaction, String responseCode, 
String responseMessage, long count) {
+final int MAX_RES_CODE_LENGTH_FOR_UDP = 50;
--- End diff --

I think so. If we can shorten the precision of doubles (like avg, min, max, 
pct) to 2 or 3 digits, that will help save about 200 bytes. I can provide an 
implementation if consensus reached. What do you think?


---


[GitHub] jmeter pull request #434: Truncate response message to avoid too large udp p...

2018-11-24 Thread FSchumacher
Github user FSchumacher commented on a diff in the pull request:

https://github.com/apache/jmeter/pull/434#discussion_r236039975
  
--- Diff: 
src/components/org/apache/jmeter/visualizers/backend/influxdb/InfluxdbBackendListenerClient.java
 ---
@@ -196,12 +196,18 @@ private void addMetrics(String transaction, 
SamplerMetric metric) {
 }
 
 private void addErrorMetric(String transaction, String responseCode, 
String responseMessage, long count) {
+final int MAX_RES_CODE_LENGTH_FOR_UDP = 50;
--- End diff --

We seem to waste a lot of characters with the number conversion of the 
percentage values. They seem to be exact to about two digits behind the comma, 
but are written out to much more. Maybe we could use a better 
formatting/rounding there, too?


---


[GitHub] jmeter pull request #434: Truncate response message to avoid too large udp p...

2018-11-23 Thread mybreeze77
Github user mybreeze77 commented on a diff in the pull request:

https://github.com/apache/jmeter/pull/434#discussion_r235965931
  
--- Diff: 
src/components/org/apache/jmeter/visualizers/backend/influxdb/InfluxdbBackendListenerClient.java
 ---
@@ -196,12 +196,18 @@ private void addMetrics(String transaction, 
SamplerMetric metric) {
 }
 
 private void addErrorMetric(String transaction, String responseCode, 
String responseMessage, long count) {
+final int MAX_RES_CODE_LENGTH_FOR_UDP = 50;
--- End diff --







Yes, I agree it is a property which is better to be decided by users. 
Actually 50 is a kind of empirical value. 

More details said, as we can see below example, "count", "countError", 
"hit", etc. are integers with 4 bytes. "pct95.0", "pct99.0", etc. are doubles 
with 8 bytes. But as they will be converted to String in influx line protocal, 
they actually take about 10 bytes and 20 bytes respectively. Without response 
message, the data sent to influxdb as udp will be about 1350 bytes at most. 

```
jmeter,application=application,transaction=all,statut=all 
count=304,countError=304,hit=304,sb=39216,rb=106688,pct95.0=13.0,pct99.0=16.9699985,pct90.0=12.906
 154295971070800 -- 300 bytes at most

jmeter,application=application,statut=all,transaction=HTTP\ Request 
count=304,avg=8.8,min=6.0,max=17.0,sb=39216,rb=106688,pct95.0=13.0,pct99.0=16.9699985,pct90.0=12.906
 154295971070900 -- 300 bytes at most

jmeter,application=application,statut=ko,transaction=HTTP\ Request 
count=304,avg=8.8,min=6.0,max=17.0,pct95.0=13.0,pct99.0=16.9699985,pct90.0=12.906
 154295971071000 -- 300 bytes at most

jmeter,application=application,transaction=HTTP\ 
Request,responseCode=404,responseMessage=Very 
llong mmessage count=304 
154295971071000 -- 300 bytes at most without response message

jmeter,application=application,transaction=internal 
minAT=1,maxAT=1,meanAT=1,startedT=1,endedT=0 154295971071000 -- 150 bytes 
at most
```

So for the size of response message, any value lower than 1500 - 1350 = 150 
will be safe. That's the reason we set it 50. Hope it clear.


---


[GitHub] jmeter pull request #434: Truncate response message to avoid too large udp p...

2018-11-23 Thread pmouawad
Github user pmouawad commented on a diff in the pull request:

https://github.com/apache/jmeter/pull/434#discussion_r235892281
  
--- Diff: 
src/components/org/apache/jmeter/visualizers/backend/influxdb/InfluxdbBackendListenerClient.java
 ---
@@ -196,12 +196,18 @@ private void addMetrics(String transaction, 
SamplerMetric metric) {
 }
 
 private void addErrorMetric(String transaction, String responseCode, 
String responseMessage, long count) {
+final int MAX_RES_CODE_LENGTH_FOR_UDP = 50;
--- End diff --

I think this should be a property.
Can you point me to the reference that mentions 50 ?

Thank you


---


[GitHub] jmeter pull request #434: Truncate response message to avoid too large udp p...

2018-11-23 Thread mybreeze77
GitHub user mybreeze77 opened a pull request:

https://github.com/apache/jmeter/pull/434

Truncate response message to avoid too large udp package using 
UdpMetricsSender

In JMeter, we can use "BackendListener - InfluxdbBackendListenerClient - 
UdpMetricsSender" to send data as udp to InfluxDB. As we know, UDP package max 
size is limited to the MTU (about 1500 bytes). So if is possible to exceed it, 
for below example.

`
jmeter,application=application,transaction=all,statut=all 
count=304,countError=304,hit=304,sb=39216,rb=106688,pct95.0=13.0,pct99.0=16.9699985,pct90.0=12.906
 154295971070800
jmeter,application=application,statut=all,transaction=HTTP\ Request 
count=304,avg=8.8,min=6.0,max=17.0,sb=39216,rb=106688,pct95.0=13.0,pct99.0=16.9699985,pct90.0=12.906
 154295971070900
jmeter,application=application,statut=ko,transaction=HTTP\ Request 
count=304,avg=8.8,min=6.0,max=17.0,pct95.0=13.0,pct99.0=16.9699985,pct90.0=12.906
 154295971071000
jmeter,application=application,transaction=HTTP\ 
Request,responseCode=404,responseMessage=Very 
llong mmessage count=304 
154295971071000
jmeter,application=application,transaction=internal 
minAT=1,maxAT=1,meanAT=1,startedT=1,endedT=0 154295971071000
`

We will get below error and data are not sent to InfluxDB.

> 2018-09-28 23:53:29,743 ERROR o.a.j.v.b.i.UdpMetricsSender: Error in 
transferring udp package
> java.io.IOException: Message too long

Considering the size of other fields/tags are under control, it will be 
better if we truncate the response message to about 50 bytes when it is too 
large (Only for udp sender). 

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/mybreeze77/jmeter fixudp

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/jmeter/pull/434.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #434


commit 1ba4b514714c3466fd90c435bf8bec922494a27e
Author: Junlong Wu 
Date:   2018-11-23T09:24:35Z

Truncate response message to avoid too large udp package using 
UdpMetricsSender




---