Commit 3f77f388 3f77f3889695333b81fe69aa46cfc1391d209757 by Christian Gerdes

Fixat en bugg som gjorde att getFriendlyName() anropades innan getData()

och därmed inte gav namnet på schemat eftersom con string inte var satt
ännu utan gav alltid namnet "SID". Gjordes innan för att få bättre
debugutskrifter men behövs inte och funkade ändå inte.
1 parent ab86ea2f
......@@ -95,8 +95,8 @@ public class OraMon {
}
//DB CPU
LongDelta cpuTime = new LongDelta(this.getFriendlyName()+" cpuTime");
LongDelta niwTime = new LongDelta(this.getFriendlyName()+" niwTime");
LongDelta cpuTime = new LongDelta("cpuTime");
LongDelta niwTime = new LongDelta("niwTime");
public double getCPUPercent(boolean excludeNonIdleWaitTime, String pdbName) throws Throwable {
double cpuPerSec;
if(pdbName == null) cpuPerSec = cpuTime.getPerSecondValue();
......
......@@ -14,8 +14,8 @@ public class TestRunner {
public static void main(String[] args) throws Throwable {
//runner1();
//test1();
//testTns();
testPDB();
testTns();
//testPDB();
}
public static void testPDB() throws Throwable {
......@@ -53,8 +53,8 @@ public class TestRunner {
}
public static void testTns() throws Throwable {
//OraMon mon = new OraMon("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=u00153.kap.rsv.se)(Port=1526))(ADDRESS=(PROTOCOL=TCP)(Host=u00154.kap.rsv.se)(Port=1526)))(CONNECT_DATA=(SERVICE_NAME=PB1K001)))","dbsnmp","dbsnmp"); // PDB using TNS
OraMon mon = new OraMon("jdbc:oracle:thin:@//u00153.kap.rsv.se:1526/DB1K01","dbsnmp","dbsnmp");
OraMon mon = new OraMon("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=u08435.kap.rsv.se)(Port=1541))(ADDRESS=(PROTOCOL=TCP)(Host=u08436.kap.rsv.se)(Port=1541)))(CONNECT_DATA=(SERVICE_NAME=BI1K010)))","dbsnmp","dbsnmp"); // PDB using TNS
//OraMon mon = new OraMon("jdbc:oracle:thin:@//u00153.kap.rsv.se:1526/DB1K01","dbsnmp","dbsnmp");
System.out.println("getData returned: " + mon.getData());
System.out.println("getDatabaseName: " + mon.getDBName());
System.out.println("getServiceName: " + mon.getServiceName());
......