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.
Showing
2 changed files
with
6 additions
and
6 deletions
... | @@ -95,8 +95,8 @@ public class OraMon { | ... | @@ -95,8 +95,8 @@ public class OraMon { |
95 | } | 95 | } |
96 | 96 | ||
97 | //DB CPU | 97 | //DB CPU |
98 | LongDelta cpuTime = new LongDelta(this.getFriendlyName()+" cpuTime"); | 98 | LongDelta cpuTime = new LongDelta("cpuTime"); |
99 | LongDelta niwTime = new LongDelta(this.getFriendlyName()+" niwTime"); | 99 | LongDelta niwTime = new LongDelta("niwTime"); |
100 | public double getCPUPercent(boolean excludeNonIdleWaitTime, String pdbName) throws Throwable { | 100 | public double getCPUPercent(boolean excludeNonIdleWaitTime, String pdbName) throws Throwable { |
101 | double cpuPerSec; | 101 | double cpuPerSec; |
102 | if(pdbName == null) cpuPerSec = cpuTime.getPerSecondValue(); | 102 | if(pdbName == null) cpuPerSec = cpuTime.getPerSecondValue(); | ... | ... |
... | @@ -14,8 +14,8 @@ public class TestRunner { | ... | @@ -14,8 +14,8 @@ public class TestRunner { |
14 | public static void main(String[] args) throws Throwable { | 14 | public static void main(String[] args) throws Throwable { |
15 | //runner1(); | 15 | //runner1(); |
16 | //test1(); | 16 | //test1(); |
17 | //testTns(); | 17 | testTns(); |
18 | testPDB(); | 18 | //testPDB(); |
19 | } | 19 | } |
20 | 20 | ||
21 | public static void testPDB() throws Throwable { | 21 | public static void testPDB() throws Throwable { |
... | @@ -53,8 +53,8 @@ public class TestRunner { | ... | @@ -53,8 +53,8 @@ public class TestRunner { |
53 | } | 53 | } |
54 | 54 | ||
55 | public static void testTns() throws Throwable { | 55 | public static void testTns() throws Throwable { |
56 | //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 | 56 | 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 |
57 | OraMon mon = new OraMon("jdbc:oracle:thin:@//u00153.kap.rsv.se:1526/DB1K01","dbsnmp","dbsnmp"); | 57 | //OraMon mon = new OraMon("jdbc:oracle:thin:@//u00153.kap.rsv.se:1526/DB1K01","dbsnmp","dbsnmp"); |
58 | System.out.println("getData returned: " + mon.getData()); | 58 | System.out.println("getData returned: " + mon.getData()); |
59 | System.out.println("getDatabaseName: " + mon.getDBName()); | 59 | System.out.println("getDatabaseName: " + mon.getDBName()); |
60 | System.out.println("getServiceName: " + mon.getServiceName()); | 60 | System.out.println("getServiceName: " + mon.getServiceName()); | ... | ... |
-
Please register or sign in to post a comment