Jump to: navigation, search

Difference between revisions of "SMILA/Project Concepts/Generic Management And Monitoring Concept"

Line 42: Line 42:
 
Its suggested to use one registry class to work with management operations and with counters. Its planned to upgrade management module registry and remove performance counters registry.
 
Its suggested to use one registry class to work with management operations and with counters. Its planned to upgrade management module registry and remove performance counters registry.
  
Description and  initialization of performance counters will be in the Management Agent implementation.
+
Description and  initialization of performance counters will be in the Agent implementation.
 
It will allow to group counters (also together with management operations).
 
It will allow to group counters (also together with management operations).
  
Line 52: Line 52:
  
 
   // some performance counter related to that module
 
   // some performance counter related to that module
   public PerformanceCounter getCounterOne();
+
   public Counter getCounterOne();
  
 
   // other performance counter related to that module
 
   // other performance counter related to that module
   public PerformanceCounter getCounterTwo();
+
   public Counter getCounterTwo();
 
   
 
   
 
}
 
}
Line 69: Line 69:
  
 
}
 
}
class MyCountersAgent implements Agent{
+
class MyMonitoringAgent implements Agent{
   public PerformanceCounter getCounterOne();
+
   public Counter getCounterOne();
   public PerformanceCounter getCounterTwo();
+
   public Counter getCounterTwo();
 
}
 
}
 
</source>
 
</source>
Line 85: Line 85:
  
 
       init(){
 
       init(){
         POC_AGENT_ID = ManagementRegistration.register(firstPocAgent)
+
         POC_AGENT_ID = Registry.register(firstPocAgent)
 
       }
 
       }
 
        
 
        
 
       dispose(){
 
       dispose(){
         ManagementRegistration.unregister(POC_AGENT_ID)
+
         Registry.unregister(POC_AGENT_ID)
 
       }
 
       }
 
   }
 
   }
Line 98: Line 98:
 
        
 
        
 
     usingTheFirstPocAgent(){
 
     usingTheFirstPocAgent(){
       FirstPocAgent firstPocAgent = ManagementRegistration.get(ServiceActivatorFirst.POC_AGENT_ID)
+
       FirstPocAgent firstPocAgent = Registry.get(ServiceActivatorFirst.POC_AGENT_ID)
 
       onePocAgent.getCounterOne().increment();
 
       onePocAgent.getCounterOne().increment();
 
     }
 
     }
Line 112: Line 112:
  
 
  // manual categories ancestors iteration
 
  // manual categories ancestors iteration
  ManagementCategory category = ManagementRegistration.getCategory("Crawler").getCategory("Administration");
+
  Category category = Registry.getCategory("Management").getCategory("Crawler");
  
 
  // first way to register
 
  // first way to register
 
  category.register(agent);
 
  category.register(agent);
 
  // the second way to register
 
  // the second way to register
  ManagementRegistration.register(category, agent);
+
  Registry.register(category, agent);
 
  // the third way to register
 
  // the third way to register
  ManagementRegistration.register("Crawler/Administration", agent);
+
  Registry.register("Management/Crawler", agent);
  
  
 
  // unregister
 
  // unregister
  ManagementRegistration.unregister(agent);
+
  Registry.unregister(agent);
 
  // or
 
  // or
 
  category.unregister(agent);
 
  category.unregister(agent);
Line 129: Line 129:
 
</source>
 
</source>
  
Also its suggested to assume that creation/removing of categories is done automatically by ManagementRegistration and ManagementCategory classes.
+
Also its suggested to assume that creation/removing of categories is done automatically by Registry and Category classes.
  
 
[[Category:SMILA]]
 
[[Category:SMILA]]

Revision as of 07:27, 4 March 2009

Description

Currently SMILA uses separate modules for Management and for Performance Counters but both uses JMX/jconsole as a default presentation layer / UI.

During other SMILA components development it was found that both modules have issues.

This page is a concept about merging both modules into one generic module and solving issues found.

Discussion

Technical proposal

Current SMILA Modules

Performance Counters Module Architecture

See Performance Counters API

Management Module Architecture

This chart shows the Management architecture:

ManagementRegistry.png


Issues

Performance Counters Module issues

  • its impossible to group counters into tree legally by API ( now its used "JMX specific names" hack to group them )
  • its impossible to have several counters nested in common JMX leaf
  • its impossible to predict when counter will be initialized (to start tracking) because it initialized only on usage

Management Module issues

  • its impossible to group agents into tree

Common issues

  • its impossible to mix performance counters and management agents methods nested in one JMX leaf

Proposal

Agent with Counters

Its suggested to use one registry class to work with management operations and with counters. Its planned to upgrade management module registry and remove performance counters registry.

Description and initialization of performance counters will be in the Agent implementation. It will allow to group counters (also together with management operations).

class MyAgent implements Agent{
 
   // some management operation
   public  doSomething(args[]);
 
   // some performance counter related to that module
   public Counter getCounterOne();
 
   // other performance counter related to that module
   public Counter getCounterTwo();
 
}

But its also possible (and suggested) to split agent into independent Management Agent and Counters Agent to avoid dependencies. Mainly Management Agent using service and not used inside the service. And is visa versa for Counters Agent

class MyManagementAgent implements Agent{
  ...
   public  doSomething(args[]);
  ....
 
}
class MyMonitoringAgent implements Agent{
   public Counter getCounterOne();
   public Counter getCounterTwo();
}

Usage

But how to refer and use externally registered counters? For example, Crawler Controller Agent register globally "Total" counter. Each crawler instance should able to use it.

Its possible to pass CrawlerControllerAgent directly to crawler. Also if CrawlerControllerAgent was registered as service (its preferable way) its possible to find it by OSGi services registry. But also its possible to generate unique ID for crawler agent during registration and use it later.

class ServiceActivatorFirst{
 
      init(){
        POC_AGENT_ID = Registry.register(firstPocAgent)
      }
 
      dispose(){
         Registry.unregister(POC_AGENT_ID)
      }
   }
 
   // in other class
 
    class TheSecondClass{
 
     usingTheFirstPocAgent(){
      FirstPocAgent firstPocAgent = Registry.get(ServiceActivatorFirst.POC_AGENT_ID)
      onePocAgent.getCounterOne().increment();
     }
 
    }


Category Tree Construction / Registration

Its suggested to construct categories tree during registration

 // manual categories ancestors iteration
 Category category = Registry.getCategory("Management").getCategory("Crawler");
 
 // first way to register
 category.register(agent);
 // the second way to register
 Registry.register(category, agent);
 // the third way to register
 Registry.register("Management/Crawler", agent);
 
 
 // unregister
 Registry.unregister(agent);
 // or
 category.unregister(agent);

Also its suggested to assume that creation/removing of categories is done automatically by Registry and Category classes.