You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Rajkumar Rajaratnam <ra...@wso2.com> on 2014/09/22 13:21:47 UTC

[Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

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

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Udara Liyanage <ud...@wso2.com>.
Hi,

Please join the hangout on [1]

[1]
https://plus.google.com/hangouts/_/hoaevent/AP36tYfCemYdNWEw38lnSZqhRCIA8rqA-FTHXaP0zw9juKeBvPIxiQ?authuser=0&hl=en

On Tue, Sep 23, 2014 at 11:15 AM, Rajkumar Rajaratnam <ra...@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 <im...@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 <la...@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
>



-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Rajkumar Rajaratnam <ra...@wso2.com>.
Hi,

Please join the hangout here
https://plus.google.com/hangouts/_/hoaevent/AP36tYfCemYdNWEw38lnSZqhRCIA8rqA-FTHXaP0zw9juKeBvPIxiQ?authuser=0&hl=en

Thanks.

On Tue, Sep 23, 2014 at 11:15 AM, Rajkumar Rajaratnam <ra...@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 <im...@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 <la...@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

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Lahiru Sandaruwan <la...@wso2.com>.
+1.. It is specially designed for this kinda work.

Thanks.

On Sun, Oct 5, 2014 at 11:53 AM, Nirmal Fernando <ni...@gmail.com>
wrote:

> +1 this was a long due one. We have to do the same for all Threads used in
> Stratos code.
>
> On Sun, Oct 5, 2014 at 11:50 AM, Rajkumar Rajaratnam <ra...@wso2.com>
> wrote:
>
>> Hi,
>>
>> I have done the changes as in the previous mail.
>>
>> I am proposing one more changes to cluster monitors.
>>
>> Shall we use java executor services instead of thread sleep?
>>
>> For example, we are sleeping the thread in cluster monitors to monitor
>> the cluster periodically.
>>
>> Instead, if we use ScheduledExecutorService, the logic would be more
>> cleaner, readable, understandable and maintainable.
>>
>> wdyt?
>>
>> Thanks.
>>
>> On Thu, Oct 2, 2014 at 8:59 PM, Rajkumar Rajaratnam <ra...@wso2.com>
>> wrote:
>>
>>> 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 <ch...@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 <im...@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
>>>
>>
>>
>>
>> --
>> Rajkumar Rajaratnam
>> Software Engineer | WSO2, Inc.
>> Mobile +94777568639 | +94783498120
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
--
Lahiru Sandaruwan
Committer and PMC member, Apache Stratos,
Senior Software Engineer,
WSO2 Inc., http://wso2.com
lean.enterprise.middleware

email: lahirus@wso2.com cell: (+94) 773 325 954
blog: http://lahiruwrites.blogspot.com/
twitter: http://twitter.com/lahirus
linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Nirmal Fernando <ni...@gmail.com>.
+1 this was a long due one. We have to do the same for all Threads used in
Stratos code.

On Sun, Oct 5, 2014 at 11:50 AM, Rajkumar Rajaratnam <ra...@wso2.com>
wrote:

> Hi,
>
> I have done the changes as in the previous mail.
>
> I am proposing one more changes to cluster monitors.
>
> Shall we use java executor services instead of thread sleep?
>
> For example, we are sleeping the thread in cluster monitors to monitor the
> cluster periodically.
>
> Instead, if we use ScheduledExecutorService, the logic would be more
> cleaner, readable, understandable and maintainable.
>
> wdyt?
>
> Thanks.
>
> On Thu, Oct 2, 2014 at 8:59 PM, Rajkumar Rajaratnam <ra...@wso2.com>
> wrote:
>
>> 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 <ch...@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 <im...@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
>>
>
>
>
> --
> Rajkumar Rajaratnam
> Software Engineer | WSO2, Inc.
> Mobile +94777568639 | +94783498120
>



-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Isuru Haththotuwa <is...@apache.org>.
On Mon, Oct 6, 2014 at 11:17 PM, Rajkumar Rajaratnam <ra...@wso2.com>
wrote:

> Hi
>
> On Mon, Oct 6, 2014 at 11:13 PM, Isuru Haththotuwa <is...@apache.org>
> wrote:
>
>>
>>
>> On Mon, Oct 6, 2014 at 10:52 PM, Rajkumar Rajaratnam <ra...@wso2.com>
>> wrote:
>>
>>> Hi,
>>>
>>> When we are using ScheduledExecutorService, thread pool size is fixed.
>>> There are only 2 factory methods to create ScheduledThreadPools, one with
>>> single thread and one with fixed number of threads.
>>>
>>> In our scenario, we can't predict the number clusters in advance. We
>>> have two options.
>>>
>>> 1. We can create ScheduledThreadPool with fixed number of threads. If
>>> there are less number of tasks, it works fine. If there are many tasks and
>>> each tasks takes time, then tasks will be queued. It means that we are not
>>> monitoring the cluster on time!
>>>
>>> 2. We can create ScheduledThreadPool with one thread, per cluster. If
>>> there are 10 cluster, there will be 10 ScheduledThreadPool, each with one
>>> thread. This way, we ensure that we are monitoring the cluster on time and
>>> there are no idle threads. Because when the cluster is removed, we shutdown
>>> the scheduler also.
>>>
>>> IMO, it is crucial to monitor the cluster on time, than reusing threads?
>>>
>> Isn't it possible to keep a dynamically growing Thread Pool? See [1].
>>
>
> Hmm... We are using ScheduledExecutorService. Because we are scheduling
> tasks. AFAIK, We can't use cached thread pools to create
> ScheduledExecutorService.
>
I see. Yes, there seem there is no scheduled cached thread pool in the Java
Executors class. In this case, option #2 would be better IMHO.

>
>> [1].
>> http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html#newCachedThreadPool(java.util.concurrent.ThreadFactory)
>>
>>>
>>> wdyt?
>>>
>>> Thanks
>>>
>>> On Sun, Oct 5, 2014 at 7:56 PM, Isuru Haththotuwa <is...@apache.org>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Sun, Oct 5, 2014 at 11:50 AM, Rajkumar Rajaratnam <
>>>> rajkumarr@wso2.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have done the changes as in the previous mail.
>>>>>
>>>>> I am proposing one more changes to cluster monitors.
>>>>>
>>>>> Shall we use java executor services instead of thread sleep?
>>>>>
>>>> +1
>>>>
>>>>>
>>>>> For example, we are sleeping the thread in cluster monitors to monitor
>>>>> the cluster periodically.
>>>>>
>>>>> Instead, if we use ScheduledExecutorService, the logic would be more
>>>>> cleaner, readable, understandable and maintainable.
>>>>>
>>>>> wdyt?
>>>>>
>>>>> Thanks.
>>>>>
>>>>> On Thu, Oct 2, 2014 at 8:59 PM, Rajkumar Rajaratnam <
>>>>> rajkumarr@wso2.com> wrote:
>>>>>
>>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Rajkumar Rajaratnam
>>>>> Software Engineer | WSO2, Inc.
>>>>> Mobile +94777568639 | +94783498120
>>>>>
>>>>> --
>>>>> <%2B94783498120>
>>>>> Thanks and Regards,
>>>>>
>>>>> Isuru H.
>>>>> <%2B94783498120>
>>>>> +94 716 358 048 <%2B94783498120>* <http://wso2.com/>*
>>>>>
>>>>>
>>>>> * <http://wso2.com/>*
>>>>>
>>>>>
>>>>>
>>>
>>>
>>> --
>>> Rajkumar Rajaratnam
>>> Software Engineer | WSO2, Inc.
>>> Mobile +94777568639 | +94783498120
>>>
>>> --
>>> <%2B94783498120>
>>> Thanks and Regards,
>>>
>>> Isuru H.
>>> <%2B94783498120>
>>> +94 716 358 048 <%2B94783498120>* <http://wso2.com/>*
>>>
>>>
>>> * <http://wso2.com/>*
>>>
>>>
>>>
>
>
> --
> Rajkumar Rajaratnam
> Software Engineer | WSO2, Inc.
> Mobile +94777568639 | +94783498120
>
> --
> <%2B94783498120>
> Thanks and Regards,
>
> Isuru H.
> <%2B94783498120>
> +94 716 358 048 <%2B94783498120>* <http://wso2.com/>*
>
>
> * <http://wso2.com/>*
>
>
>

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Rajkumar Rajaratnam <ra...@wso2.com>.
Hi

On Mon, Oct 6, 2014 at 11:13 PM, Isuru Haththotuwa <is...@apache.org>
wrote:

>
>
> On Mon, Oct 6, 2014 at 10:52 PM, Rajkumar Rajaratnam <ra...@wso2.com>
> wrote:
>
>> Hi,
>>
>> When we are using ScheduledExecutorService, thread pool size is fixed.
>> There are only 2 factory methods to create ScheduledThreadPools, one with
>> single thread and one with fixed number of threads.
>>
>> In our scenario, we can't predict the number clusters in advance. We have
>> two options.
>>
>> 1. We can create ScheduledThreadPool with fixed number of threads. If
>> there are less number of tasks, it works fine. If there are many tasks and
>> each tasks takes time, then tasks will be queued. It means that we are not
>> monitoring the cluster on time!
>>
>> 2. We can create ScheduledThreadPool with one thread, per cluster. If
>> there are 10 cluster, there will be 10 ScheduledThreadPool, each with one
>> thread. This way, we ensure that we are monitoring the cluster on time and
>> there are no idle threads. Because when the cluster is removed, we shutdown
>> the scheduler also.
>>
>> IMO, it is crucial to monitor the cluster on time, than reusing threads?
>>
> Isn't it possible to keep a dynamically growing Thread Pool? See [1].
>

Hmm... We are using ScheduledExecutorService. Because we are scheduling
tasks. AFAIK, We can't use cached thread pools to create
ScheduledExecutorService.

>
> [1].
> http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html#newCachedThreadPool(java.util.concurrent.ThreadFactory)
>
>>
>> wdyt?
>>
>> Thanks
>>
>> On Sun, Oct 5, 2014 at 7:56 PM, Isuru Haththotuwa <is...@apache.org>
>> wrote:
>>
>>>
>>>
>>> On Sun, Oct 5, 2014 at 11:50 AM, Rajkumar Rajaratnam <rajkumarr@wso2.com
>>> > wrote:
>>>
>>>> Hi,
>>>>
>>>> I have done the changes as in the previous mail.
>>>>
>>>> I am proposing one more changes to cluster monitors.
>>>>
>>>> Shall we use java executor services instead of thread sleep?
>>>>
>>> +1
>>>
>>>>
>>>> For example, we are sleeping the thread in cluster monitors to monitor
>>>> the cluster periodically.
>>>>
>>>> Instead, if we use ScheduledExecutorService, the logic would be more
>>>> cleaner, readable, understandable and maintainable.
>>>>
>>>> wdyt?
>>>>
>>>> Thanks.
>>>>
>>>> On Thu, Oct 2, 2014 at 8:59 PM, Rajkumar Rajaratnam <rajkumarr@wso2.com
>>>> > wrote:
>>>>
>>>>> 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 <ch...@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
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Rajkumar Rajaratnam
>>>> Software Engineer | WSO2, Inc.
>>>> Mobile +94777568639 | +94783498120
>>>>
>>>> --
>>>> <%2B94783498120>
>>>> Thanks and Regards,
>>>>
>>>> Isuru H.
>>>> <%2B94783498120>
>>>> +94 716 358 048 <%2B94783498120>* <http://wso2.com/>*
>>>>
>>>>
>>>> * <http://wso2.com/>*
>>>>
>>>>
>>>>
>>
>>
>> --
>> Rajkumar Rajaratnam
>> Software Engineer | WSO2, Inc.
>> Mobile +94777568639 | +94783498120
>>
>> --
>> <%2B94783498120>
>> Thanks and Regards,
>>
>> Isuru H.
>> <%2B94783498120>
>> +94 716 358 048 <%2B94783498120>* <http://wso2.com/>*
>>
>>
>> * <http://wso2.com/>*
>>
>>
>>


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

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Isuru Haththotuwa <is...@apache.org>.
On Mon, Oct 6, 2014 at 10:52 PM, Rajkumar Rajaratnam <ra...@wso2.com>
wrote:

> Hi,
>
> When we are using ScheduledExecutorService, thread pool size is fixed.
> There are only 2 factory methods to create ScheduledThreadPools, one with
> single thread and one with fixed number of threads.
>
> In our scenario, we can't predict the number clusters in advance. We have
> two options.
>
> 1. We can create ScheduledThreadPool with fixed number of threads. If
> there are less number of tasks, it works fine. If there are many tasks and
> each tasks takes time, then tasks will be queued. It means that we are not
> monitoring the cluster on time!
>
> 2. We can create ScheduledThreadPool with one thread, per cluster. If
> there are 10 cluster, there will be 10 ScheduledThreadPool, each with one
> thread. This way, we ensure that we are monitoring the cluster on time and
> there are no idle threads. Because when the cluster is removed, we shutdown
> the scheduler also.
>
> IMO, it is crucial to monitor the cluster on time, than reusing threads?
>
Isn't it possible to keep a dynamically growing Thread Pool? See [1].

[1].
http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html#newCachedThreadPool(java.util.concurrent.ThreadFactory)

>
> wdyt?
>
> Thanks
>
> On Sun, Oct 5, 2014 at 7:56 PM, Isuru Haththotuwa <is...@apache.org>
> wrote:
>
>>
>>
>> On Sun, Oct 5, 2014 at 11:50 AM, Rajkumar Rajaratnam <ra...@wso2.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I have done the changes as in the previous mail.
>>>
>>> I am proposing one more changes to cluster monitors.
>>>
>>> Shall we use java executor services instead of thread sleep?
>>>
>> +1
>>
>>>
>>> For example, we are sleeping the thread in cluster monitors to monitor
>>> the cluster periodically.
>>>
>>> Instead, if we use ScheduledExecutorService, the logic would be more
>>> cleaner, readable, understandable and maintainable.
>>>
>>> wdyt?
>>>
>>> Thanks.
>>>
>>> On Thu, Oct 2, 2014 at 8:59 PM, Rajkumar Rajaratnam <ra...@wso2.com>
>>> wrote:
>>>
>>>> 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 <ch...@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 <im...@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
>>>>
>>>
>>>
>>>
>>> --
>>> Rajkumar Rajaratnam
>>> Software Engineer | WSO2, Inc.
>>> Mobile +94777568639 | +94783498120
>>>
>>> --
>>> <%2B94783498120>
>>> Thanks and Regards,
>>>
>>> Isuru H.
>>> <%2B94783498120>
>>> +94 716 358 048 <%2B94783498120>* <http://wso2.com/>*
>>>
>>>
>>> * <http://wso2.com/>*
>>>
>>>
>>>
>
>
> --
> Rajkumar Rajaratnam
> Software Engineer | WSO2, Inc.
> Mobile +94777568639 | +94783498120
>
> --
> <%2B94783498120>
> Thanks and Regards,
>
> Isuru H.
> <%2B94783498120>
> +94 716 358 048 <%2B94783498120>* <http://wso2.com/>*
>
>
> * <http://wso2.com/>*
>
>
>

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Rajkumar Rajaratnam <ra...@wso2.com>.
Hi,

When we are using ScheduledExecutorService, thread pool size is fixed.
There are only 2 factory methods to create ScheduledThreadPools, one with
single thread and one with fixed number of threads.

In our scenario, we can't predict the number clusters in advance. We have
two options.

1. We can create ScheduledThreadPool with fixed number of threads. If there
are less number of tasks, it works fine. If there are many tasks and each
tasks takes time, then tasks will be queued. It means that we are not
monitoring the cluster on time!

2. We can create ScheduledThreadPool with one thread, per cluster. If there
are 10 cluster, there will be 10 ScheduledThreadPool, each with one thread.
This way, we ensure that we are monitoring the cluster on time and there
are no idle threads. Because when the cluster is removed, we shutdown the
scheduler also.

IMO, it is crucial to monitor the cluster on time, than reusing threads?

wdyt?

Thanks

On Sun, Oct 5, 2014 at 7:56 PM, Isuru Haththotuwa <is...@apache.org> wrote:

>
>
> On Sun, Oct 5, 2014 at 11:50 AM, Rajkumar Rajaratnam <ra...@wso2.com>
> wrote:
>
>> Hi,
>>
>> I have done the changes as in the previous mail.
>>
>> I am proposing one more changes to cluster monitors.
>>
>> Shall we use java executor services instead of thread sleep?
>>
> +1
>
>>
>> For example, we are sleeping the thread in cluster monitors to monitor
>> the cluster periodically.
>>
>> Instead, if we use ScheduledExecutorService, the logic would be more
>> cleaner, readable, understandable and maintainable.
>>
>> wdyt?
>>
>> Thanks.
>>
>> On Thu, Oct 2, 2014 at 8:59 PM, Rajkumar Rajaratnam <ra...@wso2.com>
>> wrote:
>>
>>> 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 <ch...@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 <im...@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
>>>
>>
>>
>>
>> --
>> Rajkumar Rajaratnam
>> Software Engineer | WSO2, Inc.
>> Mobile +94777568639 | +94783498120
>>
>> --
>> <%2B94783498120>
>> Thanks and Regards,
>>
>> Isuru H.
>> <%2B94783498120>
>> +94 716 358 048 <%2B94783498120>* <http://wso2.com/>*
>>
>>
>> * <http://wso2.com/>*
>>
>>
>>


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

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Isuru Haththotuwa <is...@apache.org>.
On Sun, Oct 5, 2014 at 11:50 AM, Rajkumar Rajaratnam <ra...@wso2.com>
wrote:

> Hi,
>
> I have done the changes as in the previous mail.
>
> I am proposing one more changes to cluster monitors.
>
> Shall we use java executor services instead of thread sleep?
>
+1

>
> For example, we are sleeping the thread in cluster monitors to monitor the
> cluster periodically.
>
> Instead, if we use ScheduledExecutorService, the logic would be more
> cleaner, readable, understandable and maintainable.
>
> wdyt?
>
> Thanks.
>
> On Thu, Oct 2, 2014 at 8:59 PM, Rajkumar Rajaratnam <ra...@wso2.com>
> wrote:
>
>> 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 <ch...@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 <im...@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
>>
>
>
>
> --
> Rajkumar Rajaratnam
> Software Engineer | WSO2, Inc.
> Mobile +94777568639 | +94783498120
>
> --
> <%2B94783498120>
> Thanks and Regards,
>
> Isuru H.
> <%2B94783498120>
> +94 716 358 048 <%2B94783498120>* <http://wso2.com/>*
>
>
> * <http://wso2.com/>*
>
>
>

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Rajkumar Rajaratnam <ra...@wso2.com>.
Hi,

I have done the changes as in the previous mail.

I am proposing one more changes to cluster monitors.

Shall we use java executor services instead of thread sleep?

For example, we are sleeping the thread in cluster monitors to monitor the
cluster periodically.

Instead, if we use ScheduledExecutorService, the logic would be more
cleaner, readable, understandable and maintainable.

wdyt?

Thanks.

On Thu, Oct 2, 2014 at 8:59 PM, Rajkumar Rajaratnam <ra...@wso2.com>
wrote:

> 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 <ra...@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 <ch...@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 <im...@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
>



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

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Rajkumar Rajaratnam <ra...@wso2.com>.
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 <ra...@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 <ch...@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 <im...@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

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Rajkumar Rajaratnam <ra...@wso2.com>.
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 <ch...@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 <ra...@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 <im...@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 <la...@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

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Chamila De Alwis <ch...@wso2.com>.
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 <ra...@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 <im...@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 <la...@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
>

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Nirmal Fernando <ni...@gmail.com>.
Please join the hangout
https://plus.google.com/hangouts/_/hoaevent/AP36tYfCemYdNWEw38lnSZqhRCIA8rqA-FTHXaP0zw9juKeBvPIxiQ?pqs=1&authuser=0&hl=en

On Tue, Sep 23, 2014 at 11:15 AM, Rajkumar Rajaratnam <ra...@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 <im...@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 <la...@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
>



-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Rajkumar Rajaratnam <ra...@wso2.com>.
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 <im...@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 <la...@wso2.com>
> wrote:
>
>> +1
>>
>> On Mon, Sep 22, 2014 at 4:51 PM, Rajkumar Rajaratnam <ra...@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

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Imesh Gunaratne <im...@apache.org>.
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 <la...@wso2.com>
wrote:

> +1
>
> On Mon, Sep 22, 2014 at 4:51 PM, Rajkumar Rajaratnam <ra...@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

Re: [Hangout] Stratos Cluster Monitoring Improvement - Design and Code review

Posted by Lakmal Warusawithana <la...@wso2.com>.
+1

On Mon, Sep 22, 2014 at 4:51 PM, Rajkumar Rajaratnam <ra...@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/