[ 
http://issues.apache.org/jira/browse/HTTPCORE-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461739
 ] 

Roland Weber commented on HTTPCORE-21:
--------------------------------------

Hi Oleg,

makes sense. I'm not sure I like passing in a string as a selector. It sure is 
better than adding half a dozen counter methods over time. How do you feel 
about an int or char selector so we can switch() instead of running a sequence 
of if-then-elseif string comparisons? Or a new class/interface:

interface HttpConnectionMetrics {
  int getRequestCount();
  int getResponseCount();
  long getSentBytesCount();
  long getReceivedBytesCount();
}

interface Http[Client]Connection {
  ...
  HttpConnectionMetrics getMetrics();
}

For the time being, I shy the complexity of adding four counters instead of 
one. (Just due to personal time constraints.) I'll let this settle while I'm 
working on the connection stuff and will pick it up afterwards.

cheers,
  Roland


> have connections count requests
> -------------------------------
>
>                 Key: HTTPCORE-21
>                 URL: http://issues.apache.org/jira/browse/HTTPCORE-21
>             Project: HttpComponents Core
>          Issue Type: Wish
>          Components: HttpCore
>    Affects Versions: 4.0-alpha3
>            Reporter: Roland Weber
>         Assigned To: Roland Weber
>            Priority: Minor
>         Attachments: 2k6-12-28-reqcnt-1.txt
>
>
> It would be nice if connections would count the requests sent since they were 
> opened. This would greatly simplify the implementation of reuse strategies 
> like "reuse for at most 5 requests". While it is possible to count requests 
> elsewhere, that is clumsy and error prone. For example the HttpContext is not 
> a good place to keep the request count, since the connection may be released 
> to and re-acquired from a connection manager, so the previously used context 
> is lost.
> patch follows
> cheers,
>   Roland

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to