[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1475?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pascal updated HTTPCLIENT-1475:
-------------------------------

    Description: 
Hi,

Coding a use case involving massive querying of a web API, but having requests 
count restrictions, I'm trying to count all requests sent by HttpClient, 
including configured default retries and HTTP501-specific retries.

The restriction is an access key, provided as a GET parameter, and being 
restricted to n daily usages, being revoked by the service maintainer if this 
rule is not respected (this is about the Steam gaming platform web API, nothing 
warez).

In a nutshell, the needed feature is an overall requests-sent counter for each 
processed HttpGet.

I found no way of doing this, and the source of 
'org.apache.http.impl.execchain.RetryExec' (keyword: 'execCount') let me think 
this is not possible to do so. 'execCount' is a local variable not transmitted 
to other objects, so it doesn't seem like the info is provided in some other 
convenience stat object of the API. This counter could be in the deeps of 
'requestExecutor.execute(route, request, context, execAware)' by the way.

Also, I thought of extending the retry-related handlers, to count manually in 
some overriden 'retryRequest(ex, execCount, context)' methods. But the 
'request' is not available in here, making it impossible to know what 
HttpGet/URL one is counting for.

Issue is best described on Stackoverflow, also mentionning the ' 
https://issues.apache.org/jira/browse/HTTPCORE-21 ', which may be related (a ' 
git diff --name-only 4.0-alpha4 4.0-beta1 ' was too big, so I could not find 
any relevant usage tip. '4.0-alpha6' was not tagged):
http://stackoverflow.com/questions/22195471/how-to-count-all-http-requests-sent-retries-in

It may be a my-fault "RTFM" or an API documentation issue also. I really hope a 
feature or workaround exists to achieve so :)

Thanks in advance


  was:
Hi,

Coding a use case involving massive querying of a web API, but having requests 
count restrictions, I'm trying to count all requests sent by HttpClient, 
including configured default retries and HTTP501-specific retries.

The restriction is an access key, provided as a GET parameter, and being 
restricted to n daily usages, being revoked by the service maintainer if this 
rule is not respected (this is about the Steam gaming platform web API, nothing 
warez).

In a nutshell, the needed feature is an overall requests-sent counter for each 
processed HttpGet.

I found no way of doing this, and the source of 
'org.apache.http.impl.execchain.RetryExec' (keyword: 'execCount') let me think 
this is not possible to do so. 'execCount' is a local variable, so it doesn't 
seem like the info is provided in some other convenience stat object of the API.

Also, I thought of extending the retry-related handlers, to count manually in 
some overriden 'retryRequest(ex, execCount, context)' methods. But the 
'request' is not available in here, making it impossible to know what 
HttpGet/URL one is counting for.

Issue is best described on Stackoverflow, also mentionning the ' 
https://issues.apache.org/jira/browse/HTTPCORE-21 ', which may be related (a ' 
git diff --name-only 4.0-alpha4 4.0-beta1 ' was too big, so I could not find 
any relevant usage tip. '4.0-alpha6' was not tagged):
http://stackoverflow.com/questions/22195471/how-to-count-all-http-requests-sent-retries-in

It may be a my-fault "RTFM" or an API documentation issue also. I really hope a 
feature or workaround exists to achieve so :)

Thanks in advance



> Add a requests count readable stat for each HttpGet to be processed
> -------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1475
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1475
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpClient
>    Affects Versions: 4.3.3
>            Reporter: Pascal
>            Priority: Minor
>              Labels: HttpGet, count, retry
>
> Hi,
> Coding a use case involving massive querying of a web API, but having 
> requests count restrictions, I'm trying to count all requests sent by 
> HttpClient, including configured default retries and HTTP501-specific retries.
> The restriction is an access key, provided as a GET parameter, and being 
> restricted to n daily usages, being revoked by the service maintainer if this 
> rule is not respected (this is about the Steam gaming platform web API, 
> nothing warez).
> In a nutshell, the needed feature is an overall requests-sent counter for 
> each processed HttpGet.
> I found no way of doing this, and the source of 
> 'org.apache.http.impl.execchain.RetryExec' (keyword: 'execCount') let me 
> think this is not possible to do so. 'execCount' is a local variable not 
> transmitted to other objects, so it doesn't seem like the info is provided in 
> some other convenience stat object of the API. This counter could be in the 
> deeps of 'requestExecutor.execute(route, request, context, execAware)' by the 
> way.
> Also, I thought of extending the retry-related handlers, to count manually in 
> some overriden 'retryRequest(ex, execCount, context)' methods. But the 
> 'request' is not available in here, making it impossible to know what 
> HttpGet/URL one is counting for.
> Issue is best described on Stackoverflow, also mentionning the ' 
> https://issues.apache.org/jira/browse/HTTPCORE-21 ', which may be related (a 
> ' git diff --name-only 4.0-alpha4 4.0-beta1 ' was too big, so I could not 
> find any relevant usage tip. '4.0-alpha6' was not tagged):
> http://stackoverflow.com/questions/22195471/how-to-count-all-http-requests-sent-retries-in
> It may be a my-fault "RTFM" or an API documentation issue also. I really hope 
> a feature or workaround exists to achieve so :)
> Thanks in advance



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to