Oracle® Fusion Middleware Platform Developer's Guide for Oracle Real-Time Decisions 11g Release 1 (11.1.1) Part Number E16630-04 |
|
|
PDF · Mobi · ePub |
This chapter of the tutorial contains step-by-step instructions for utilizing Load Generator to simulate the run-time operation of the system. In general, Load Generator is used in three situations:
Performance: To characterize the performance of the system under load, measuring response time and making sure the whole system, including back-end data feeds, can cope with the expected load.
Initialize: To initialize the learnings and statistics with some significant data for demonstration purposes.
Process: To process off-line batch sources - for example, when exploring previously collected data at the initial stages of a project.
This chapter contains the following topics:
To evaluate performance under load, we will create a load-simulator script that calls the integration points defined in the Inline Service: Call Begin, Service Complete, and Call End. The script will call this series of three integration points multiple times, each time with different customer id's, call reason codes, agent names, and call lengths. The Reason Analysis model will learn on each of these iterations and we will be able to see the analysis results in Decision Center reports.
For this tutorial, we can think of Load Generator as simulating the CRM application making multiple iterations of integration point calls to Real-Time Decision Server. The Load Generator script (saved as an xml
file) that we create will contain the definition of this simulation.
Note:
When defining the Load Generator script, all references to Inline Service objects must be in the form of object IDs, not labels. To view the object IDs in Studio, use the object ID Toggle icon on the Inline Service Explorer taskbar:
For example, the ID for the Service Complete Informant is ServiceComplete
, the ID for the reason code Informant parameter is reasonCode
, and so forth.
This section contains the following topics:
Note:
To run client-side tools such as the Load Generator, you must have set up JAVA_HOME. For more information, see the section "Installing Java Development Kit for Oracle RTD Client tools" in Oracle Fusion Middleware Administrator's Guide for Oracle Real-Time Decisions.
To create the Load Generator script:
Open Load Generator by running RTD_HOME
\scripts\loadgen.cmd
. Then, click Create a new Load Generator script.
You can press F1 to read the online help for Load Generator. It explains the parameters that are not explained in this tutorial.
Select the General tab and enter values for the parameters as shown in Table 3-1.
Table 3-1 Parameters for General Tab
Parameter Name | Explanation | Value |
---|---|---|
Client Configuration File |
A properties file that indicates the protocol to be used to communicate with the server, what server to talk to and through what port. The default is to communicate using HTTP to the local server using port 8080. Please update the HTTP1.url parameter in the file to your RTD server and port values. For example, http://wlsserver1.company.com:9704. |
RTD_HOME\client\clientHttp
EndPoints.properties
|
Graph Refresh Interval in Seconds |
This parameter only affects the user interface. It determines the refresh rate for the UI graph and counters. The default is to refresh every 2 seconds. |
2 |
Inline Service |
This is the name we gave the Inline Service we created in the previous section. |
Tutorial |
Random Number Generator Seed |
The seed used to generate random numbers. Default is -1. |
-1 |
Think Time |
Think Time is the time in between transactions. In a session oriented load simulation you would give different numbers here. For this tutorial we will explore the maximum throughput, sending as many sessions as possible. Types of Think Time can be "Fixed Global Think Time" or "Ranged Global Think Time". |
Fixed Global Think Time |
Constant |
If the Think Time type is set to "Fixed Global Think Time", a parameter "Constant" appears and is the time (in seconds) to wait between transactions. "0" means Load Generator should send integration point requests to RTD Decision Server as quickly as the Decision Server can process the requests. |
0 |
Number of concurrent scripts to run |
This is the number of sessions active at any given point, running in parallel. In this case we will just run one session at a time. |
1 |
Maximum number of scripts to run |
The total number of sessions that will be created. Load Generator will stop sending events after this number has been reached. |
2000 |
Enable Logging |
Option to enable/disable loadgen counters log. This log maintains a history of loadgen performance data, including the number of requests sent by Load Generator, number of errors, the average and peak response times of a request, etc. If deselected, the remaining three logging parameters (Append to Existing File, Log File, Logging Interval in Seconds) are ignored. |
Deselected |
Append to Existing File |
Option to indicate whether to overwrite or append to an existing log file each time a loadgen script is run. |
Deselected |
Log File |
File path to an |
RTD_HOME\log\loadgen.csv
|
Logging Interval in Seconds |
This parameter only affects the Load Generator log. It determines the interval for writing to the log. The default is 10 seconds. |
10 |
In the path names, make sure to replace RTD_HOME
with the path where you installed the Oracle RTD client-side tools.
Note that parameters related to sessions cannot be changed in the middle of execution. More precisely, they can be changed, but their changes will not affect execution until the Load Generator script is stopped and restarted.
Save the configuration. Loadgen scripts created for an Inline Service can be bundled with the same project by saving the file to the etc
folder of the Inline Service project folder. If you had created the Tutorial Inline Service in the default workspace, the path would be similar to: C:\Documents and Settings\
Win_User
\Oracle RTD Studio\Tutorial\etc
. Name the script (an xml
file) anything you like (for example, TutorialLoadgen.xml
).
To define the values for the parameters to the Integration Point, click the Variables tab. Variables allow an Integration Point's parameter values to be drawn from different sources.
Note:
It is possible that not all the tree is visible on the left. To make it all visible, you can drag the bar dividing the two areas.
Right-click the Script folder and select Add Variable. Name it var_customerId
. In Contents, select Integer Range from 1 to 2000, sequential. This definition will create a variable that is computed once per session and goes from 1 to 2000 sequentially, that is, the first session will have var_customerId
= 1 and the last one will be 2000. Right-click Script and select Add Variable three more times for a total of four variables, as shown in Table 3-2.
Table 3-2 Variable Names and Values for Load Generator Script
Parameter Name | Content Type | Value |
---|---|---|
var_customerId |
Integer Range |
Minimum = 1, Maximum = 2000, Access type = Sequential |
var_reasonCode |
Integer Range |
Minimum = 17, Maximum = 20, Access type = Random |
var_agent |
String Array |
To add a string to the array, right-click on the table area and select Add Item. Then select (double-click) the newly created row to get a cursor and type the name to be used. Press the Enter key to register the value for that row. Add a few sample values of agent names (for example, John, Peter, Mary, and Sara). |
var_length |
Integer Range |
Minimum = 75, Maximum = 567, Access type = Sequential. This will be used as the length of the call in seconds. |
Select the Edit Script tab, then right-click the left area and select Add Action. We will add three actions, each corresponding to an integration point. We need the actions to be in the right order - CallBegin, ServiceComplete, and finally CallEnd.
For the first action, set the type to Message and the Integration Point name to CallBegin. In Input Fields, right-click and choose Add item to add an input field. Double-click in the space under Name and enter the value customerId; press Enter to register the new value. In the Variable column for customerId, choose var_customerId from the drop-down list. Select Session Key to identify this field as the session key.
For the action ServiceComplete, add three additional fields, as shown in Table 3-3.
Table 3-3 Additional Input Fields for ServiceComplete
Name | Variable |
---|---|
reasonCode |
var_reasonCode |
agent |
var_agent |
length |
var_length |
Again, the names here must match exactly with the incoming parameter IDs for the ServiceComplete Informant as seen in Decision Studio. Use the Toggle icon on the Inline Service Explorer task bar in Decision Studio to toggle between the label of the object and its object ID:
Figure 3-1 shows what the completed Input Fields section for ServiceComplete should look like.
Figure 3-1 Input Fields for ServiceComplete
In the Edit Script tab, right-click the left area and select Add Action. Set the type to Message and the Integration Point name to CallEnd. In Input Fields, right-click and chose Add item to add an input field. Set the Name to customerId
, the Variable to var_customerId
, and select Session Key.
In the Security tab, enter your User Name and Password.
Once again, save the Load Generator configuration script. Our Load Generator script now contains calls to three integration points. Make sure the order of the actions in the Edit Script tab is correct: CallBegin, ServiceComplete, and CallEnd. If not in this order, right-click the actions to move items up or down. Then, save the script again.
Go to the Run tab and press the Play button. Allow Load Generator to complete.
Note that there is a Pause button and a Stop button. The difference between these two is that Pause remembers the sequences and will continue from the point it was paused, whereas Stop resets everything.
Tip:
If you encounter problems, look at the Total Errors in the Run tab. If the number is above 0, look at the client-side and server-side log files, which may indicate what the problem is.
Client-side logs appear in the directory RTD_HOME
\log
. For example, RTD_HOME
\log\
client.log.0
.
For accessing server-side messages, see the section "Searching and Viewing Server-Side Log Files" in Oracle Fusion Middleware Administrator's Guide for Oracle Real-Time Decisions.
The server-side messages appear in a WebLogic Server diagnostics file, for example, <mw_home>
\user_projects\domains\bifoundation_domain\servers\bi_server1\logs\bi_server1-diagnostic.log
.
Common mistakes are:
The Inline Service has not been deployed.
There is a spelling or case mistake in the name of the Inline Service or the Integration Point.
The server is not running.
If the Total Requests stays at 1 and does not grow, there may be a mistake in the definition of the loadgen script. Some things to look for include:
In Integer Range variables, make sure the Minimum is below the Maximum.
Make sure that the mapping of values sent in messages to variables is correct. For example, if a variable name is changed, the mapping needs to be redone.
Make sure the Client Configuration file is correct.
You can use the Decision Center to check what has been learned by the models after running Load Generator. To do this:
Open Decision Center by opening a Web browser and going to the URL http://
server_name
:
9704
/ui
. Log in using the user name and password provided for you, as described in Section 2.2, "About Deployment and Decision Center Security."
Click Open Inline Services. The Select Inline Service window appears. Select Tutorial, then expand Call Reason and select one of the Choices, such as Make Payment. In the right pane, navigate to the Analysis tab and then the Best-fit subtab. This report summarizes the number of times this call reason was seen, and correlations between this call reason and attribute values.
You will see something interesting. The call reason code has an unexpectedly strong correlation to Make Payment, as shown in Figure 3-2.
Figure 3-2 Correlating Attribute Values for Make Payment
Since we generated the call data randomly with Load Generator variables, we would not expect to have any significant correlations. In this case, however, the call reason code (sent by the ServiceComplete Informant) absolutely determines the call reason (see Section 2.9.5, "Testing It All Together" for a discussion of this logic).
To remove this induced correlation, we should exclude this attribute from being used as an input to the model. Another type of attribute we might exclude from models is a customer's full telephone number. After all, it is unlikely that correlations can be found between unique telephone numbers and the reason he/she called. On the other hand, there may be correlations between the area codes of customers and the call reasons, so this would be an attribute that we would not exclude from the model. In the next section, you will exclude the 'reason code' attribute from the model and re-run the Load Generator script.
To exclude the reason code attribute:
In Decision Studio, open the Tutorial project.
Expand Service Metadata > Models, then double-click Reason Analysis from the Inline Service Explorer.
Go to the Attributes tab. In the lower table, titled Excluded Attributes, click Select to choose an attribute to exclude. Expand the Session node, then expand the call entity and select reason code. Click OK.
Save all and redeploy to the localhost
server.
You can now re-run the Load Generator script.
If you use Decision Center now to look at the counts, you will notice that they include the events from both runs of Load Generator. This happens because we did not reset the models between the two times we ran the Load Generator script.
Use the Enterprise Manager to reset the Model learnings, as follows:
Log in to the Enterprise Manager, using your User Name and Password.
In the left-hand navigation pane, expand the Application Deployments entry until you see OracleRTD.
Right-click the OracleRTD entry, and select System MBean Browser.
In the System MBean Browser navigation pane that appears, scroll down to Application Defined MBeans.
Expand OracleRTD under Application Defined MBeans, then expand the server where Oracle RTD is deployed.
Expand InlineServiceManager, then select the Tutorial.Development entry.
Click the Operations tab, then use the deleteAllOperationalData operation to remove all operational data, including the study, for this Inline Service.
To see the new results in Decision Center, run the Load Generator script again.
We have so far created a simple but fully functional Inline Service. We did so by starting with the definition of the data environment, the data source and entity for the customer, and then the entity for the current call data. After testing the basic functionality, we created several Integration Points and a model to perform the analysis. Logic was added to determine the reasons of the customer calls and to record occurrence of the different reasons in a model for analysis purposes. We then used Load Generator to simulate requests against Real-Time Decision Server and the Tutorial inline service. The results are then viewed in Decision Center.