JMeter integration with AppDynamics

Similar documents
Apache JMeter HTTP(S) Test Script Recorder

JMETER - MONITOR TEST PLAN

SAIP 2012 Performance Engineering

So in order to grab all the visitors requests we add to our workbench a non-test-element of the proxy type.

Summer Internship 2013

Sophos Mobile Control Network Access Control interface guide

Using Application Insights to Monitor your Applications

Introducing the Microsoft IIS deployment guide

Availability Monitoring using Http Ping

CA APM Cloud Monitor. Scripting Guide. Release 8.2

The HTTP Plug-in. Table of contents

Configuring Network Load Balancing with Cerberus FTP Server

DEPLOYMENT GUIDE Version 1.1. Deploying the BIG-IP LTM v10 with Citrix Presentation Server 4.5

Specify the location of an HTML control stored in the application repository. See Using the XPath search method, page 2.

ExtraHop and AppDynamics Deployment Guide

Load testing with. WAPT Cloud. Quick Start Guide

Creating a generic user-password application profile

Streaming Media System Requirements and Troubleshooting Assistance

Apache JMeter. Emily H. Halili. Chapter No. 6 "Functional Testing"

Capario B2B EDI Transaction Connection. Technical Specification for B2B Clients

Issues in Information Systems

Office365Mon Developer API

Various Load Testing Tools

Elluminate Live! Access Guide. Page 1 of 7

Jive Connects for Openfire

Configuration Guide - OneDesk to SalesForce Connector

Configuring Nex-Gen Web Load Balancer

DEPLOYMENT GUIDE Version 1.2. Deploying the BIG-IP system v10 with Microsoft Exchange Outlook Web Access 2007

RemoteTM Web Server User Guide. Copyright Maxprograms

ISSN: (Online) Volume 2, Issue 1, January 2014 International Journal of Advance Research in Computer Science and Management Studies

Android Application Repackaging

UKCMG TEC 2010 Track P - Performance

Elluminate Live! Access Guide. Page 1 of 7

Configuring Single Sign-on for WebVPN

WELCOME TO CITUS CLOUD LOAD TEST

How to set up Outlook Anywhere on your home system

OpenSta OpenSource for Web Load, HTTP Stress & Performance testing

LICENSE4J LICENSE MANAGER USER GUIDE

Salesforce Opportunities Portlet Documentation v2

Stress Testing for Performance Tuning. Stress Testing for Performance Tuning

Consuming a Web Service(SOAP and RESTful) in Java. Cheat Sheet For Consuming Services in Java

Tenrox and Microsoft Dynamics CRM Integration Guide

IBM Information Server

HP Business Process Monitor

Force.com REST API Developer's Guide

Performance Analysis of webmethods Integrations using Apache JMeter Information Guide for JMeter Adoption

How To Test Your Web Site On Wapt On A Pc Or Mac Or Mac (Or Mac) On A Mac Or Ipad Or Ipa (Or Ipa) On Pc Or Ipam (Or Pc Or Pc) On An Ip

AD Phonebook 2.2. Installation and configuration. Dovestones Software

Building a Multi-Threaded Web Server

Zabbix Manual.

DEPLOYMENT GUIDE DEPLOYING THE BIG-IP LTM SYSTEM WITH CITRIX PRESENTATION SERVER 3.0 AND 4.5

Dynamic DNS How-To Guide

Managing Virtual Servers

Web Load Stress Testing

Introducing the BIG-IP and SharePoint Portal Server 2003 configuration

WebLogic Server 6.1: How to configure SSL for PeopleSoft Application

Distribution and Integration Technologies

DEPLOYMENT GUIDE Version 1.0. Deploying the BIG-IP Edge Gateway for Layered Security and Acceleration Services

Paynow 3rd Party Shopping Cart or Link Integration Guide

DEPLOYMENT GUIDE Version 2.1. Deploying F5 with Microsoft SharePoint 2010

BEA Weblogic Guide to Installing Root Certificates, Generating CSR and Installing SSL Certificate

White Paper. Mobilizing your Business with Enterprise Mobility Services Middleware. By Cary Jensen

A Java proxy for MS SQL Server Reporting Services

How To Integrate IIS6 and Apache Tomcat

RTI v3.3 Lightweight Deep Diagnostics for LoadRunner

Fairsail REST API: Guide for Developers

Load Balancing BEA WebLogic Servers with F5 Networks BIG-IP v9

Manage Workflows. Workflows and Workflow Actions

VMware vcenter Log Insight User's Guide

Deploying the BIG-IP LTM System and Microsoft Outlook Web Access

KC Data Integration Web Service Developer Guide

Performance Testing Web 2.0

Quick Start Guide. Installation and Setup

How-To: Submitting PDF forms to SharePoint from custom websites

Deploying RSA ClearTrust with the FirePass controller

Deploying the BIG-IP System v10 with SAP NetWeaver and Enterprise SOA: ERP Central Component (ECC)

Using Foundstone CookieDigger to Analyze Web Session Management

1. To ensure the appropriate level of security, you will need Microsoft Windows XP or above.

The interactive HTTP proxy WebScarab Installation and basic use

Ehcache Web Cache User Guide. Version 2.9

IRF2000 IWL3000 SRC1000 Application Note - Apps with OSGi - Condition Monitoring with WWH push

Connected Data. Connected Data requirements for SSO

Introduction. AppDynamics for Databases Version Page 1

The presentation explains how to create and access the web services using the user interface. WebServices.ppt. Page 1 of 14

2. Follow the installation directions and install the server on ccc

JAVASCRIPT AND COOKIES

MultiSite Manager. User Guide

OPC Unified Architecture - Connectivity Guide

Monitoring Oracle Enterprise Performance Management System Release Deployments from Oracle Enterprise Manager 12c

DEPLOYMENT GUIDE Version 1.2. Deploying F5 with Microsoft Exchange Server 2007

Deployment Guide. AX Series with Microsoft Office SharePoint Server

SafeNet KMIP and Google Cloud Storage Integration Guide

Table of Contents INTRODUCTION Prerequisites... 3 Audience... 3 Report Metrics... 3

XIA Configuration Server

Remote Access API 2.0

EventSentry Overview. Part I Introduction 1 Part II Setting up SQL 2008 R2 Express 2. Part III Setting up IIS 9. Part IV Installing EventSentry 11

INSTALLATION GUIDE V2.1 (DRAFT)

Website Builder Overview

This presentation covers virtual application shared services supplied with IBM Workload Deployer version 3.1.

Transcription:

JMeter integration with AppDynamics Purpose The business use case is to accelerate time to market by understanding quickly, with AppDynamics, the bottleneck of performance and the root cause of issues during load testing with JMeter. The purpose of JMeter integration with AppDynamics is to: 1. Offer a correlated view between JMeter measurements (HTT Request) and AppDynamics measurements (Business Transaction). JMeter simulates end-user activity by launching thread group and by executing HTTP request. AppDynamics retrieves dynamically the name of JMeter HTTP request and stores the metrics in a AppDynamics Business Transaction (BT) 2. Create a custom time range in AppDynamics in relation with the duration of JMeter execution; and compare easily two JMeter executions or analyze specifically the result of one JMeter execution 3. Retrieve the JMeter Thread name within the AppDynamics snapshot (i.e. capture request details and give visibility to call graph which reflects the code-level view); and diagnose easily why JMeter Thread fails Note: this integration has been done with JMeter 3.1 and AppDynamics 4.2. It should work with other versions. 1) Configure the correlated view between JMeter HTTP Request and AppDynamics BT JMeter - Test Plan AppDynamics - Business Transactions 1

How to configure JMeter (with AppDynamics) Start JMeter and open the Test Plan Append a HTTP Header Manager (right click on Thread Group, select Add/Config Element/HTTP Header Manager) on Thread Group Add a header o Set name with AppD_Header and value with ${ samplername and click on Save See below the expected result How to configure AppDynamics (with JMeter) Connect to AppDynamics Controller Select the application Click on Configuration Click on Instrumentation In "Custom Match Rules" section, click on the + button 2

Select servlet and click on Next Set following values: o Name = JMeter o o URI = is Not Empty Header = Check for parameter existence, name = AppD_Header 3

Click on tab "Split Transactions Using Request Data" and set the following values: o Check "Split Transactions Using request Data" o Select "Use a header value" in Transaction names and set value = AppD_Header Click on Save 4

2) Create a custom time range in AppDynamics in relation with duration of JMeter execution See below examples of custom time range created by JMeter execution. The name is based on JMeter Test plan name and date & hour of end of JMeter execution. - TestPlan_Tomcat Dec 20 16:27 - TestPlan_Tomcat Dec 20 17:11 - TestPlan_Tomcat Dec 20 17:24 - TestPlan_Tomcat Dec 20 17:27 - TestPlan_Tomcat Dec 21 09:41 - How to configure JMeter (with AppDynamics) Prerequisite: have a test plan name with no space, the name will be retrieved dynamically and it will be used to setup the name of custom range. Prefer a name like TestPlan_Tomcat.jmx instead of TestPlan Tomcat.jmx Start JMeter and open the Test Plan Add a setup Thread Group Add a JSR223 Sampler below setup Thread Group and call it AppDynamics - Start time - JSR223 Sampler Configure AppDynamics - Start time - JSR223 Sampler with a JavaScript language and append the following code log.info("setup Thread Group - AppDynamics"); 5

// Calculate epoch time in seconds of starting test var starttest = Math.floor( Date.now() - 1 * 60 * 1000); // Set the epoch time in a property props.setproperty("appd_start_time", starttest); The result is as follows: Add a teardown Thread Group Add a JSR223 Sampler below teardown Thread Group and call it AppDynamics - End time - JSR223 Sampler Configure AppDynamics - End time - JSR223 Sampler with a JavaScript language and append the following code log.info("teardown AppDynamics"); // Calculate epoch time in seconds of starting test var endtest = Math.floor( Date.now() ); // Set the epoch time in a property props.setproperty("appd_end_time", endtest); The result is as follows: 6

Add a JSR223 Sampler below teardown Thread Group and call it AppDynamics - Create time range - JSR223 Sampler Configure AppDynamics - End time - JSR223 Sampler with a Java language (not JavaScript); set Parameters value to ${ TestPlanName Append the following code: o The values in regards of AppDynamics Controller should be configured correctly: host, o port, protocol and base64 authentication string. Go to https://www.base64encode.org/ to encode the authentication string in base64 format ; the format of authentication string is username@customer1:password import java.io.*; import java.net.*; import java.nio.charset.standardcharsets; import java.text.simpledateformat; import java.util.date; String appdcontroller = "localhost"; String appdport = "8090"; String appdprocol = "http"; // Go to https://www.base64encode.org/ to encode the authentication string => username@customer1:password String appdbase64authent = "YWRtaW5AY3VzdG9tZXIxOkFwcER5bmFtaWNz"; String appdendtime = props.get("appd_end_time"); //System.out.println("AppDynamics - AppD_End_Time=" + appdendtime); String appdstarttime = props.get("appd_start_time"); //System.out.println("AppDynamics - AppD_Start_Time=" + appdstarttime); // Connect to AppDynamics Controller StringBuilder result = new StringBuilder(); URL url = new URL(appdProcol + "://" + appdcontroller + ":" + appdport + "/controller/auth?action=login"); HttpURLConnection conn = (HttpURLConnection) url.openconnection(); conn.setrequestproperty("authorization", "Basic " + appdbase64authent); conn.setrequestmethod("get"); 7

BufferedReader brlogin = new BufferedReader(new InputStreamReader(conn.getInputStream())); // If we are correctly connected to AppDynamics Controller if (conn.getresponsecode() == 200) { String headername = null; String appdcookie = ""; for (int i=1; (headername = conn.getheaderfieldkey(i))!=null; i++) { if (headername.equals("set-cookie")) { appdcookie += conn.getheaderfield(i) + " ;"; //System.out.println("appdCookie=" + appdcookie); URL urlcustomrange = new URL(appdProcol + "://" + appdcontroller + ":" + appdport + "/controller/restui/user/createcustomrange"); HttpURLConnection conncustomrange = (HttpURLConnection) urlcustomrange.openconnection(); conncustomrange.setrequestmethod("post"); conncustomrange.setdooutput(true); conncustomrange.setrequestproperty("authorization", "Basic " + appdbase64authent); conncustomrange.setrequestproperty("content-type", "application/json"); conncustomrange.setrequestproperty("charset", "utf-8"); conncustomrange.setrequestproperty("accept-encoding", "gzip, deflate"); conncustomrange.setrequestproperty("accept", "application/json, text/plain"); conncustomrange.setrequestproperty("cookie", appdcookie); // If the Test Plan name has been setup correctly in Parameters of this script if (args.length > 0) { String appdtestplan = args[0]; // Remove the extenson.jmx from file name if (appdtestplan.indexof(".jmx")!= -1) { appdtestplan = appdtestplan.substring(0, appdtestplan.indexof(".jmx")); Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("MMM dd HH:mm"); appdtestplan += " " + sdf.format(date); String postjsondata = "{\"name\":\"" + appdtestplan + "\",\"description\":\"jmeter execution\",\"shared\":true,\"timerange\":{\"type\":\"between_times\",\"durationinminutes\":0,\"starttime\":" + appdstarttime + ",\"endtime\":" + appdendtime +""; DataOutputStream wr = new DataOutputStream(connCustomRange.getOutputStream()); wr.writebytes(postjsondata); wr.flush(); wr.close(); if (conncustomrange.getresponsecode()!= 200) { System.out.println("AppDynamics - Unable to create time range" + urlcustomrange + " HTTP Code=" + conncustomrange.getresponsecode()); // Else the Test Plan name has been not setup correctly in Parameters of this script else { System.out.println("AppDynamics - the test plan name has not been setup in parameters"); else { System.out.println("AppDynamics - Unable to connect to Controller" + url + " HTTP Code=" + conn.getresponsecode()); brlogin.close(); The result is as follows: 8

Configure the Test plan by checking run teardown Thread Groups after shutdown of main threads. The teardown threads won't be run if the test is forcibly stopped and it will avoid useless creation of custom time range in AppDynamics. The result is as follows: 9

How to configure AppDynamics (with JMeter) Make a browser refresh of AppDynamics Controller page to see the new Custom time range 10

3) Retrieve the JMeter Thread name within the AppDynamics snapshot Here, the thread name My Thread Group A 1-1 has failed on request Scen1 4 Book : AppDynamics (with the corresponding snapshot) explains why there is a failure. To retrieve all AppDynamics snapshots in regards of a JMeter Tread name: Open Transaction Snapshots page Set a criteria with Collector Type=HTTP Parameter, Name=Header-AppD_ThreadName and Value= My Thread Group A 1-1 Open the snapshot of Business Transaction JMeter.Scen1 4 Book which has the Error status 11

Analyze the flow map and access to call-graph or exception detail How to configure JMeter (with AppDynamics) Start JMeter and open the Test Plan Open the HTTP Header Manager Add a header o Set name with AppD_ThreadName and value with ${ BeanShell(ctx.getThread().getThreadName()) and click on Save See below the expected result 12

How to configure AppDynamics (with JMeter) Connect to AppDynamics Controller Select the Application Click on Configuration Click on Instrumentation Click on >> and Data Collectors Select Default HTTP Request Data Collectors and click on Edit Set a Header with the value AppD_ThreadName Click on Save 13

14