[ 
https://issues.apache.org/jira/browse/THRIFT-2927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16733488#comment-16733488
 ] 

James E. King III commented on THRIFT-2927:
-------------------------------------------

Agreed - this should be something optional someone can provide a class and get 
counters incremented when things happen.  These should just be counters, 
therefore performance should not be too much of an issue.  I wouldn't recommend 
that we build it into Thrift directly, but I would recommend we provide a 
reference implementation one can use as an example.

It's possible that different statistics come from different classes in the 
stack; the TProcessor could have an interface where something could get passed 
information about request handling:
* The service name (multiplexed) if applicable
* The method name
* The method type
* The start time
* The end time

A TServer would have different statistics:
* Connect or disconnect
* Client address
* Timestamp

A TTransport would have different statistics about number of bytes read or 
written, number of flushes, and the like.

To [~jensg]'s point however, the performance impact if you are not using the 
feature should be virtually undetectable.  When you are using the feature it 
would be acceptable to have some level of performance degradation due to the 
bookkeeping.

> Statistic function support (call analytics: duration, success-count, 
> failure-count, etc..)
> ------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-2927
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2927
>             Project: Thrift
>          Issue Type: New Feature
>          Components: C++ - Compiler, C++ - Library
>    Affects Versions: 0.9.2
>         Environment: linux c++
>            Reporter: Shi Jun
>            Priority: Major
>
> As a RPC framework, Thrift should support some statistic function, such as 
> latency、call times、failure rate and so on. And all these things can be done 
> by the framework, applications just need to use a make argument to open the 
> statistic function switch or not.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to