Hi Azeez,
We can use the "Meter" in metrics to record the number of failures per
second and use the rates in Meter (Mean, Last One Minute, Last Five Minutes
and Last Fifteen Minutes) for checking a certain threshold.
However we need following changes to be done in Carbon Metrics component.
- Expose Meter Rates from the Carbon Metrics library. (Carbon Metrics
didn't expose ways to read metrics from the Java APIs). For example,
Dropwizard Meter [1] has APIs to read meter rates and Carbon Metrics Meter
has only the basic APIs for using a Meter [2].
- I will try to include these APIs in Carbon Metrics v2.0.0 release,
which will be compatible with Carbon 5 products.
- Initialize Metrics in a single place. Right now, MSF4J
initialization code for Metrics is in msf4j-analytics component [3]. In
MSF4J, the Metrics is initialized via the Metrics Interceptor [4]. When
Circuit Breaker implementation also plans to use Metrics, we need to have a
common way initializing metrics. (We need to think of a good design for
that).
I will start working on these.
Thanks!
Best Regards,
[1]
https://github.com/dropwizard/metrics/blob/v3.1.2/metrics-core/src/main/java/com/codahale/metrics/Meter.java#L85
[2]
https://github.com/wso2/carbon-metrics/blob/v1.2.1/components/org.wso2.carbon.metrics.manager/src/main/java/org/wso2/carbon/metrics/manager/Meter.java
[3]
https://github.com/wso2/msf4j/blob/v1.0.0/analytics/msf4j-analytics/src/main/java/org/wso2/msf4j/analytics/metrics/Metrics.java
[4]
https://github.com/wso2/msf4j/blob/v1.0.0/samples/metrics-httpmon/metrics-httpmon-fatjar/src/main/java/org/wso2/msf4j/example/Application.java#L38
On Mon, Mar 7, 2016 at 11:58 AM, Afkham Azeez <[email protected]> wrote:
> I was looking at
> http://www.javaworld.com/article/2824163/application-performance/stability-patterns-applied-in-a-restful-architecture.html?page=2
> and looks like we can implement it for the server side as a combination of
> an interceptor & metrics.
>
> Isuru, will we need any changes to the metrics side to implement this or
> can we directly make use of the existing metrics functionality to get the
> metrics to decide whether to trip the circuit? What supports does the
> current metrics implementation have related to fault monitoring? Pointed to
> the Java APIs to retrieve metrics would be appreciated. Also wondering how
> it would work in a cluster.
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * <http://www.apache.org/>*
> *email: **[email protected]* <[email protected]>
> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
> *http://blog.afkham.org* <http://blog.afkham.org>
> *twitter: **http://twitter.com/afkham_azeez*
> <http://twitter.com/afkham_azeez>
> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
> <http://lk.linkedin.com/in/afkhamazeez>*
>
> *Lean . Enterprise . Middleware*
>
--
Isuru Perera
Associate Technical Lead | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware
about.me/chrishantha
Contact: +IsuruPereraWSO2 <https://www.google.com/+IsuruPereraWSO2/about>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev