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);
}
}
[General]
Type=General-Java
RecordedProtocol=
DefaultCfg=default.cfg
AppName=
BuildTarget=
ParamRightBrace=>
ParamLeftBrace=<
NewFunctionHeader=1
LastActiveAction=Actions
CorrInfoReportDir=
LastResultDir=
DevelopTool=Vugen
ActionLogicExt=action_logic
MajorVersion=12
MinorVersion=50
ParameterFile=
GlobalParameterFile=
RunType=Java-Interpreter
LastModifyVer=12.50.0.0
AdditionalTypes=General-Java
GenerateTypes=
ActiveTypes=
ScriptLanguage=JAVA
DisableRegenerate=0
Description=
[TransactionsOrder]
Order=
[Actions]
vuser_init=vuser_init.java
Actions=Actions.java
vuser_end=vuser_end.java
[ProtocolsVersion]
General-Java=11.0.0.0
[RunLogicFiles]
Default Profile=default.usp
[StateManagement]
1=1
4=0
9=0
10=0
11=0
12=0
17=0
18=0
20=0
21=0
CurrentState=1
VuserStateHistory=0 65536 65552
LastReplayStatus=2
[ActiveReplay]
LastReplayedRunName=result1
ActiveRunName=result1
[Recorded Actions]
vuser_init=0
Actions=0
vuser_end=0
[Replayed Actions]
vuser_init=1
Actions=1
vuser_end=1
[Modified Actions]
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
[General]
Type=General-Java
RecordedProtocol=
DefaultCfg=default.cfg
AppName=
BuildTarget=
ParamRightBrace=>
ParamLeftBrace=<
NewFunctionHeader=1
LastActiveAction=Actions
CorrInfoReportDir=
LastResultDir=
DevelopTool=Vugen
ActionLogicExt=action_logic
MajorVersion=12
MinorVersion=50
ParameterFile=
GlobalParameterFile=
RunType=Java-Interpreter
LastModifyVer=12.50.0.0
AdditionalTypes=General-Java
GenerateTypes=
ActiveTypes=
ScriptLanguage=JAVA
DisableRegenerate=0
Description=
[TransactionsOrder]
Order=
[Actions]
vuser_init=vuser_init.java
Actions=Actions.java
vuser_end=vuser_end.java
[ProtocolsVersion]
General-Java=11.0.0.0
[RunLogicFiles]
Default Profile=default.usp
[StateManagement]
1=1
4=0
9=0
10=0
11=0
12=0
17=0
18=0
20=0
21=0
CurrentState=1
VuserStateHistory=0 65536 65552
LastReplayStatus=1
[ActiveReplay]
LastReplayedRunName=result1
ActiveRunName=result1
[Recorded Actions]
vuser_init=0
Actions=0
vuser_end=0
[Replayed Actions]
vuser_init=1
Actions=1
vuser_end=1
[Modified Actions]
vuser_init=0
Actions=1
vuser_end=0
[Interpreters]
vuser_init=Java-Interpreter
Actions=Java-Interpreter
vuser_end=Java-Interpreter
[ManuallyExtraFiles]
lilom.jar=
ojdbc6.jar=
......
[General]
XlBridgeTimeout=120
DefaultRunLogic=default.usp
iter_begins_val=fixed
iter_ends_val=fixed
ContinueOnError=0
FailTransOnErrorMsg=0
AutomaticTransactions=0
UseThreads=1
[ThinkTime]
Options=NOTHINK
Factor=1.000000
LimitFlag=0
Limit=1
ThinkTimeRandomLow=50
ThinkTimeRandomHigh=150
[Iterations]
NumOfIterations=1
IterationPace=IterationASAP
StartEvery=60
RandomMin=60
RandomMax=90
[Log]
LogOptions=LogExtended
MsgClassData=0
MsgClassParameters=0
MsgClassFull=0
AutoLog=0
PrintTimeStamp=0
[CommandArguments]
ConnectionString=jdbc:oracle:thin:@host:port:sid
~ConnectionString=Tex "jdbc:oracle:thin:@host:port:sid"
User=system
~User=Tex "oracleuser"
Password=passw0rd
~Password=
[JavaVM:Options]
Java_Env_ClassPath=ojdbc6.jar;se.ttm.tdemon.jar;
Java_Env_ClassPath_Unused=
Java_Previous_Class_Path=
use_jdk=search_jdk
jdk_home=
Java_VM_Params=
Use_Xboot=0
enable_CL_per_vuser=0
[ModemSpeed]
EnableModemSpeed=0
EnableCustomModemSpeed=0
ModemSpeed=128000
CustomModemSpeed=1000
[General]
XlBridgeTimeout=120
DefaultRunLogic=default.usp
iter_begins_val=fixed
iter_ends_val=fixed
ContinueOnError=0
FailTransOnErrorMsg=0
AutomaticTransactions=0
UseThreads=1
[ThinkTime]
Options=NOTHINK
Factor=1.000000
LimitFlag=0
Limit=1
ThinkTimeRandomLow=50
ThinkTimeRandomHigh=150
[Iterations]
NumOfIterations=1
IterationPace=IterationASAP
StartEvery=60
RandomMin=60
RandomMax=90
[Log]
LogOptions=LogExtended
MsgClassData=0
MsgClassParameters=0
MsgClassFull=0
AutoLog=0
PrintTimeStamp=0
[CommandArguments]
ConnectionString=jdbc:oracle:thin:@192.168.154.128:1521:XE
~ConnectionString=Tex "jdbc:oracle:thin:@host:port:sid"
User=system
~User=Tex "oracleuser"
Password=2w0o3e9i
~Password=
[JavaVM:Options]
Java_Env_ClassPath=lilom.jar;ojdbc6.jar;
Java_Env_ClassPath_Unused=
Java_Previous_Class_Path=
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
ModemSpeed=128000
CustomModemSpeed=1000
......
[RunLogicEndRoot:vuser_end]
MercIniTreeSectionName="vuser_end"
RunLogicObjectKind="Action"
Name="vuser_end"
RunLogicInterpreterType="Java-Interpreter"
MercIniTreeFather="RunLogicEndRoot"
RunLogicActionType="VuserEnd"
[RunLogicInitRoot:vuser_init]
MercIniTreeSectionName="vuser_init"
RunLogicObjectKind="Action"
Name="vuser_init"
RunLogicInterpreterType="Java-Interpreter"
MercIniTreeFather="RunLogicInitRoot"
RunLogicActionType="VuserInit"
[RunLogicRunRoot:Actions]
MercIniTreeSectionName="Actions"
RunLogicObjectKind="Action"
Name="Actions"
RunLogicInterpreterType="Java-Interpreter"
MercIniTreeFather="RunLogicRunRoot"
RunLogicActionType="VuserRun"
[Profile Actions]
Profile Actions name=vuser_init,Actions,vuser_end
MercIniTreeSectionName="Profile Actions"
MercIniTreeFather=""
[RunLogicRunRoot]
RunLogicPaceConstTime="60,000"
RunLogicRandomPaceMax="90,000"
RunLogicActionOrder="Actions"
RunLogicAfterPaceMax="90,000"
MercIniTreeFather=""
RunLogicPaceType="ConstAfter"
MercIniTreeSons="Actions"
RunLogicNumOfIterations="2"
Name="Run"
RunLogicAfterPaceMin="60,000"
RunLogicRunMode="Sequential"
RunLogicPaceConstAfterTime="15,000"
RunLogicObjectKind="Group"
RunLogicActionType="VuserRun"
RunLogicRandomPaceMin="60,000"
MercIniTreeSectionName="RunLogicRunRoot"
[RunLogicEndRoot]
RunLogicActionOrder="vuser_end"
MercIniTreeFather=""
MercIniTreeSons="vuser_end"
RunLogicNumOfIterations="1"
Name="End"
RunLogicRunMode="Sequential"
RunLogicObjectKind="Group"
RunLogicActionType="VuserEnd"
MercIniTreeSectionName="RunLogicEndRoot"
[RunLogicInitRoot]
RunLogicActionOrder="vuser_init"
MercIniTreeFather=""
MercIniTreeSons="vuser_init"
RunLogicNumOfIterations="1"
Name="Init"
RunLogicRunMode="Sequential"
RunLogicObjectKind="Group"
RunLogicActionType="VuserInit"
MercIniTreeSectionName="RunLogicInitRoot"
[RunLogicEndRoot:vuser_end]
MercIniTreeSectionName="vuser_end"
RunLogicObjectKind="Action"
Name="vuser_end"
RunLogicActionType="VuserEnd"
MercIniTreeFather="RunLogicEndRoot"
RunLogicInterpreterType="Java-Interpreter"
[RunLogicInitRoot:vuser_init]
MercIniTreeSectionName="vuser_init"
RunLogicObjectKind="Action"
Name="vuser_init"
RunLogicActionType="VuserInit"
MercIniTreeFather="RunLogicInitRoot"
RunLogicInterpreterType="Java-Interpreter"
[RunLogicRunRoot:Actions]
MercIniTreeSectionName="Actions"
RunLogicObjectKind="Action"
Name="Actions"
RunLogicActionType="VuserRun"
MercIniTreeFather="RunLogicRunRoot"
RunLogicInterpreterType="Java-Interpreter"
[Profile Actions]
MercIniTreeSectionName="Profile Actions"
Profile Actions name=vuser_init,Actions,vuser_end
MercIniTreeFather=""
[RunLogicRunRoot]
RunLogicPaceConstTime="60,000"
RunLogicRandomPaceMax="90,000"
RunLogicActionOrder="Actions"
RunLogicAfterPaceMax="90,000"
MercIniTreeFather=""
RunLogicPaceType="ConstAfter"
MercIniTreeSons="Actions"
RunLogicNumOfIterations="2"
RunLogicAfterPaceMin="60,000"
Name="Run"
RunLogicPaceConstAfterTime="15,000"
RunLogicRunMode="Sequential"
RunLogicObjectKind="Group"
RunLogicActionType="VuserRun"
RunLogicRandomPaceMin="60,000"
MercIniTreeSectionName="RunLogicRunRoot"
[RunLogicEndRoot]
RunLogicActionOrder="vuser_end"
MercIniTreeFather=""
MercIniTreeSons="vuser_end"
RunLogicNumOfIterations="1"
Name="End"
RunLogicRunMode="Sequential"
RunLogicObjectKind="Group"
RunLogicActionType="VuserEnd"
MercIniTreeSectionName="RunLogicEndRoot"
[RunLogicInitRoot]
RunLogicActionOrder="vuser_init"
MercIniTreeFather=""
MercIniTreeSons="vuser_init"
RunLogicNumOfIterations="1"
Name="Init"
RunLogicRunMode="Sequential"
RunLogicObjectKind="Group"
RunLogicActionType="VuserInit"
MercIniTreeSectionName="RunLogicInitRoot"
......
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