Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
jmsrpp
Advisor
Advisor

As promised, this is the next iteration of a blog discussing performance testing in BI 4.1 with Apache JMeter.  You can find the first installment, which covered logon and the refresh of a Web Intelligence report here.

The next BI client in the queue is Explorer.  This test plan allows you to invoke a previously created Exploration View set, built against a HANA calc view, to generate some load against both the application server and Explorer processes.  The part of the test plan dealing with Explorer looks like this:

You can see that most of the activity comes from a file called polestar_xml.jsp and that there is a single regular expression extractor attached to the config.jsp file.  Explorer leverages both a serialized session and a session token to grant access to the application, a similar mechanism to that used with Dashboards (Xcelsius) and other components that leverage the dswsbobje web service.  A serialized session might look something like this:

3&ua=Af9fX5We.TVJu_6eVqnxufQ,8P&ub=AYkbBSzo531Dh0EtfE3E1Kg,8P&S5,88&5U=31426Joccm05Vhf6dtoNos4Z3Nz431425Jxcqkwu2oh9maQN1dwQV8px,
8P&63=secEnterprise,8P&PP=1024,83&2r=RUBI41P3:6400,8P&3k=@RUBI41P3:6400,8P&1,8P&4E=31425Jxcqkwu2oh9maQN1dwQV8px,8P&Tn={3&.1={3&2=6794,83&O=FavoritesFolder,8P},?z&.2={3&2=6795,83&O=PersonalCategory,8P},?z&U=3,83&.3={3&2=6796,83&O=Inbox,8P},?z},?z&4F=6744,8P&Tm=36500,83&lu=1033,83&35=jmeter1,8P&uy=-124,8L&7r,83&ux=ATPEmyl8ZyRKp7Q1RgNXGN4,8P&pa,8P&zA,83

This contains all sorts of useful information such as the authentication type, user name, Favorites Folder, and Personal Category.

A session token is a shorter string that looks like this:

RUBI41P3:6400@31430JjCiBJe0XMx7HRbew1wzRaO31425Jxcqkwu2oh9maQN1dwQV8pxONEOFF

The string represents the CMS that generated the session, as well as the logon token used to access the platform.

First, it is necessary to extract the user's serialized session from the Logon transaction controller and the main.do request.  The regular expression extractor should contain the following properties:

For reference (and ease of copying) the regular expression to use for this is:

serializedSession: '(.+?)',

This value is going to be URL encoded since there are a massive number of URL unfriendly characters such as &, { }, etc.  Once we have the infoviewses variable, it will be attached to the index.jsp request to gain initial access to Explorer.  The URL parameters of index.jsp should be configured as such:

Note that we need to check the Encode? box to ensure the value is passed correctly.  With this option enabled for the serialized session above we see the following URL encoded value:

3%26ua%3DAf9fX5We.TVJu_6eVqnxufQ%2C8P%26ub%3DAYkbBSzo531Dh0EtfE3E1Kg%2C8P%26S5%2C88%265U%3D
31426Joccm05Vhf6dtoNos4Z3Nz431425Jxcqkwu2oh9maQN1dwQV8px%2C8P%2663%3DsecEnterprise%2C8P
%26PP%3D1024%2C83%262r%3DRUBI41P3%3A6400%2C8P%263k%3D%40RUBI41P3%3A6400%2C8P
%261%2C8P%264E%3D31425Jxcqkwu2oh9maQN1dwQV8px%2C8P%26Tn%3D%7B3%26.1%3D%7B3%262
%3D6794%2C83%26O%3DFavoritesFolder%2C8P%7D%2C%3Fz%26.2%3D%7B3%262%3D6795%2C83%26O
%3DPersonalCategory%2C8P%7D%2C%3Fz%26U%3D3%2C83%26.3%3D%7B3%262%3D6796%2C83%26O%3DInbox
%2C8P%7D%2C%3Fz%7D%2C%3Fz%264F%3D6744%2C8P%26Tm%3D36500%2C83%26lu%3D1033%2C83%2635%3Djmeter1%2C8P%26uy%3D-124%2C8L%267r%2C83%26ux%3DATPEmyl8ZyRKp7Q1RgNXGN4%2C8P%26pa%2C8P%26zA%2C83

Fun isn't it?  This request grants us access to Explorer.  From here it is simply a matter of adjusting the XML Parameter required in each of the polestar_xml.jsp calls.  Note that each of these requests has a parameter attached to it called xmlParameter as below:

This value actually has the session token embedded within it!  In order to correctly invoke Explorer functionality we need to adjust each response body as follows:

%3CdataDiscovery%3E%3Cheaders%3E%3CcorrelationId%3E793453CD%2D5598%2D0424%2D9A39%2D4C33A678A6C0%3C%2FcorrelationId
%3E%3CtransactionId%3EEC543466%2D4602%2D66A3%2D14B8%2D4C33A678D36F%3C%2FtransactionId%3E%3C%2Fheaders%3E%3C
session%20token%3D%22${__javaScript(encodeURIComponent('${sestoken}'))}%22%20locale%3D%22en%5FUS%22%2F%3E%3Crequest%3E
%3CgetEvents%20timeout%3D%220%22%2F%3E%3C%2Frequest%3E%3C%2FdataDiscovery%3E

This is where JMeter really shows what an awesome product it is.  We are able to transform the contents of the sestoken variable by invoking a JavaScript method called encodeURIComponent.  This translates the session token above into this format:

RUBI41P3%3A6400%4031430JjCiBJe0XMx7HRbew1wzRaO31425Jxcqkwu2oh9maQN1dwQV8pxONEOFF

Now use the text replacement process I discussed in the previous blog post to update the JMX file so that each occurrence of xmlParameter contains the JMeter function:

${__javaScript(encodeURIComponent('${sestoken}'))}

as the contents of the session token string.  Hopefully this example helps illustrate just how powerful JMeter can be in terms of executing scripts as part of your performance testing process.

Once you have correctly updated each of the polestar_xml.jsp requests you are ready to execute the Explorer section of your performance test.  By looking at the View Results Tree component for the polestar_xml.jsp calls we can see Explorer feeding us customized XML:

You can see the name of the connection, the measures in the view set, and numerous other properties associated with the Exploration.  This covers Explorer performance testing ... next week I am at SBOUC but expect a final supplement to this blog the following week when I'll cover Analysis Edition for OLAP.