Skip to content

Monitoring Capabilities

nmusienko edited this page Feb 18, 2013 · 12 revisions

Monitoring Capabilities

Monitoring agent is functionality that allows to

  1. gather information about available system resources
    • CPU
    • Memory
    • Network
  2. gather information about testing system via JMX
    • Heap memory and non heap memory
    • Minor and major GC runs.

Monitoring agent is located at JAGGER_HOME/monitoring/agent/

Current implementation uses Sigar for system resources monitoring and javax.management.MBeanServerConnection for information about System Under Test (SUT) gathering.

Monitoring agent life-cycle.

  1. Monitoring agent is launched on the same server with SUT.
  2. Pinging cometd COORDINATION_SERVER implementation chassis.coordination.cometd.url and registers on COORDINATION_SERVER after it's available.
  3. Receives Start command from COORDINATION_SERVER.
  4. Processes received through COORDINATION_SERVER commands and sends responses.
  5. Receives Stop command from COORDINATION_SERVER.
  6. goto 2.

Monitoring configuration

Agent(s) will register on COORDINATION_SERVER if agent(s) started on SUT server. Agent can monitor more than one jmx service. To make MASTER wait for agent(s) set properties in corresponding environment.properties

chassis.conditions.monitoring.enable=true
chassis.conditions.min.agents.count=2
jmx.services=localhost:9875,localhost:9885

Polling interval (how often KERNEL sends commands to monitoring agent) could be configured with property chassis.monitoring.pollinginterval. Default value (value defined in default.environment.properties) is 100 milliseconds.

Sigar configuration.

Sigar doesn't need any configuration. It analyzes whole localhost resources (irrespective how many processes except SUT are launched there).

JMX monitoring configuration.

  1. To enable SUT monitoring via JMX set jmx.enabled=true and add opened port (ports) to jmx.ports in agent.properties file.

  2. To open JMX port during SUT start add properties to application server start script:

    -Dcom.sun.management.jmxremote.port=9870 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
    
  3. Monitoring agent could be launched using maven:

mvn -f JAGGER_HOME/trunk/monitoring/agent/pom.xml clean install -e -Prun


Or from command line:

java -classpath "./modules/chassis/:./modules/diagnostics/:./lib/*:./configuration/boot/" -Djava.library.path=./lib/native com.griddynamics.jagger.agent.AgentStarter


## Monitoring task configuration

Monitoring can used as standalone task or as attendant to workload. To run monitoring as a standalone task you have to specify the `MonitoringTask` in a configuration.

```xml
 <bean id="monitoring" class="com.griddynamics.jagger.monitoring.MonitoringTask">
     <property name="name" value="Monitoring" />
     <property name="terminationStrategy">
         <bean class="com.griddynamics.jagger.monitoring.TerminateMonitoringByDuration">
             <property name="seconds" value="180"/>
         </bean>
     </property>
  </bean>

To use monitoring as an attendant to workload task you have to use CompositeTask. Children of composite task will be executed in parallel. Here is a sample composite configuration:

    <bean id="composite" class="com.griddynamics.jagger.master.CompositeTask">
        <property name="leading">
            <bean>
                ... 
                Some workload configuration
                ...            
            </bean>
        </property>
        <property name="attendant">
            <list>
                <bean class="com.griddynamics.jagger.monitoring.MonitoringTask">
                    <property name="name" value="Monitoring"/>
                    <property name="terminationStrategy">
                        <bean class="com.griddynamics.jagger.monitoring.InfiniteDuration"/>
                    </property>
                </bean>
            </list>
        </property>
     </bean>

Not that execution of the task will be completed when all leading tasks are done, attendant tasks will be forced to shut down so you can specify InfiniteDuration as a termination strategy.

To be able to view monitoring reporting monitoringAggregator have to added to configuration task execution listeners list:

    <bean id="configuration"
          class="com.griddynamics.jagger.master.configuration.Configuration" abstract="true">
        <property name="sessionExecutionListeners">
            <list>
                ...
                listeners list
                ...               
            </list>
        </property>
        <property name="taskExecutionListeners">
            <list>
                ...
                other listeners
                ...
                <ref bean="monitoringAggregator"/>
            </list>
        </property>
    </bean>

Clone this wiki locally