JMeter - Java HTTP Client implementation show 0 connect time and sent bytes - jmeter

I wonder about the differences I found regarding HTTP Client implementation,
There's options to choose HTTPClient 4 or Java
But for a simple case (www.google.com) Java implementation always show 0 in connect time and sent bytes Sampler results:
Connect Time: 0
Sent bytes:0
While HTTPClient 4 return different values each time as:
Connect Time: 100
Sent bytes:117
Request body is the same
GET http://www.google.com/
GET data:
[no cookies]
But Request Header differ while HttpClient sends also Host and User-Agent
Connection: keep-alive
Host: www.google.com
User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_25)
Is there a valid reason for these differences?
EDIT
Just to make it more confusing, when choosing empty implementation (should use default) the connect time is always 0 but Sent bytes is never 0
Connect Time: 0
Sent bytes:117

Java and HttpClient are 2 different implementations that can be used by HTTP Request.
The java one is less rich than hc4 and for example it does not implement :
sent bytes metric computation
connection time metric
kerberos authentication
There are also other features missing in Java implementation.
When you select empty, the value in property «jmeter.httpsampler »  is used, by default it’s hc4.

Related

Error in Running Multiple Threads with JPOS on JMeter for ISO8583

I am Trying to run My IS08583 Script for Multiple Users using JPOS Plugin. However i could find below Output in the Sampler Result. Can anyone suggest what settings needs to be changed in JPOS for running my Script on Multiple users without this Error. Currently i am running only 2 Threads, in which one thread gives successful Output and Other gives error as mentioned below..
Thread Name: GBM_Transaction
Sample Start: 2020-08-24 15:45:13 IST
Load time: 1
Connect Time: 0
Latency: 0
Size in bytes: 0
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code:
Response message: org.jpos.iso.ISOException: Duplicate key 'jmeter-2d8b3043-send.120000003938777.req' detected
SampleResult fields:
ContentType:
DataEncoding: null
When sending and receiving multiple request and response messages over the same socket connection,
jPOS needs to match responses (as they may come in in a different order) to requests.
It does that based on keys it generates for each message, e.g. jmeter-2d8b3043-send.120000003938777.req.
The part 120000003938777 is generated (by default) from the fields MTI (1200), DE41 and DE11 (00003 and 938777 presumably).
If your script does not vary those fields e.g. randomly, as suggested, the same key will be generated
for multiple messages and you get that error when jPOS detects the duplicate key.
Obviously, this makes it impossible to unambiguously match responses to requests.
What you can do is:
vary the fields DE41 and/or DE11, or
in case your messages do not contain those fields, define different keys in the "ISO8583 Connection Configuration" under "Mux Key Configuration" and vary those.
The JMeter functions ${__time()} and ${__RandomString()} are quite useful for that.
Refer also https://github.com/jpos/jPOS/blob/master/doc/src/asciidoc/ch08/qmux.adoc#mti-mapping-and-default-key.
Disclaimer: I am the author of the JMeter ISO8583 plugin.

Smallest size of message in gRPC

I need to find out what is the average size of request in gRPC when Im sending a string to server and receiving a string from server?
I read somewhere it should be around 20 Bytes but what I see in Network Monitor app is that the request is above 500 Bytes. So is it the smallest possible size of a gRPC message size or what?
For a single rpc, gRPC needs to do a few things:
Establish HTTP/2
(Optional) Establish TLS
Exchange headers for the RPCs (size depends on schema)
Exchange actual RPC messages (size depends on schema)
Close connection
gRPC is meant to be used for many RPCs on a single connection so the smallest possible rpc message is really the bytes used for 4.
[Edit]
I checked and the minimum data exchanged for an rpc is over 500 bytes, in terms of raw IP packets.
I used the gRPC helloworld.proto, changed to send an int32.
Inspecting packets in Wireshark showed the following IP packet totals:
1286 bytes to establish connection, exchange headers and do the first rpc
564 bytes for each subsequent rpc
176 bytes for client Shutdown
Of those 546 "minimum" bytes:
67% was TCP/IP overhead (acknowledgements, packet headers)
10% was "trailer" data sent after the rpc

jmeter showing error when HTTP request is made

I am totally new to JMeter, when I tried to test a website.
The test result was like this
Thread Name: Thread Group 1-1
Sample Start: 2018-06-19 10:18:49 IST
Load time: 0
Connect Time: 0
Latency: 0
Size in bytes: 1176
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 1176
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.URISyntaxException
Response message: Non HTTP response message: Expected closing bracket for IPv6
What might be the issue?
Looks like improper HTTP Request sampler configuration, for instance you put some not supported character into "Server Name or IP" field. Well-behaved request should look like:
Another option is placing the full URL into "Path" field like
However the best option will be just recording your test scenario using JMeter's HTTP(S) Test Script Recorder, this way JMeter will generate appropriate HTTP Request samplers which you will be able to replay with increased number of threads. See Apache JMeter proxy Step-by-step guide for comprehensive instructions.
Alternatively you can use JMeter Chrome Extension - in this case you will not have to set up proxies and worry about SSL certificates.

Firefox ignoring response header content-range and playing only the sample sent

I have built an audio stream for mp3 files, and each time client hits the audio it receives something like this:
But what it does is just plays 1 minute sample instead of 120 minute
What am I doing wrong here?
Not 100% sure because you didn't provide code or an example stream to test, but your handling of HTTP range requests is broken.
In your example request, the client sends Range: bytes=0-, and your server responds with a 1MiB response:
Content-Length: 1048576 (aka. 1 MiB)
Content-Range: 0-1048575/...
This is wrong, the client did not request this! It did request bytes=0-, meaning all data from position 0 to the end of the entire stream (See the http 1.1 RFC), i.e. a response equal to one without any Range. (IIRC, Firefox still sends the Range: bytes=0- to detect if the Server handles ranges in the first place).
This, combined with the Content-Length, leads the client (Firefox) to think the whole resource is just 1MiB in size, instead of the real size. I'd imagine the first 1 MiB of your test stream comes out as 1:06 of audio.
PS: The Content-Duration header (aka. RFC 3803) is something browsers don't usually implement at all and just ignore.
Just an idea. Did you tried some of the http 3xx header like:
'308 Resume Incomplete' or '503 Service Temporarily Unavailable' plus 'retry-after:2' or '413 Request Entity Too Large' plus 'retry-after:2'

jmeter response code 204 and can't get content

I am doing a websocket stress test through jmeter2.9.
When I send a request and response with a "light" json. the result is ok.
But when the response json contains a base64 png(about 360kb) . jmeter return code 204 No content (probably timeout).
Is my jmeter need some config here, or something else wrong.
If someone know something about this please teach me.
complete info:
Thread Name: threadgroup 1-1
Sample Start: 2013-07-17 15:36:06 CST
Load time: 20000
Latency: 0
Size in bytes: 0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Response code: 204
Response message: No content (probably timeout).
Response headers:
SampleResult fields:
ContentType:
DataEncoding:
Check if you are using Cache manager, there seems to be a (bug) in Jmeter that sets the response code to HTTP Code '204' ("No Response") while, there is no outgoing request, the information is retrieved from the Cache, try disabling cache manager and lets see if you can reproduce it then.
This could be because of the unhandled exception, response being larger than the maximum message size specified in the plugin code, etc. The exception which you see will be thrown if no response has been received from the server after predefined timeout.
Here is another WebSocket plugin for JMeter which might work for you
Link: https://github.com/maciejzaleski/JMeter
Features:
Supports HTTS/HTTPS (ws/wss) version of the WebSocket protocol
Option to ignore SSL certificate errors
Streaming allows for a single connection to remain open for the duration of the test
Response has to match predefined regular expression
Response timeout
Response message back log (build the Sampler response from multiple server messages)
Connection could be closed if server sends a mesage matching predefined regular expression

Resources