You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by 郑扬勇 <ya...@qq.com> on 2017/12/22 02:47:56 UTC

Desgin for Java Chassis Metrics Support User Custom Business Metrics

Hi all:
   After a long time develpment , we had build-in necessary metric collect from Java Chassis,include tps ,latenct,system resource usage etc.. ,now we need support user custom his/her own business metrics for extension,more information can found : https://issues.apache.org/jira/browse/SCB-12 , comment is wellcome~
   In current architecture , there is a RegistryMonitor contain all InvocationMonitor,when polling metrics data from RegistryMonitor,only need call toRegistryMetric() function,so I think we can hold custom metric here :
  
First we can implement a MetricFactory let user easy generate basic metric type like Counter,Guage,Max,Min,Rate etc..
 
Then provide a interface named Registry with registerMetric(Metric metric) function let user inject custom metric into RegistryMonitor
 
When polling metrics data , toRegistryMetric() will also collect user injected custom metrics data to RegistryMetric let result visible
 
  Any better desgin ?

Re: Desgin for Java Chassis Metrics Support User Custom Business Metrics

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Please check out my comments in the below email.


Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
          http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Dec 22, 2017 at 10:47 AM, 郑扬勇 <ya...@qq.com> wrote:

> Hi all:
>    After a long time develpment , we had build-in necessary metric collect
> from Java Chassis,include tps ,latenct,system resource usage etc.. ,now we
> need support user custom his/her own business metrics for extension,more
> information can found : https://issues.apache.org/jira/browse/SCB-12 ,
> comment is wellcome~
>    In current architecture , there is a RegistryMonitor contain all
> InvocationMonitor,when polling metrics data from RegistryMonitor,only need
> call toRegistryMetric() function,so I think we can hold custom metric here :
>
> First we can implement a MetricFactory let user easy generate basic metric
> type like Counter,Guage,Max,Min,Rate etc..
>

Servo has the annotation to define the monitor with annotation,  that could
be a good way for the user to add their own monitor.


>
> Then provide a interface named Registry with registerMetric(Metric metric)
> function let user inject custom metric into RegistryMonitor
>
> When polling metrics data , toRegistryMetric() will also collect user
> injected custom metrics data to RegistryMetric let result visible
>
>
We could hide these logic by providing the Metrics annotation.


>   Any better desgin ?