Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Products
/
LILOM
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
2
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
d972950b
...
d972950b9ece88dd5cc2936a8dbd19108756b23f
authored
2016-03-09 18:36:33 +0100
by
Christian Gerdes
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Tagit bort Actions.java.sed
1 parent
1d716695
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
113 deletions
JavaMON/Actions.java.sed
JavaMON/Actions.java.sed
deleted
100644 → 0
View file @
1d71669
/*
*
Lo
a
dRunner Java script. (Build: _build_number_)
*
*
S
c
ript Description:
*
*/
i
mport java.util.ArrayList;
i
mport lrapi.lr;
i
mport se.lil.om.*;
p
ub
li
c class Actions
{
Arr
a
yList<OraMon> oraList = new ArrayList<OraMon>();
boo
l
e
a
n firstIteration = true;
Str
i
ng empty = "";
p
ub
li
c int init() throws Throwable
{
i
f(lr.get_attrib_string("ConnectionString") == null || lr.get_attrib_string("User") == null || lr.get_attrib_string("Password") == null ||
l
r.
g
et_
a
ttrib_string("ConnectionString").equals(empty) || lr.get_attrib_string("User").equals(empty) || lr.get_attrib_string("Password").equals(empty))
{
l
r.error_me
s
s
age
(
"Attribute
s
are mi
s
s
i
ng for Oracle: Connect
i
onStr
i
ng
,
U
s
e
r or Password ar
e
null. Nothing to do, aborting vus
e
r.")
;
l
r.e
xi
t(lr.EXIT_VUSER, lr.FAIL);
}
Str
i
ng[] conS = lr.get_attrib_string("ConnectionString").split(",");
Str
i
ng[] usrS = lr.get_attrib_string("User").split(",");
Str
i
ng[] pasS = lr.get_attrib_string("Password").split(",");
i
f(conS.length != usrS.length || conS.length != pasS.length)
{
l
r.error_me
s
s
age
(
"Oracle ha
s
multiple comma
s
e
pa
rated connection strings but not the same number of multiple user or password strings. Cannot continue, abort.");
l
r.e
xi
t(lr.EXIT_VUSER, lr.FAIL);
}
for(
i
nt x=0; x<conS.length; x++)
{
Or
a
Mon mon = new OraMon();
l
r.
d
ebu
g
_me
s
s
age
(
lr
.
MSG_CLASS_EXTENDED_LOG , " U
s
ing " + conS[x].trim() + " U
s
e
r
"
+
u
s
r
S
[
x
]
.
t
r
im() + " Pass " + pasS[x].t
r
i
m());
mo
n
.o
p
e
n
(
c
onS[x].trim(), usrS[x].trim(), pasS[x].trim());
or
a
List.add(mon);
}
retur
n
0
;
}
/
//
/
e
nd
of
i
nit
p
ub
li
c int action() throws Throwable
{
for(Or
a
Mon oracle : oraList)
{
l
r.
d
ebu
g
_me
s
s
age
(
lr
.
MSG_CLASS_EXTENDED_LOG , "#### ORACLE COUNTERS ####"
)
;
lr
.
debug_me
ss
a
ge (lr.MSG_CLASS_EXTENDED_LOG, "Using: " + oracle.getConString());
or
a
cle.getData();
l
r.
d
ebu
g
_me
s
s
age
(
lr
.
MSG_CLASS_EXTENDED_LOG, "Returned DB Name: " + oracle
.
getDBName
())
;
if
(
fir
s
tIteration == fal
s
e)
{
Str
i
ng instance = oracle.getDBName();
s
e
ndDataPoint
(
"ORA Cpus
(
#
)
" + instanc
e
, oracl
e
.
g
etNumberOfC
P
U
s
())
;
sendDataPoint
(
"ORA Cpu Time
(
u
s
/
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"
));
s
e
ndDataPoint
(
"ORA DB Block G
e
ts (#/s) " + instanc
e
,
or
a
cle.getPerSecondValue("db block gets"));
s
e
ndDataPoint
(
"ORA Cach
e
Hit Ratio (%) " + instanc
e
,
or
a
cle.getCacheHitRatioPercent());
s
e
ndDataPoint
(
"ORA Buff
e
r Cach
e
Hi
t Ratio (%) " + instance, oracle.getBufferCacheHitRatioPercent());
s
e
ndDataPoint
(
"ORA DB Block Chang
e
s (#/s) " + instanc
e
,
or
a
cle.getPerSecondValue("db block changes"));
s
e
ndDataPoint
(
"ORA R
e
do Siz
e
(
#/s) " + instance, oracle.getPerSecondValue("redo size"));
s
e
ndDataPoint
(
"ORA Physical R
e
ads (#/s) " + instanc
e
,
or
a
cle.getPerSecondValue("physical reads"));
s
e
ndDataPoint
(
"ORA Physical Writ
e
s (#/s) " + instanc
e
,
or
a
cle.getPerSecondValue("physical writes"));
s
e
ndDataPoint
(
"ORA R
e
do Writ
e
s
(
#/s
)
"
+
i
nstance, oracle.getPerSecondValue("redo writes"));
s
e
ndDataPoint
(
"ORA Non-idl
e
Wait Tim
e
(m
s
/
s
)
" + instance, oracle
.
getPerSecondValue
(
"non-idle wait time"
))
;
sendDataPoint
(
"ORA File I
/
O Wait Time (ms
/
s
)
" + instance, oracle
.
getPerSecondValue
(
"file io wait time"
));
s
e
ndDataPoint
(
"ORA Ex
e
cut
e
s
(
#/s
)
"
+
i
nstance, oracle.getPerSecondValue("execute count"));
s
e
ndDataPoint
(
"ORA Us
e
r Calls (#/s) " + instanc
e
,
or
a
cle.getPerSecondValue("user calls"));
s
e
ndDataPoint
(
"ORA Us
e
r Commits (#/s) " + instanc
e
,
or
a
cle.getPerSecondValue("user commits"));
s
e
ndDataPoint
(
"ORA Us
e
r Rollbacks (#/s) " + instanc
e
,
or
a
cle.getPerSecondValue("user rollbacks"));
s
e
ndDataPoint
(
"ORA Pars
e
Count Total (#/s) " + instanc
e
,
or
a
cle.getPerSecondValue("parse count (total)"));
s
e
ndDataPoint
(
"ORA Pars
e
Count Hard (#/s) " + instanc
e
,
or
a
cle.getPerSecondValue("parse count (hard)"));
}
e
ls
e
{
firstIt
e
ration = fals
e;
}
}
retur
n
0
;
}
/
//
/
e
nd
of
a
ction
p
ub
li
c int end() throws Throwable
{
for(Or
a
Mon oracle : oraList)
{
or
a
cle.close();
}
retur
n
0
;
}
/
//
/
e
nd
of
e
nd
//
Nee
d
e
d
to
a
void LR12 VuGen from hanging in a CPU loop (later fixed by a patch but just in case)
p
ub
li
c void sendDataPoint(String name, double value)
{
l
r.u
s
e
r_data_point
(
nam
e
, valu
e
)
;
}
}
Please
register
or
sign in
to post a comment