Skip to main content
Last updated March 23, 2017 10:05, by thomas merten
Feedicon  

 

 

 



 

Java.net and this project forges will be closing permanently on April 28, 2017.

The project home has changed. The new location is now available.

Please go to http://www.java-mx-calibration-services.de/

 



 

 

 

Diagnostic & Calibration JIRA Plug-In Field Security - Performance Management for individual Best Fit Deployments

by Thomas Merten

SUN Java Management Extensions (JMX) Technology - Java SE Core Component

The JMX technology provides tools and API for building distributed, Web-based, modular and dynamic solutions for managing and monitoring devices, applications, and service-driven networks. By design, this SUN standard is suitable for adapting legacy systems, implementing new management and monitoring solutions, and plugging into those of the future.

Java MX Calibration Services Project on java.net

Based on Java Management Extensions API Java MX Calibration Services implements Diagnostic & Calibration functionality in Java EE Web Applications as part of Performance Management for individual Best Fit Deployments and essential Visibility into Java Web Transactions across your infrastructure. You identify performance problems and balance your Java Web Server remote at runtime via JMX supported Tools. Java Server Performance depends on CPU & Memory allocation. Tuning Performance is a calibration Process in reference to stability. JMX Calibration Services addresses this with Monitoring and Run-time Customizing of key parameters. Fail-over strategies are implemented and customizable while calibration process. JMX Calibration Services are pure J2EE Web Component for high traffic environments. By architecture, it runs on all Java Web Containers without any modification and requires a Servlet Specification 2.3 or later. JMX Calibration Services supports HTTP and JMX Monitoring and JMX Run-time Customizing. Log-Profiling is supported via file logging using the java.util.logging facility. Using JMX Calibration Services no hardware or software architecture changes required. The Implementation takes care about the relationships between Java Server Threads and the Java Memory Model(JMM) in multi core hardware environments.


 

Java MX Calibration Services Technology

NonFunctional Dynamic Code Analysis & Adaptive JUnit Integration

AOP & JMX Integration

Declarative AOP Aspectj Configuration specified Profiling Search Criteria. Defined Code Sequences will be monitored via MX Beans Attributes at Runtime. At the end of Calibration Process Nonfunctional Code Analysis will find best fit Code Sequences in relation to functional requirements.

<aspectj>
	<aspects>
		<concrete-aspect name="ServiceModelAspect" extends="calibration.java.mx.JMXAspect">
			<pointcut name="profile"	expression="execution(* angular.domain.ServiceModel.getEcho(..))" />
		</concrete-aspect>
	</aspects>
	<weaver options="-Xset:weaveJavaxPackages=false">
		<include within="angular.domain.*" />
	</weaver>
</aspectj>

AOP Configuration in /META-INF/aop.xml (classpath included)

nonfunctional AOP MXBeans Attributes:ASPECTJ NAME:type=POINTCUT EXPRESSION

JConsole MBeans View with Profiling AOP MXBeans Attributes

Adaptive JUnit Integration

	public class ServiceModelUnitTest extends JMXProfiler4UnitTest{
	/** The service model. */
	private ServiceModel serviceModel;
	/** The echo. */
	private final static String echo = "echo";

	/** The Constant CONCRETE_ASPECT_NAME. */
	private final static String CONCRETE_ASPECT_NAME = "ServiceModelAspect";
	/** The Constant POINTCUT_EXPRESSION. */
	private final static String POINTCUT_EXPRESSION = "ServiceModel.getEcho";
	/** The Constant MBEAN_ATTRIBUTE_VALUE. */
	private final static long MAX_METHODALLOCATEDBYTES = 1352L;

	@Test
	public void testServiceModel() throws InstanceNotFoundException, ReflectionException, MBeanException,MalformedObjectNameException, AttributeNotFoundException, NullPointerException{
		// FUCNTIONAL TESTING
		assertEquals(serviceModel.getEcho(), echo);

		//NONFUCNTIONAL DYNAMIC TESTING IN EXCLUSIVE SCOPE OF FUCNTIONAL TESTING
		checkMethodAllocatedBytes(CONCRETE_ASPECT_NAME, POINTCUT_EXPRESSION, MAX_METHODALLOCATEDBYTES);
		...

JUnit Test Case angular.domain.test.ServiceModelUnitTest with AOP MXBeans Attributes [extends JMXProfiler4UnitTest - a Java MX Calibration Framework Supportclass]

Monitoring JUnit Profiling

 
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running angular.domain.test.ServiceModelUnitTest

-------------------------------------------------------
JAVA MX CALIBRATION SERVICES
NonFunctional Dynamic Code Analysis - © 2017 Thomas Merten
-------------------------------------------------------
ASPECTJ NAME:                  ServiceModelAspect
POINTCUT EXPRESSION:           ServiceModel.getEcho
JMX ObjectName:               "ServiceModelAspect:type=ServiceModel.getEcho"
-------------------------------------------------------
getExecutions:                 1
getExecutionTime(ns):          36682816
getFailedExecutions:           0
getMethodAllocatedBytes(byte): 1352
getThreadAllocatedBytes(byte): 62059
-------------------------------------------------------
Output JUnit Test Case

 


Nonfunctional System Components

Java Calibration Services are pluggable over jmx-over-aspectj.jar registration in Web-Inf/lib directory of the JIRA Web Application and setup AOP using Java Property -javaagent:YOUR_PATH\aspectjweaver-1.8.9.jar. Nonfunctional System Components are configured as aspects via aspectj configuration in META-INF/aop.xml a specific critical Ressource. So critical Thread Informations are available over his standard JMX Components and associated with Java Calibration Services MX Beans which are registered on MBeanServer with ObjectName: j2ee.loadbalancer:type=NNN.

nonfunctional MX Beans: j2ee.loadbalancer:type=RechnerBalancer

 

Sequence Diagram(nonfunctional)

Java MX Calibration Services Sequence Diagram:

 

Functional Application Components

Here we demonstrate use of JMX Channnel Technology to remote control the Flow of a long running Java Server Face Task in a J2EE Web Container Environment. The Demo runs in Tomcat Web Container without any changes and demonstrates customized JMX realtime Profiling & Monitoring of Java EE LoadBalancer Parameters & JSF-CDI Bean Properties using SUN JConsole. Run-time Customizing of “Long running Tasks” is based on CurrentThreadId and registered as MXBeans with ObjectName: jsf.cdi.jmx.monitoring:type=NNN.

Java Server Faces Demo Web Application using Java MX Calibration Services: Download

functional MXBeans Operations:jsf.cdi.jmx.monitoring:type=RechnerBeanCDI.cancelOperation

 

UML Class Diagram(functional)

Java MX Calibration Services UML Class Diagram:

 

Calibration of Nonfunctional Components

MX Beans Attributes Runtime Customizing is used for Calibration of Nonfunctional Components

nonfunctional MXBeans Attributes:j2ee.loadbalancer:type=RechnerBalancer.EndPointMaxThreadPool

 


Run-time Customizing of Java MX Calibration Services Parameters(nonfunctional)

JMX Run-time Customizing of Semaphores Parameter to get the Best Fit profiling for your environment is supported. Set the parameter values for MAX_THREAD_COUNT and THREAD_BLOCKING_TIME to change configuration and Run-time Behavior in real-time to find Best Fit Settings for EAI Endpoint and System.

Monitor system changes in relation to your new Attribute settings (in Attribute Chart mode):

  • CurrentEndpointAllocatedBytes:[Information Readonly]

    CurrentEndpointAllocatedBytes returns an approximation of the total amount of memory, in bytes, allocated in heap memory for the last current Endpoint thread(while current jconsole jmx interval). Requires Java SE 1.7 .

  • CurrentEndpointAllocatedBytesRelative:[Information Readonly]

    CurrentEndpointAllocatedBytesRelative returns an approximation of the relative amount of memory, in percent, allocated in heap memory for the last current Endpoint thread (while current jconsole jmx interval) in relation to the total amount of memory allocated in heap memory for all live Threads. Requires Java SE 1.7 .

  • EndpointTotalAllocatedBytes:[Information Readonly]

    EndpointTotalAllocatedBytes returns an approximation of the total amount of memory, in bytes, allocated in heap memory for all Endpoint Threads based on the specified EndPoint URL-Pattern (while current jconsole jmx interval). Requires Java SE 1.7 .

  • EndpointTotalAllocatedBytesRelative:[Information Readonly]

    EndpointTotalAllocatedBytes returns an approximation of the total amount of memory, in percent, allocated in heap memory for all Endpoint Threads based on the specified EndPoint URL-Pattern (while current jconsole jmx interval) in relation to the total amount of memory allocated in heap memory for all live Threads. Requires Java SE 1.7 .

  • EndPointTotalCpuTime:[Information Readonly]

    EndPointTotalCpuTime is the total CPU time over all Endpoint threads(while current jconsole jmx interval) have executed in user mode plus system mode in nanoseconds. CPU time(all Endpoint threads) = user time(all Endpoint threads) + system time(all Endpoint threads)

  • EndPointTotalUserTime:[Information Readonly]

    EndPointTotalUserTime is the total CPU time over all Endpoint threads(while current jconsole jmx interval) have executed in user mode(running your application's own code) in nanoseconds.

  • EndPointTotalSystemTime:[Information Readonly]

    EndPointTotalSystemTime is the total CPU time over all Endpoint threads(while current jconsole jmx interval) have executed in system mode(running OS code on behalf of your application (such as for I/O)) in nanoseconds. user time(all Endpoint threads) = CPU time(all Endpoint threads) - user time(all Endpoint threads)

  • EndPointCountRelative:[Information Readonly]

    Amount of all Endpoint threads in relation to all JVM threads.

  • CurrentEndPointCpuTime: [Information Readonly]

    CurrentEndPointCpuTime is the amount of time that the last current Endpoint thread(while current jconsole jmx interval) has executed in user mode plus system mode in nanoseconds.Total time spent using a CPU for your application. CPU time = user time + system time
    That means: Server Application processing time used to serve the last current request.

  • Waiting_Thread_Count:[Information Readonly]

    Amount of all Endpoint threads waiting(THREAD_BLOCKING_TIME) until the Request-pool has new free thread resources

  • Current_Thread_Pool_Count:[Information Readonly]

    Amount of free Endpoint thread resources. Running Endpoint Threads = MAX_THREAD_COUNT-Current_Thread_Pool_Count

Prerequisites

Java MX Calibration Services requires:

  • Java Servlet Engine(Tomcat,...) with Servlet Specification 2.3 or later
  • Java SE 1.5
  • For Profiling & Runtime Customizing[Best Fit Calibration]: enabled JMX connection
  • Some Features like Endpoint Heap Memory Allocation Measuring requires Java SE 1.7
  • Integration & Development Thread JMX Beans based on Java Memory Model(JMM) Engineering
  • Implementation takes care about the relationships between Java Server Threads and the Java Memory Model(JMM) in multi core hardware environments.
  • Java MX Calibration Services are pluggable over calibration-java-mx-6.72.jar registration in classpath of your Java Application and administrated using Aspectj registration and configuration in /META-INF/aop.xml. Is configured as Aspect and mapped via pointcut expression to specific individual critical Ressource to profile. So critical Thread Informations are available over his standard JMX Components and associated with Java MX Calibration Services JMX Beans.
  • MAVEN Environment needs to install calibration-java-mx-6.72.jar via:
    mvn install:install-file -DgroupId=calibration.java.mx -DartifactId=calibration-java-mx -Dversion=6.72 -Dpackaging=jar -Dfile=YOUR_COMPLETE_PATH/calibration-java-mx-6.72.jar
    and register in pom.xml as Dependency:
    	<dependency>
    		<groupId>calibration.java.mx</groupId>
    		<artifactId>calibration-java-mx</artifactId>
    		<version>6.72</version>
    		<scope>runtime</scope>
    	</dependency>
    
    MAVEN Project pom.xml with Java MX Calibration
  • Set JVM ARGS for Aspectj Weaver Agent: -javaagent:YOUR_COMPLETE_PATH/aspectjweaver-1.8.9.jar -DJMX_REMOTE_PROFILING=true
    SET MAVEN_OPTS=-javaagent:YOUR_COMPLETE_PATH/aspectjweaver-1.8.9.jar -DJMX_REMOTE_PROFILING=true
    

Benefit

  • Individual Diagnostic & Calibration functionality for Java EE Web Applications
  • Standard Performance Management for individual Best Fit Deployments
  • Essential Visibility into Java Web Transactions across your infrastructure
  • Identify performance problems and balance your Java Web Server via JMX supported Tools
  • Monitoring and Run-time Customizing with build-in:
  • - functional application components MXBeans
    - nonfunctional system components MXBeans
  • SUN Standard Path: JMX API & JMX Tools =>Part of IBM/SUN Java SE >2008
  • SUN JConsole pluggable JMX Calibration Services MXBeans
  • Integration without hardware or software architecture changes
  • Fail-over functionality
  • Usability in development, test & runtime environments
  • AspectJ, URL - & Thread-Id based connectors

Cooperation Community

In the cooperation community with our clients, we will established an ideal basis to react to the concurrence of current changes on the online markets platform[Java EE => Java Ondemand Platform]. That is why the joint development of the JMX Calibration Services solutions as OpenSource Platform, meeting ever-changing requirements, contributes sustainably to the competitive edge of our business clients.

Moreover, we offers company-specific Quality Assurance process consultation with an ideal IT implementation within the cooperation community. Our expert knowledge, our implementation expertise and our experience from long-time cooperation with many e-commerce & high technology industry companies make us your ideal business partner.

Lizenz

Java MX Calibration Services is open source but not free.

  • Use in Evaluation Environment is possible - with the requirement that any copy acknowledges the product owner.
  • For use in Production Environment get in touch with us(Thomas Merten)

© 2014 Thomas Merten. Alle Rechte vorbehalten. Alle Warenzeichen sind Eigentum ihrer jeweiligen Inhaber. Angaben in diesem Dokument dienen nur der Produktbeschreibung und stellen keine zugesicherten Eigenschaften im Rechtssinn oder Garantien dar. Garantien bedürfen einer ausdrücklichen und schriftlichen Bestätigung. Änderungen und Anpassungen vorbehalten.

Limited warranty: Java MX Calibration Services Software and Documentation are "as is" without any warranty as to their performance, merchantability or fitness for any particular purpose. The licensee assumes the entire risk as to the quality and performance of the software. In no event shall Java MX Calibration Services or anyone else who has been involved in the creation, development, production, or delivery of this software be liable for any direct, incidental or consequential damages, such as, but not limited to, loss of anticipated profits, benefits, use, or data resulting from the use of this software, or arising out of any breach of warranty. This includes, but is not limited to, interruption of service, loss of classroom time or loss of consulting profits from the use of these programs.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Contact

Thomas Merten

My professional activities currently concentrate on hybris Core/eCommerce Profiling and Monitoring & SaaS Architectures.I am also interested in Oracle Siebel System Integrations. Previously, I worked in the ICT industry as Siebel Core Consultant. Presently I am working as a freelance consultant and software engineer in Europe. I am always looking for new and interesting projects, and you can hire me. Check out my profile and references to see if I may be able to help you. I contribute to the Java Platform with the Java MX Calibration Project at SUN Source.

Contact
thomas.merten@java.net

Resources & References

  • Tomcat Copyright ©  1999-2011, The Apache Software Foundation
  • java.net Copyright ©  2011, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
  • Axis2 Copyright ©  2004-2011 The Apache Software Foundation. All Rights Reserved.
  • JConsole, JDK, Java ©  2010, Oracle Corporation and/or its affiliates
  • LiveGraph This product includes software developed by the LiveGraph project and its contributors. (http://www.live-graph.org) Copyright © 2007 G. Paperin. All rights reserved.
  • SoapUI ©  2011 SmartBear Software. All rights reserved.
  • The Java Memory Model (William Pugh)
  • Article: How to get CPU, system, and user time for benchmarking (David R. Nadeau, Ph.D. )


Enterprise Product Suite: Quality First Program

 

   Java MX Calibration Services Project

 

   Java AOP Calibration Services Project

 

   Simplified Agile Processmanagement

 

   JIRA PlugIn - Field Security Project

 

 

 

©  2017 Thomas Merten. CIO & owner of this projects.

 
 
Close
loading
Please Confirm
Close