stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajkumar Rajaratnam <rajkum...@wso2.com>
Subject Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review
Date Thu, 02 Oct 2014 15:29:55 GMT
Hi,

As discussed in the hangout, in AutoscalerHealthStatEventReceiver[1] we are
checking the cluster types, and doing things accordingly like below.

                if(monitor.getClusterType() == ClusterType.VMServiceCluster
                || monitor.getClusterType() == ClusterType.VMLbCluster) {
                //do stuff
                } else if(monitor.getClusterType() ==
ClusterType.KubernetesServiceCluster) {
                       //do stuff
                }

IMO, better we introduce abstract methods, handleEventX(),
in AbstractClusterMonitor per events.

For example,

handleAverageLoadAverageEvent(AverageLoadAverageEvent avgLoadAverageEvent);

Then we can handle this event accordingly by overriding this method in
relevant concrete monitors.

It will eliminate all if/else checking in the autoscaler event receiver.
Also we simply delegate the event to the relevant cluster monitor so that
they can do what ever they want to do with the event, rather than doing
stuffs at events receivers.

wdyt?

1.
https://github.com/apache/stratos/blob/master/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/AutoscalerHealthStatEventReceiver.java

Thanks

On Tue, Sep 23, 2014 at 11:43 PM, Rajkumar Rajaratnam <rajkumarr@wso2.com>
wrote:

> Hi,
>
> *Review notes*
>
>    - use the word kubernetes instead of docker when naming classes
>    - arguments should be less than or equal to 4 (we need to add it to
>    coding practices!?)
>    - add licence header
>    - map variables names should have a clue about the map (say,
>    clusterIdToClusterMonitorMap)
>    - some classes and methods missing comments
>    - use complete topology event only once
>    - use event names for variables instead of using 'e' (say,
>    ClusterCreatedEvent)
>    - find abstraction in the things we do upon receiving health stats
>    events (set load avg value), to eliminate if/else
>
> Find the hangout video at [1]
>
> 1. https://www.youtube.com/watch?v=X0Jh_JCL7ZI
>
> Thanks.
>
> On Tue, Sep 23, 2014 at 7:27 PM, Chamila De Alwis <chamilad@wso2.com>
> wrote:
>
>> Hi,
>>
>> Please find the hangout at
>> https://plus.google.com/hangouts/_/hoaevent/AP36tYfCemYdNWEw38lnSZqhRCIA8rqA-FTHXaP0zw9juKeBvPIxiQ?authuser=0&hl=en
>>
>>
>> Regards,
>> Chamila de Alwis
>> Software Engineer | WSO2 | +94772207163
>> Blog: code.chamiladealwis.com
>>
>>
>>
>> On Tue, Sep 23, 2014 at 11:15 AM, Rajkumar Rajaratnam <rajkumarr@wso2.com
>> > wrote:
>>
>>> Hi Imesh,
>>>
>>> You can find more information on the mail thread "Stratos Cluster
>>> Monitoring"
>>>
>>> Thanks.
>>>
>>> On Tue, Sep 23, 2014 at 10:38 AM, Imesh Gunaratne <imesh@apache.org>
>>> wrote:
>>>
>>>> Hi Rajkumar,
>>>>
>>>> Can you please point me to a mail thread/wiki page where we have more
>>>> information on this improvement?
>>>>
>>>> Thanks
>>>>
>>>> On Mon, Sep 22, 2014 at 11:00 AM, Lakmal Warusawithana <lakmal@wso2.com
>>>> > wrote:
>>>>
>>>>> +1
>>>>>
>>>>> On Mon, Sep 22, 2014 at 4:51 PM, Rajkumar Rajaratnam <
>>>>> rajkumarr@wso2.com> wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> Can we have $Subject tomorrow (Tue, September 23) at 7:30 PM
>>>>>> GMT+5:30 ?
>>>>>>
>>>>>> We will be reviewing about the changes done to existing cluster
>>>>>> monitor hierarchy to allow any 'entity' cluster monitors to be plugged
in
>>>>>> and the initial version of docker cluster monitoring.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> --
>>>>>> Rajkumar Rajaratnam
>>>>>> Software Engineer | WSO2, Inc.
>>>>>> Mobile +94777568639 | +94783498120
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Lakmal Warusawithana
>>>>> Vice President, Apache Stratos
>>>>> Director - Cloud Architecture; WSO2 Inc.
>>>>> Mobile : +94714289692
>>>>> Blog : http://lakmalsview.blogspot.com/
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>> Rajkumar Rajaratnam
>>> Software Engineer | WSO2, Inc.
>>> Mobile +94777568639 | +94783498120
>>>
>>
>>
>
>
> --
> Rajkumar Rajaratnam
> Software Engineer | WSO2, Inc.
> Mobile +94777568639 | +94783498120
>



-- 
Rajkumar Rajaratnam
Software Engineer | WSO2, Inc.
Mobile +94777568639 | +94783498120

Mime
View raw message