Discussion:
Migration to HC4/HC5 last version
Philippe Mouawad
2017-10-09 21:19:12 UTC
Permalink
Hello,
Within JMeter projet I am working on migration fully to last APIs of
HttpClient:

- https://bz.apache.org/bugzilla/show_bug.cgi?id=58757

You can see current code here:

- https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION

I have nearly completed the work except for 2 remaining items:

- Virtual Host:
- I don't see this parameter in newer interfaces
-
https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117


- "Slow " connection feature:
- This feature allows to simulate slow connection. Currently we wrap
Input/Output stream returned by socket with
SlowInputStream/SlowOutputStream
-
https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
-
https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322
-
https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892
- It is not clear for me how this feature should be implemented:
- Should we adapt SSLSocket and Socket with a Slow feature ?


Hope you can help by pointing me to the components.

Thanks

Regards

Philippe M.

@philmdot
Philippe Mouawad
2017-10-11 18:55:27 UTC
Permalink
Hello Team,
Pinging again in case somebody can help.
Regards
Post by Philippe Mouawad
Hello,
Within JMeter projet I am working on migration fully to last APIs of
- https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
- https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
- I don't see this parameter in newer interfaces
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L1117
<https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117>
- This feature allows to simulate slow connection. Currently we
wrap Input/Output stream returned by socket with SlowInputStream/
SlowOutputStream
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/util/
SlowHC4SocketFactory.java
<https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java>
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L322
<https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L892
<https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
- Should we adapt SSLSocket and Socket with a Slow feature ?
Hope you can help by pointing me to the components.
Thanks
Regards
Philippe M.
@philmdot
Philippe Mouawad
2017-10-12 08:33:46 UTC
Permalink
Thanks for your help Aleksei
So 1 question remains for me:

- "Slow " connection feature:
- This feature allows to simulate slow connection. Currently we wrap
Input/Output stream returned by socket with SlowInputStream/
SlowOutputStream
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/util/
SlowHC4SocketFactory.java
<https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java>
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L322
<https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L892
<https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
- It is not clear for me how this feature should be implemented:
- Should we adapt SSLSocket and Socket with a Slow feature ?


Regards
Hello Philippe Mouawad,
I think the idea of getting rid of virtual host is to simplify the
object design.
Virtual host functionality can be reduced to simple setting of the
"Host" header in http request.
You can see the example of virtual host implementation for httpclient 5.0
here
https://github.com/abalanonline/httpclient4to5
Aleksei Balan
Post by Philippe Mouawad
Hello Team,
Pinging again in case somebody can help.
Regards
Post by Philippe Mouawad
Hello,
Within JMeter projet I am working on migration fully to last APIs of
- https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
- https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
- I don't see this parameter in newer interfaces
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L1117
<https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L1117>
Post by Philippe Mouawad
Post by Philippe Mouawad
- This feature allows to simulate slow connection. Currently we
wrap Input/Output stream returned by socket with SlowInputStream/
SlowOutputStream
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/util/
SlowHC4SocketFactory.java
<https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/util/
SlowHC4SocketFactory.java>
Post by Philippe Mouawad
Post by Philippe Mouawad
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L322
<https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L322>
Post by Philippe Mouawad
Post by Philippe Mouawad
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L892
<https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L892>
Post by Philippe Mouawad
Post by Philippe Mouawad
- Should we adapt SSLSocket and Socket with a Slow feature ?
Hope you can help by pointing me to the components.
Thanks
Regards
Philippe M.
@philmdot
--
Cordialement.
Philippe Mouawad.
Oleg Kalnichevski
2017-10-12 08:50:47 UTC
Permalink
Post by Philippe Mouawad
Hello Team,
Pinging again in case somebody can help.
Regards
My apologies, Philippe

I was (still am) buried under with work related and personal issues.

Oleg
Post by Philippe Mouawad
g>
Post by Philippe Mouawad
Hello,
Within JMeter projet I am working on migration fully to last APIs of
   - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
   - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
      - I don't see this parameter in newer interfaces
         - https://github.com/apache/jmeter/blob/trunk/src/
         protocol/http/org/apache/jmeter/protocol/http/sampler/
         HTTPHC4Impl.java#L1117
         <https://github.com/apache/jmeter/blob/trunk/src/protocol/
http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117
      - This feature allows to simulate slow connection. Currently
we
      wrap Input/Output stream returned by socket with
SlowInputStream/
      SlowOutputStream
      - https://github.com/apache/jmeter/blob/trunk/src/
         protocol/http/org/apache/jmeter/protocol/http/util/
         SlowHC4SocketFactory.java
         <https://github.com/apache/jmeter/blob/trunk/src/protocol/
http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
         - https://github.com/apache/jmeter/blob/trunk/src/
         protocol/http/org/apache/jmeter/protocol/http/sampler/
         HTTPHC4Impl.java#L322
         <https://github.com/apache/jmeter/blob/trunk/src/protocol/
http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
         - https://github.com/apache/jmeter/blob/trunk/src/
         protocol/http/org/apache/jmeter/protocol/http/sampler/
         HTTPHC4Impl.java#L892
         <https://github.com/apache/jmeter/blob/trunk/src/protocol/
http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
      - It is not clear for me how this feature should be
         - Should we adapt SSLSocket and Socket with a Slow feature
?
Hope you can help by pointing me to the components.
Thanks
Regards
Philippe M.
@philmdot
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-***@hc.apache.org
For additional commands, e-mail: httpclient-users-***@hc.apache.org
Philippe Mouawad
2017-10-12 14:03:59 UTC
Permalink
No problem Oleg, answering after 2 days is pretty acceptable and you're
doing this on your personal time so I have nothing to say.

I hope you'll handle your personal and work issues and be in a better state
, good luck
Post by Oleg Kalnichevski
Post by Philippe Mouawad
Hello Team,
Pinging again in case somebody can help.
Regards
My apologies, Philippe
I was (still am) buried under with work related and personal issues.
Oleg
Post by Philippe Mouawad
g>
Post by Philippe Mouawad
Hello,
Within JMeter projet I am working on migration fully to last APIs of
- https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
- https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
- I don't see this parameter in newer interfaces
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L1117
<https://github.com/apache/jmeter/blob/trunk/src/protocol/
http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117
- This feature allows to simulate slow connection. Currently we
wrap Input/Output stream returned by socket with
SlowInputStream/
SlowOutputStream
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/util/
SlowHC4SocketFactory.java
<https://github.com/apache/jmeter/blob/trunk/src/protocol/
http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L322
<https://github.com/apache/jmeter/blob/trunk/src/protocol/
http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
- https://github.com/apache/jmeter/blob/trunk/src/
protocol/http/org/apache/jmeter/protocol/http/sampler/
HTTPHC4Impl.java#L892
<https://github.com/apache/jmeter/blob/trunk/src/protocol/
http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
- It is not clear for me how this feature should be
- Should we adapt SSLSocket and Socket with a Slow feature ?
Hope you can help by pointing me to the components.
Thanks
Regards
Philippe M.
@philmdot
--
Cordialement.
Philippe Mouawad.
Oleg Kalnichevski
2017-10-12 08:48:19 UTC
Permalink
Post by Philippe Mouawad
Hello,
Within JMeter projet I am working on migration fully to last APIs of
   - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
   - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
      - I don't see this parameter in newer interfaces
         -
         https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117
The virtual parameter in HC 4.x was a left-over from HC 3.x. It should
have never been introduced in the first place.

Please consider executing requests with an explicit target HttpHost and
a 'virtual' host in the request URI.

https://github.com/apache/httpcomponents-client/blob/master/httpclient5
/src/main/java/org/apache/hc/client5/http/classic/HttpClient.java#L95

HttpHost should represent a physical host, whereas request URI may
contain any arbitrary host name.

---
HttpHost target = new HttpHost("www.google.com");
HttpGet httpGet = new HttpGet("http://google.ru/");
CloseableHttpResponse response = client.execute(target, httpGet);
---
Post by Philippe Mouawad
      - This feature allows to simulate slow connection. Currently we
wrap
      Input/Output stream returned by socket with
SlowInputStream/SlowOutputStream
      -
         https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
p/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
         -
         https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322
         -
         https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892
      - It is not clear for me how this feature should be
         - Should we adapt SSLSocket and Socket with a Slow feature ?
Hope you can help by pointing me to the components.
I think all you need to do is to extend PlainConnectionSocketFactory or
provide a custom one and return a 'slow' socket from #createSocket
method.

https://github.com/apache/httpcomponents-client/blob/master/httpclient5
/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketF
actory.java

Hope this helps

Oleg
Post by Philippe Mouawad
Thanks
Regards
Philippe M.
@philmdot
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-***@hc.apache.org
For additional commands, e-mail: httpclient-users-***@hc.apache.org
Gary Gregory
2017-10-12 17:40:19 UTC
Permalink
Post by Philippe Mouawad
Hello,
Within JMeter projet I am working on migration fully to last APIs of
- https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
- https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
- I don't see this parameter in newer interfaces
-
https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117
The virtual parameter in HC 4.x was a left-over from HC 3.x. It should
have never been introduced in the first place.

Please consider executing requests with an explicit target HttpHost and
a 'virtual' host in the request URI.

https://github.com/apache/httpcomponents-client/blob/master/httpclient5
/src/main/java/org/apache/hc/client5/http/classic/HttpClient.java#L95

HttpHost should represent a physical host, whereas request URI may
contain any arbitrary host name.

---
HttpHost target = new HttpHost("www.google.com");
HttpGet httpGet = new HttpGet("http://google.ru/");
CloseableHttpResponse response = client.execute(target, httpGet);
---
Post by Philippe Mouawad
- This feature allows to simulate slow connection. Currently we wrap
Input/Output stream returned by socket with
SlowInputStream/SlowOutputStream
-
https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
p/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
-
https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322
-
https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892
- It is not clear for me how this feature should be
- Should we adapt SSLSocket and Socket with a Slow feature ?
Hope you can help by pointing me to the components.
I think all you need to do is to extend PlainConnectionSocketFactory or
provide a custom one and return a 'slow' socket from #createSocket
method.


Maybe this could be a contribution in our test code? It does not seem to
really belong in main... unless it is used to enable throttling which seems
like a neat idea for any server. So I would put in it main, but that's just
me.

Gary


https://github.com/apache/httpcomponents-client/blob/master/httpclient5
/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketF
actory.java

Hope this helps

Oleg
Post by Philippe Mouawad
Thanks
Regards
Philippe M.
@philmdot
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-***@hc.apache.org
For additional commands, e-mail: httpclient-users-***@hc.apache.org
Oleg Kalnichevski
2017-10-13 09:30:38 UTC
Permalink
...
Post by Gary Gregory
Maybe this could be a contribution in our test code? It does not seem to
really belong in main... unless it is used to enable throttling which seems
like a neat idea for any server. So I would put in it main, but that's just
me.
Gary
Yes, HC 5.0 (core and client) now have 'testing' modules specifically
for re-usable integration / load test components.

It would likely be a good place for throttling code.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-***@hc.apache.org
For additional commands, e-mail: httpclient-users-***@hc.apache.org
Loading...