Commit 43d890cf 43d890cfeb332c0078e2ebcd482d7174635d85e2 by Christian Gerdes
2 parents 7dbe2d8d d972950b
......@@ -61,8 +61,11 @@ public class Actions
{
String instance = oracle.getDBName();
sendDataPoint("ORA Cpus (#) " + instance, oracle.getNumberOfCPUs());
sendDataPoint("ORA Cpu Time (ms/s) " + instance, oracle.getCPUTimePerSecond());
sendDataPoint("ORA Cpu Time (us/s) " + instance, oracle.getCPUTimePerSecond());
sendDataPoint("ORA Cpu Usage (%) " + instance, oracle.getCPUPercent());
sendDataPoint("ORA OS Busy (%) " + instance, oracle.getOsBusyPercent());
sendDataPoint("ORA OS Load (#) " + instance, oracle.getOsLoad());
sendDataPoint("ORA OS Load per Cpu (#) " + instance, oracle.getOsLoadPerCPU());
sendDataPoint("ORA Logical Reads (#/s) " + instance, oracle.getLogicalReadsPerSecond());
sendDataPoint("ORA Consistent Gets (#/s) " + instance, oracle.getPerSecondValue("consistent gets"));
sendDataPoint("ORA DB Block Gets (#/s) " + instance, oracle.getPerSecondValue("db block gets"));
......
/*
* LoadRunner Java script. (Build: _build_number_)
*
* Script Description:
*
*/
import java.util.ArrayList;
import lrapi.lr;
import se.lil.om.*;
public class Actions
{
ArrayList<OraMon> oraList = new ArrayList<OraMon>();
boolean firstIteration = true;
String empty = "";
public int init() throws Throwable
{
if(lr.get_attrib_string("ConnectionString") == null || lr.get_attrib_string("User") == null || lr.get_attrib_string("Password") == null ||
lr.get_attrib_string("ConnectionString").equals(empty) || lr.get_attrib_string("User").equals(empty) || lr.get_attrib_string("Password").equals(empty))
{
lr.error_message("Attributes are missing for Oracle: ConnectionString, User or Password are null. Nothing to do, aborting vuser.");
lr.exit(lr.EXIT_VUSER, lr.FAIL);
}
String[] conS = lr.get_attrib_string("ConnectionString").split(",");
String[] usrS = lr.get_attrib_string("User").split(",");
String[] pasS = lr.get_attrib_string("Password").split(",");
if(conS.length != usrS.length || conS.length != pasS.length)
{
lr.error_message("Oracle has multiple comma separated connection strings but not the same number of multiple user or password strings. Cannot continue, abort.");
lr.exit(lr.EXIT_VUSER, lr.FAIL);
}
for(int x=0; x<conS.length; x++)
{
OraMon mon = new OraMon();
lr.debug_message (lr.MSG_CLASS_EXTENDED_LOG , " Using " + conS[x].trim() + " User " + usrS[x].trim() + " Pass " + pasS[x].trim());
mon.open(conS[x].trim(), usrS[x].trim(), pasS[x].trim());
oraList.add(mon);
}
return 0;
}////end of init
public int action() throws Throwable
{
for(OraMon oracle : oraList)
{
lr.debug_message (lr.MSG_CLASS_EXTENDED_LOG , "#### ORACLE COUNTERS ####");
lr.debug_message (lr.MSG_CLASS_EXTENDED_LOG, "Using: " + oracle.getConString());
oracle.getData();
lr.debug_message (lr.MSG_CLASS_EXTENDED_LOG, "Returned DB Name: " + oracle.getDBName());
if(firstIteration == false)
{
String instance = oracle.getDBName();
sendDataPoint("ORA Cpus (#) " + instance, oracle.getNumberOfCPUs());
sendDataPoint("ORA Cpu Time (ms/s) " + instance, oracle.getCPUTimePerSecond());
sendDataPoint("ORA Cpu Usage (%) " + instance, oracle.getCPUPercent());
sendDataPoint("ORA Logical Reads (#/s) " + instance, oracle.getLogicalReadsPerSecond());
sendDataPoint("ORA Consistent Gets (#/s) " + instance, oracle.getPerSecondValue("consistent gets"));
sendDataPoint("ORA DB Block Gets (#/s) " + instance, oracle.getPerSecondValue("db block gets"));
sendDataPoint("ORA Cache Hit Ratio (%) " + instance, oracle.getCacheHitRatioPercent());
sendDataPoint("ORA Buffer Cache Hit Ratio (%) " + instance, oracle.getBufferCacheHitRatioPercent());
sendDataPoint("ORA DB Block Changes (#/s) " + instance, oracle.getPerSecondValue("db block changes"));
sendDataPoint("ORA Redo Size (#/s) " + instance, oracle.getPerSecondValue("redo size"));
sendDataPoint("ORA Physical Reads (#/s) " + instance, oracle.getPerSecondValue("physical reads"));
sendDataPoint("ORA Physical Writes (#/s) " + instance, oracle.getPerSecondValue("physical writes"));
sendDataPoint("ORA Redo Writes (#/s) " + instance, oracle.getPerSecondValue("redo writes"));
sendDataPoint("ORA Non-idle Wait Time (ms/s) " + instance, oracle.getPerSecondValue("non-idle wait time"));
sendDataPoint("ORA File I/O Wait Time (ms/s) " + instance, oracle.getPerSecondValue("file io wait time"));
sendDataPoint("ORA Executes (#/s) " + instance, oracle.getPerSecondValue("execute count"));
sendDataPoint("ORA User Calls (#/s) " + instance, oracle.getPerSecondValue("user calls"));
sendDataPoint("ORA User Commits (#/s) " + instance, oracle.getPerSecondValue("user commits"));
sendDataPoint("ORA User Rollbacks (#/s) " + instance, oracle.getPerSecondValue("user rollbacks"));
sendDataPoint("ORA Parse Count Total (#/s) " + instance, oracle.getPerSecondValue("parse count (total)"));
sendDataPoint("ORA Parse Count Hard (#/s) " + instance, oracle.getPerSecondValue("parse count (hard)"));
} else {
firstIteration = false;
}
}
return 0;
}////end of action
public int end() throws Throwable
{
for(OraMon oracle : oraList)
{
oracle.close();
}
return 0;
}////end of end
// Needed to avoid LR12 VuGen from hanging in a CPU loop (later fixed by a patch but just in case)
public void sendDataPoint(String name, double value)
{
lr.user_data_point(name, value);
}
}
......@@ -47,7 +47,7 @@ Default Profile=default.usp
21=0
CurrentState=1
VuserStateHistory=0 65536 65552
LastReplayStatus=2
LastReplayStatus=1
[ActiveReplay]
LastReplayedRunName=result1
ActiveRunName=result1
......@@ -63,10 +63,10 @@ vuser_end=1
vuser_init=0
Actions=1
vuser_end=0
[ManuallyExtraFiles]
lilom.jar=
ojdbc6.jar=
[Interpreters]
vuser_init=Java-Interpreter
Actions=Java-Interpreter
vuser_end=Java-Interpreter
[ManuallyExtraFiles]
lilom.jar=
ojdbc6.jar=
......
......@@ -28,21 +28,28 @@ MsgClassFull=0
AutoLog=0
PrintTimeStamp=0
[CommandArguments]
ConnectionString=jdbc:oracle:thin:@host:port:sid
ConnectionString=jdbc:oracle:thin:@192.168.154.128:1521:XE
~ConnectionString=Tex "jdbc:oracle:thin:@host:port:sid"
User=system
~User=Tex "oracleuser"
Password=passw0rd
Password=2w0o3e9i
~Password=
[JavaVM:Options]
Java_Env_ClassPath=ojdbc6.jar;se.ttm.tdemon.jar;
Java_Env_ClassPath=lilom.jar;ojdbc6.jar;
Java_Env_ClassPath_Unused=
Java_Previous_Class_Path=
use_jdk=search_jdk
jdk_home=
use_jdk=specified_jdk
jdk_home=C:\Program Files (x86)\Java\jdk1.7.0_80
Java_VM_Params=
Use_Xboot=0
enable_CL_per_vuser=0
jdk_home_extra_arg_1=
jdk_home_extra_arg_2=C:\Program Files\Java\jdk1.7.0_80
Java_VM_Params_extra_arg_1=
jdk_home_extra_arg_3=C:\Program Files (x86)\Java\jdk1.7.0_80
jdk_home_extra_arg_4=C:\Program Files (x86)\Java\jdk1.6.0_45
jdk_home_extra_arg_5=C:\Program Files (x86)\Java\jdk1.6.0_45\bin
jdk_home_extra_arg_6=C:\Program Files (x86)\Java\jdk1.6.0_45\
[ModemSpeed]
EnableModemSpeed=0
EnableCustomModemSpeed=0
......
......@@ -2,26 +2,26 @@
MercIniTreeSectionName="vuser_end"
RunLogicObjectKind="Action"
Name="vuser_end"
RunLogicInterpreterType="Java-Interpreter"
MercIniTreeFather="RunLogicEndRoot"
RunLogicActionType="VuserEnd"
MercIniTreeFather="RunLogicEndRoot"
RunLogicInterpreterType="Java-Interpreter"
[RunLogicInitRoot:vuser_init]
MercIniTreeSectionName="vuser_init"
RunLogicObjectKind="Action"
Name="vuser_init"
RunLogicInterpreterType="Java-Interpreter"
MercIniTreeFather="RunLogicInitRoot"
RunLogicActionType="VuserInit"
MercIniTreeFather="RunLogicInitRoot"
RunLogicInterpreterType="Java-Interpreter"
[RunLogicRunRoot:Actions]
MercIniTreeSectionName="Actions"
RunLogicObjectKind="Action"
Name="Actions"
RunLogicInterpreterType="Java-Interpreter"
MercIniTreeFather="RunLogicRunRoot"
RunLogicActionType="VuserRun"
MercIniTreeFather="RunLogicRunRoot"
RunLogicInterpreterType="Java-Interpreter"
[Profile Actions]
Profile Actions name=vuser_init,Actions,vuser_end
MercIniTreeSectionName="Profile Actions"
Profile Actions name=vuser_init,Actions,vuser_end
MercIniTreeFather=""
[RunLogicRunRoot]
RunLogicPaceConstTime="60,000"
......@@ -32,10 +32,10 @@ MercIniTreeFather=""
RunLogicPaceType="ConstAfter"
MercIniTreeSons="Actions"
RunLogicNumOfIterations="2"
Name="Run"
RunLogicAfterPaceMin="60,000"
RunLogicRunMode="Sequential"
Name="Run"
RunLogicPaceConstAfterTime="15,000"
RunLogicRunMode="Sequential"
RunLogicObjectKind="Group"
RunLogicActionType="VuserRun"
RunLogicRandomPaceMin="60,000"
......
No preview for this file type
No preview for this file type
......@@ -2,7 +2,6 @@
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry exported="true" kind="lib" path="lib/ojdbc6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ojdbc5.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path=""/>
</classpath>
......
No preview for this file type