r3 - 2019-01-14 - 10:32:49 - DineshKumarYou are here: TWiki >  Deployment Web > WebPreferences > CLMMonitoringMBeans > CreateCustomScenarios

Register Custom Scripts As a Resource Intensive Scenario todo.png

Authors: ShubjitNaik, DineshKumar
Build basis: CLM 6.0.5 or Higher

There are specific user and system scenarios across the CLM portfolio that can potentially drive higher load on a Jazz application. Starting with CLM 6.0.4 we have identified a set of known resource-intensive scenarios in each application and are exposing them as JMX MBeans. Refer Known Resource-intensive Scenarios

However there are cases where a custom functionality could be a potential resource-intensive scenario, for example a custom Java script or a plugin making REST APIs call to a CLM application. Such custom functionality needs to be monitored as well when looking at the overall application performance. This article focuses on a method to record and publish such custom functionality as resource-intensive scenario to help track their usage.

Starting and Stopping Custom Resource-Intensive Scenarios

Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text Section text

Starting a Custom Resource-Intensive Scenario

Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text

Monitoring or Viewing the Custom Resource-Intensive Scenario

Stopping the Custom Resource-Intensive Scenario

Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text Sub-Section text

Viewing the Custom Scenario Statistics

Example - Register a Resource-Intensive Scenario using Curl Script

RESTClient allows using JSESSIONID from existing session, as a value to “X-Jazz-CSRF-Prevent” header. For Curl, below command line can be used to create a valid session. Below sample further, captures the session in a variable for use with other commands

Declare a USER, PWD and COOKIES variables to begin with: _$ USER=vapp $ PWD=Pa88w0rd $ COOKIES=cookies.txt_

Perform the authentication and capture the cookies _$ curl -k -c $COOKIES https://rtc-606-on-db2.svl.ibm.com:9443/ccm/authenticated/identity $ curl -k -L -b $COOKIES -c $COOKIES -d j_username=$USER -d j_password=$PWD https://rtc-606-on-db2.svl.ibm.com:9443/ccm/authenticated/j_security_check_

Start Scenario : Using a JSON file for the scenario object

_$ echo {scenarioName: \"curlScenario01\"} > scenarioName.json

$ curl -X POST -k -b $COOKIES -H 'Content-Type: application/json' -H 'Accept: application/json' 'https://rtc-606-on-db2.svl.ibm.com:9443/ccm/service/com.ibm.team.repository.service.serviceability.IScenarioRestService/scenarios/*startscenario*' -d @scenarioName.json > scenarioResponse.json_

Start Scenario : Passing Scenario details as JSON object directly in command line

$ curl -X POST -k -b $COOKIES -H 'Content-Type: application/json' -H 'Accept: application/json' 'https://rtc-606-on-db2.svl.ibm.com:9443/ccm/service/com.ibm.team.repository.service.serviceability.IScenarioRestService/scenarios/*startscenario*' --data "{\"scenarioName\": \"curlScenario01\"}" > scenarioResponse.json

POST to startscenario results in marking the beginning of a new instance of the scenario, the RESPONSE from the POST has the details of the instance :

{"scenarioName":"curlScenario01","scenarioInstanceId":"_4fTGABQTEemlX9f2gd8Dpw","scenarioHeaderKey":"x-com-ibm-team-scenario","scenarioHeaderValue":"_4fTGABQTEemlX9f2gd8Dpw%3Bname%3DcurlScenario01"}

scenarioHeaderValue shows which scenario this instance belongs to.

Run Requests that are part of this scenario

Here is an example request that invokes a work item query : curl -X GET -k -b $COOKIES https://rtc-606-on-db2.svl.ibm.com:9443/ccm/oslc/contexts/_kEYLgAUhEemlX9f2gd8Dpw/workitems -H 'Accept: application/rdf+xml'

Stop Scenario _$ curl -X POST -k -b $COOKIES -H 'Content-Type: application/json' -H 'Accept: application/json' -i 'https://rtc-606-on-db2.svl.ibm.com:9443/ccm/service_/com.ibm.team.repository.service.serviceability.IScenarioRestService/scenarios/*stopscenario*' -d @scenarioResponse.json

Counters get updated after the scenario stops.

Updated scenario and instance counts can be seen in the “scenarios” section of the application admin counters page, here is the URL: https://:/ccm/admin?internal#*action=com.ibm.team.repository.admin.viewCounters*

Related topics: Deployment web home, Deployment web home

External links:

Additional contributors: TWikiUser, TWikiUser

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Contributions are governed by our Terms of Use. Please read the following disclaimer.
Ideas, requests, problems regarding the Deployment wiki? Create a new task in the RTC Deployment wiki project