-
Notifications
You must be signed in to change notification settings - Fork 0
Monitoring Capabilities
Monitoring agent is functionality that allows to
- gather information about available system resources
- CPU
- Memory
- Network
- 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 is launched on the same server with SUT.
- Pinging cometd COORDINATION_SERVER implementation
chassis.coordination.cometd.urland registers on COORDINATION_SERVER after it's available. - Receives Start command from COORDINATION_SERVER.
- Processes received through COORDINATION_SERVER commands and sends responses.
- Receives Stop command from COORDINATION_SERVER.
- goto 2.
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 doesn't need any configuration. It analyzes whole localhost resources (irrespective how many processes except SUT are launched there).
-
To enable SUT monitoring via JMX set
jmx.enabled=trueand add opened port (ports) tojmx.portsinagent.propertiesfile. -
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 -
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>