Commit 43d890cf 43d890cfeb332c0078e2ebcd482d7174635d85e2 by Christian Gerdes
2 parents 7dbe2d8d d972950b
...@@ -61,8 +61,11 @@ public class Actions ...@@ -61,8 +61,11 @@ public class Actions
61 { 61 {
62 String instance = oracle.getDBName(); 62 String instance = oracle.getDBName();
63 sendDataPoint("ORA Cpus (#) " + instance, oracle.getNumberOfCPUs()); 63 sendDataPoint("ORA Cpus (#) " + instance, oracle.getNumberOfCPUs());
64 sendDataPoint("ORA Cpu Time (ms/s) " + instance, oracle.getCPUTimePerSecond()); 64 sendDataPoint("ORA Cpu Time (us/s) " + instance, oracle.getCPUTimePerSecond());
65 sendDataPoint("ORA Cpu Usage (%) " + instance, oracle.getCPUPercent()); 65 sendDataPoint("ORA Cpu Usage (%) " + instance, oracle.getCPUPercent());
66 sendDataPoint("ORA OS Busy (%) " + instance, oracle.getOsBusyPercent());
67 sendDataPoint("ORA OS Load (#) " + instance, oracle.getOsLoad());
68 sendDataPoint("ORA OS Load per Cpu (#) " + instance, oracle.getOsLoadPerCPU());
66 sendDataPoint("ORA Logical Reads (#/s) " + instance, oracle.getLogicalReadsPerSecond()); 69 sendDataPoint("ORA Logical Reads (#/s) " + instance, oracle.getLogicalReadsPerSecond());
67 sendDataPoint("ORA Consistent Gets (#/s) " + instance, oracle.getPerSecondValue("consistent gets")); 70 sendDataPoint("ORA Consistent Gets (#/s) " + instance, oracle.getPerSecondValue("consistent gets"));
68 sendDataPoint("ORA DB Block Gets (#/s) " + instance, oracle.getPerSecondValue("db block gets")); 71 sendDataPoint("ORA DB Block Gets (#/s) " + instance, oracle.getPerSecondValue("db block gets"));
......
1 /*
2 * LoadRunner Java script. (Build: _build_number_)
3 *
4 * Script Description:
5 *
6 */
7
8 import java.util.ArrayList;
9 import lrapi.lr;
10 import se.lil.om.*;
11
12 public class Actions
13 {
14
15 ArrayList<OraMon> oraList = new ArrayList<OraMon>();
16
17 boolean firstIteration = true;
18 String empty = "";
19
20 public int init() throws Throwable
21 {
22 if(lr.get_attrib_string("ConnectionString") == null || lr.get_attrib_string("User") == null || lr.get_attrib_string("Password") == null ||
23 lr.get_attrib_string("ConnectionString").equals(empty) || lr.get_attrib_string("User").equals(empty) || lr.get_attrib_string("Password").equals(empty))
24 {
25 lr.error_message("Attributes are missing for Oracle: ConnectionString, User or Password are null. Nothing to do, aborting vuser.");
26 lr.exit(lr.EXIT_VUSER, lr.FAIL);
27 }
28
29 String[] conS = lr.get_attrib_string("ConnectionString").split(",");
30 String[] usrS = lr.get_attrib_string("User").split(",");
31 String[] pasS = lr.get_attrib_string("Password").split(",");
32
33 if(conS.length != usrS.length || conS.length != pasS.length)
34 {
35 lr.error_message("Oracle has multiple comma separated connection strings but not the same number of multiple user or password strings. Cannot continue, abort.");
36 lr.exit(lr.EXIT_VUSER, lr.FAIL);
37 }
38
39 for(int x=0; x<conS.length; x++)
40 {
41 OraMon mon = new OraMon();
42 lr.debug_message (lr.MSG_CLASS_EXTENDED_LOG , " Using " + conS[x].trim() + " User " + usrS[x].trim() + " Pass " + pasS[x].trim());
43 mon.open(conS[x].trim(), usrS[x].trim(), pasS[x].trim());
44 oraList.add(mon);
45 }
46 return 0;
47 }////end of init
48
49
50 public int action() throws Throwable
51 {
52
53 for(OraMon oracle : oraList)
54 {
55 lr.debug_message (lr.MSG_CLASS_EXTENDED_LOG , "#### ORACLE COUNTERS ####");
56 lr.debug_message (lr.MSG_CLASS_EXTENDED_LOG, "Using: " + oracle.getConString());
57 oracle.getData();
58 lr.debug_message (lr.MSG_CLASS_EXTENDED_LOG, "Returned DB Name: " + oracle.getDBName());
59
60 if(firstIteration == false)
61 {
62 String instance = oracle.getDBName();
63 sendDataPoint("ORA Cpus (#) " + instance, oracle.getNumberOfCPUs());
64 sendDataPoint("ORA Cpu Time (ms/s) " + instance, oracle.getCPUTimePerSecond());
65 sendDataPoint("ORA Cpu Usage (%) " + instance, oracle.getCPUPercent());
66 sendDataPoint("ORA Logical Reads (#/s) " + instance, oracle.getLogicalReadsPerSecond());
67 sendDataPoint("ORA Consistent Gets (#/s) " + instance, oracle.getPerSecondValue("consistent gets"));
68 sendDataPoint("ORA DB Block Gets (#/s) " + instance, oracle.getPerSecondValue("db block gets"));
69 sendDataPoint("ORA Cache Hit Ratio (%) " + instance, oracle.getCacheHitRatioPercent());
70 sendDataPoint("ORA Buffer Cache Hit Ratio (%) " + instance, oracle.getBufferCacheHitRatioPercent());
71 sendDataPoint("ORA DB Block Changes (#/s) " + instance, oracle.getPerSecondValue("db block changes"));
72 sendDataPoint("ORA Redo Size (#/s) " + instance, oracle.getPerSecondValue("redo size"));
73 sendDataPoint("ORA Physical Reads (#/s) " + instance, oracle.getPerSecondValue("physical reads"));
74 sendDataPoint("ORA Physical Writes (#/s) " + instance, oracle.getPerSecondValue("physical writes"));
75 sendDataPoint("ORA Redo Writes (#/s) " + instance, oracle.getPerSecondValue("redo writes"));
76 sendDataPoint("ORA Non-idle Wait Time (ms/s) " + instance, oracle.getPerSecondValue("non-idle wait time"));
77 sendDataPoint("ORA File I/O Wait Time (ms/s) " + instance, oracle.getPerSecondValue("file io wait time"));
78 sendDataPoint("ORA Executes (#/s) " + instance, oracle.getPerSecondValue("execute count"));
79 sendDataPoint("ORA User Calls (#/s) " + instance, oracle.getPerSecondValue("user calls"));
80 sendDataPoint("ORA User Commits (#/s) " + instance, oracle.getPerSecondValue("user commits"));
81 sendDataPoint("ORA User Rollbacks (#/s) " + instance, oracle.getPerSecondValue("user rollbacks"));
82 sendDataPoint("ORA Parse Count Total (#/s) " + instance, oracle.getPerSecondValue("parse count (total)"));
83 sendDataPoint("ORA Parse Count Hard (#/s) " + instance, oracle.getPerSecondValue("parse count (hard)"));
84 } else {
85 firstIteration = false;
86 }
87 }
88
89 return 0;
90 }////end of action
91
92
93 public int end() throws Throwable
94 {
95 for(OraMon oracle : oraList)
96 {
97 oracle.close();
98 }
99
100 return 0;
101 }////end of end
102
103 // Needed to avoid LR12 VuGen from hanging in a CPU loop (later fixed by a patch but just in case)
104 public void sendDataPoint(String name, double value)
105 {
106 lr.user_data_point(name, value);
107 }
108 }
109
110
1 [General] 1 [General]
2 Type=General-Java 2 Type=General-Java
3 RecordedProtocol= 3 RecordedProtocol=
4 DefaultCfg=default.cfg 4 DefaultCfg=default.cfg
5 AppName= 5 AppName=
6 BuildTarget= 6 BuildTarget=
7 ParamRightBrace=> 7 ParamRightBrace=>
8 ParamLeftBrace=< 8 ParamLeftBrace=<
9 NewFunctionHeader=1 9 NewFunctionHeader=1
10 LastActiveAction=Actions 10 LastActiveAction=Actions
11 CorrInfoReportDir= 11 CorrInfoReportDir=
12 LastResultDir= 12 LastResultDir=
13 DevelopTool=Vugen 13 DevelopTool=Vugen
14 ActionLogicExt=action_logic 14 ActionLogicExt=action_logic
15 MajorVersion=12 15 MajorVersion=12
16 MinorVersion=50 16 MinorVersion=50
17 ParameterFile= 17 ParameterFile=
18 GlobalParameterFile= 18 GlobalParameterFile=
19 RunType=Java-Interpreter 19 RunType=Java-Interpreter
20 LastModifyVer=12.50.0.0 20 LastModifyVer=12.50.0.0
21 AdditionalTypes=General-Java 21 AdditionalTypes=General-Java
22 GenerateTypes= 22 GenerateTypes=
23 ActiveTypes= 23 ActiveTypes=
24 ScriptLanguage=JAVA 24 ScriptLanguage=JAVA
25 DisableRegenerate=0 25 DisableRegenerate=0
26 Description= 26 Description=
27 [TransactionsOrder] 27 [TransactionsOrder]
28 Order= 28 Order=
29 [Actions] 29 [Actions]
30 vuser_init=vuser_init.java 30 vuser_init=vuser_init.java
31 Actions=Actions.java 31 Actions=Actions.java
32 vuser_end=vuser_end.java 32 vuser_end=vuser_end.java
33 [ProtocolsVersion] 33 [ProtocolsVersion]
34 General-Java=11.0.0.0 34 General-Java=11.0.0.0
35 [RunLogicFiles] 35 [RunLogicFiles]
36 Default Profile=default.usp 36 Default Profile=default.usp
37 [StateManagement] 37 [StateManagement]
38 1=1 38 1=1
39 4=0 39 4=0
40 9=0 40 9=0
41 10=0 41 10=0
42 11=0 42 11=0
43 12=0 43 12=0
44 17=0 44 17=0
45 18=0 45 18=0
46 20=0 46 20=0
47 21=0 47 21=0
48 CurrentState=1 48 CurrentState=1
49 VuserStateHistory=0 65536 65552 49 VuserStateHistory=0 65536 65552
50 LastReplayStatus=2 50 LastReplayStatus=1
51 [ActiveReplay] 51 [ActiveReplay]
52 LastReplayedRunName=result1 52 LastReplayedRunName=result1
53 ActiveRunName=result1 53 ActiveRunName=result1
54 [Recorded Actions] 54 [Recorded Actions]
55 vuser_init=0 55 vuser_init=0
56 Actions=0 56 Actions=0
57 vuser_end=0 57 vuser_end=0
58 [Replayed Actions] 58 [Replayed Actions]
59 vuser_init=1 59 vuser_init=1
60 Actions=1 60 Actions=1
61 vuser_end=1 61 vuser_end=1
62 [Modified Actions] 62 [Modified Actions]
63 vuser_init=0 63 vuser_init=0
64 Actions=1 64 Actions=1
65 vuser_end=0 65 vuser_end=0
66 [ManuallyExtraFiles] 66 [Interpreters]
67 lilom.jar= 67 vuser_init=Java-Interpreter
68 ojdbc6.jar= 68 Actions=Java-Interpreter
69 [Interpreters] 69 vuser_end=Java-Interpreter
70 vuser_init=Java-Interpreter 70 [ManuallyExtraFiles]
71 Actions=Java-Interpreter 71 lilom.jar=
72 vuser_end=Java-Interpreter 72 ojdbc6.jar=
......
1 [General] 1 [General]
2 XlBridgeTimeout=120 2 XlBridgeTimeout=120
3 DefaultRunLogic=default.usp 3 DefaultRunLogic=default.usp
4 iter_begins_val=fixed 4 iter_begins_val=fixed
5 iter_ends_val=fixed 5 iter_ends_val=fixed
6 ContinueOnError=0 6 ContinueOnError=0
7 FailTransOnErrorMsg=0 7 FailTransOnErrorMsg=0
8 AutomaticTransactions=0 8 AutomaticTransactions=0
9 UseThreads=1 9 UseThreads=1
10 [ThinkTime] 10 [ThinkTime]
11 Options=NOTHINK 11 Options=NOTHINK
12 Factor=1.000000 12 Factor=1.000000
13 LimitFlag=0 13 LimitFlag=0
14 Limit=1 14 Limit=1
15 ThinkTimeRandomLow=50 15 ThinkTimeRandomLow=50
16 ThinkTimeRandomHigh=150 16 ThinkTimeRandomHigh=150
17 [Iterations] 17 [Iterations]
18 NumOfIterations=1 18 NumOfIterations=1
19 IterationPace=IterationASAP 19 IterationPace=IterationASAP
20 StartEvery=60 20 StartEvery=60
21 RandomMin=60 21 RandomMin=60
22 RandomMax=90 22 RandomMax=90
23 [Log] 23 [Log]
24 LogOptions=LogExtended 24 LogOptions=LogExtended
25 MsgClassData=0 25 MsgClassData=0
26 MsgClassParameters=0 26 MsgClassParameters=0
27 MsgClassFull=0 27 MsgClassFull=0
28 AutoLog=0 28 AutoLog=0
29 PrintTimeStamp=0 29 PrintTimeStamp=0
30 [CommandArguments] 30 [CommandArguments]
31 ConnectionString=jdbc:oracle:thin:@host:port:sid 31 ConnectionString=jdbc:oracle:thin:@192.168.154.128:1521:XE
32 ~ConnectionString=Tex "jdbc:oracle:thin:@host:port:sid" 32 ~ConnectionString=Tex "jdbc:oracle:thin:@host:port:sid"
33 User=system 33 User=system
34 ~User=Tex "oracleuser" 34 ~User=Tex "oracleuser"
35 Password=passw0rd 35 Password=2w0o3e9i
36 ~Password= 36 ~Password=
37 [JavaVM:Options] 37 [JavaVM:Options]
38 Java_Env_ClassPath=ojdbc6.jar;se.ttm.tdemon.jar; 38 Java_Env_ClassPath=lilom.jar;ojdbc6.jar;
39 Java_Env_ClassPath_Unused= 39 Java_Env_ClassPath_Unused=
40 Java_Previous_Class_Path= 40 Java_Previous_Class_Path=
41 use_jdk=search_jdk 41 use_jdk=specified_jdk
42 jdk_home= 42 jdk_home=C:\Program Files (x86)\Java\jdk1.7.0_80
43 Java_VM_Params= 43 Java_VM_Params=
44 Use_Xboot=0 44 Use_Xboot=0
45 enable_CL_per_vuser=0 45 enable_CL_per_vuser=0
46 [ModemSpeed] 46 jdk_home_extra_arg_1=
47 EnableModemSpeed=0 47 jdk_home_extra_arg_2=C:\Program Files\Java\jdk1.7.0_80
48 EnableCustomModemSpeed=0 48 Java_VM_Params_extra_arg_1=
49 ModemSpeed=128000 49 jdk_home_extra_arg_3=C:\Program Files (x86)\Java\jdk1.7.0_80
50 CustomModemSpeed=1000 50 jdk_home_extra_arg_4=C:\Program Files (x86)\Java\jdk1.6.0_45
51 jdk_home_extra_arg_5=C:\Program Files (x86)\Java\jdk1.6.0_45\bin
52 jdk_home_extra_arg_6=C:\Program Files (x86)\Java\jdk1.6.0_45\
53 [ModemSpeed]
54 EnableModemSpeed=0
55 EnableCustomModemSpeed=0
56 ModemSpeed=128000
57 CustomModemSpeed=1000
......
1 [RunLogicEndRoot:vuser_end] 1 [RunLogicEndRoot:vuser_end]
2 MercIniTreeSectionName="vuser_end" 2 MercIniTreeSectionName="vuser_end"
3 RunLogicObjectKind="Action" 3 RunLogicObjectKind="Action"
4 Name="vuser_end" 4 Name="vuser_end"
5 RunLogicInterpreterType="Java-Interpreter" 5 RunLogicActionType="VuserEnd"
6 MercIniTreeFather="RunLogicEndRoot" 6 MercIniTreeFather="RunLogicEndRoot"
7 RunLogicActionType="VuserEnd" 7 RunLogicInterpreterType="Java-Interpreter"
8 [RunLogicInitRoot:vuser_init] 8 [RunLogicInitRoot:vuser_init]
9 MercIniTreeSectionName="vuser_init" 9 MercIniTreeSectionName="vuser_init"
10 RunLogicObjectKind="Action" 10 RunLogicObjectKind="Action"
11 Name="vuser_init" 11 Name="vuser_init"
12 RunLogicInterpreterType="Java-Interpreter" 12 RunLogicActionType="VuserInit"
13 MercIniTreeFather="RunLogicInitRoot" 13 MercIniTreeFather="RunLogicInitRoot"
14 RunLogicActionType="VuserInit" 14 RunLogicInterpreterType="Java-Interpreter"
15 [RunLogicRunRoot:Actions] 15 [RunLogicRunRoot:Actions]
16 MercIniTreeSectionName="Actions" 16 MercIniTreeSectionName="Actions"
17 RunLogicObjectKind="Action" 17 RunLogicObjectKind="Action"
18 Name="Actions" 18 Name="Actions"
19 RunLogicInterpreterType="Java-Interpreter" 19 RunLogicActionType="VuserRun"
20 MercIniTreeFather="RunLogicRunRoot" 20 MercIniTreeFather="RunLogicRunRoot"
21 RunLogicActionType="VuserRun" 21 RunLogicInterpreterType="Java-Interpreter"
22 [Profile Actions] 22 [Profile Actions]
23 Profile Actions name=vuser_init,Actions,vuser_end 23 MercIniTreeSectionName="Profile Actions"
24 MercIniTreeSectionName="Profile Actions" 24 Profile Actions name=vuser_init,Actions,vuser_end
25 MercIniTreeFather="" 25 MercIniTreeFather=""
26 [RunLogicRunRoot] 26 [RunLogicRunRoot]
27 RunLogicPaceConstTime="60,000" 27 RunLogicPaceConstTime="60,000"
28 RunLogicRandomPaceMax="90,000" 28 RunLogicRandomPaceMax="90,000"
29 RunLogicActionOrder="Actions" 29 RunLogicActionOrder="Actions"
30 RunLogicAfterPaceMax="90,000" 30 RunLogicAfterPaceMax="90,000"
31 MercIniTreeFather="" 31 MercIniTreeFather=""
32 RunLogicPaceType="ConstAfter" 32 RunLogicPaceType="ConstAfter"
33 MercIniTreeSons="Actions" 33 MercIniTreeSons="Actions"
34 RunLogicNumOfIterations="2" 34 RunLogicNumOfIterations="2"
35 Name="Run" 35 RunLogicAfterPaceMin="60,000"
36 RunLogicAfterPaceMin="60,000" 36 Name="Run"
37 RunLogicRunMode="Sequential" 37 RunLogicPaceConstAfterTime="15,000"
38 RunLogicPaceConstAfterTime="15,000" 38 RunLogicRunMode="Sequential"
39 RunLogicObjectKind="Group" 39 RunLogicObjectKind="Group"
40 RunLogicActionType="VuserRun" 40 RunLogicActionType="VuserRun"
41 RunLogicRandomPaceMin="60,000" 41 RunLogicRandomPaceMin="60,000"
42 MercIniTreeSectionName="RunLogicRunRoot" 42 MercIniTreeSectionName="RunLogicRunRoot"
43 [RunLogicEndRoot] 43 [RunLogicEndRoot]
44 RunLogicActionOrder="vuser_end" 44 RunLogicActionOrder="vuser_end"
45 MercIniTreeFather="" 45 MercIniTreeFather=""
46 MercIniTreeSons="vuser_end" 46 MercIniTreeSons="vuser_end"
47 RunLogicNumOfIterations="1" 47 RunLogicNumOfIterations="1"
48 Name="End" 48 Name="End"
49 RunLogicRunMode="Sequential" 49 RunLogicRunMode="Sequential"
50 RunLogicObjectKind="Group" 50 RunLogicObjectKind="Group"
51 RunLogicActionType="VuserEnd" 51 RunLogicActionType="VuserEnd"
52 MercIniTreeSectionName="RunLogicEndRoot" 52 MercIniTreeSectionName="RunLogicEndRoot"
53 [RunLogicInitRoot] 53 [RunLogicInitRoot]
54 RunLogicActionOrder="vuser_init" 54 RunLogicActionOrder="vuser_init"
55 MercIniTreeFather="" 55 MercIniTreeFather=""
56 MercIniTreeSons="vuser_init" 56 MercIniTreeSons="vuser_init"
57 RunLogicNumOfIterations="1" 57 RunLogicNumOfIterations="1"
58 Name="Init" 58 Name="Init"
59 RunLogicRunMode="Sequential" 59 RunLogicRunMode="Sequential"
60 RunLogicObjectKind="Group" 60 RunLogicObjectKind="Group"
61 RunLogicActionType="VuserInit" 61 RunLogicActionType="VuserInit"
62 MercIniTreeSectionName="RunLogicInitRoot" 62 MercIniTreeSectionName="RunLogicInitRoot"
......
No preview for this file type
No preview for this file type
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
2 <classpath> 2 <classpath>
3 <classpathentry kind="src" path=""/> 3 <classpathentry kind="src" path=""/>
4 <classpathentry exported="true" kind="lib" path="lib/ojdbc6.jar"/> 4 <classpathentry exported="true" kind="lib" path="lib/ojdbc6.jar"/>
5 <classpathentry exported="true" kind="lib" path="lib/ojdbc5.jar"/>
6 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
7 <classpathentry kind="output" path=""/> 6 <classpathentry kind="output" path=""/>
8 </classpath> 7 </classpath>
......
No preview for this file type