Skip to content

Commit aa5e2e7

Browse files
committed
Updated READEME and NPE fix
1 parent ff11b72 commit aa5e2e7

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Use case
44
Websphere MQ, formerly known as MQ (message queue) series, is an IBM standard for program-to-program messaging across multiple platforms.
55

6-
The WebSphere MQ monitoring extension can monitor multiple queues managers and their resources, namely queues, topics, channels and listeners.
6+
The WebSphere MQ monitoring extension can monitor multiple queues managers and their resources, namely queues, topics, channels and listeners The metrics are extracted out using the [PCF command messages](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.adm.doc/q020010_.htm).
77

88
The metrics for queue manager, queue, topic, channel and listener can be configured.
99

@@ -269,7 +269,7 @@ Configure the monitor by editing the config.yml file in <code><machine-agent-dir
269269
```
270270

271271
### Extension Working - Internals
272-
This extension extracts metrics through [PCF framework](https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.adm.doc/q019990_.htm). A complete list of PCF commands are listed [here] (https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q086870_.htm)
272+
This extension extracts metrics through [PCF framework](https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.adm.doc/q019990_.htm). A complete list of PCF commands are listed [here](https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q086870_.htm)
273273
Each queue manager has an administration queue with a standard queue name and the extension sends PCF command messages to that queue. On Windows and Unix platforms, the PCF commands are sent is always sent to the SYSTEM.ADMIN.COMMAND.QUEUE queue.
274274
More details about that is mentioned [here](https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.adm.doc/q020010_.htm)
275275

@@ -515,7 +515,7 @@ Always feel free to fork and contribute any changes directly via [GitHub](https:
515515
|IBM MQ Version tested On |7.x, 8.x, 9.x and Windows, Unix, AIX|
516516
|Last Update |21st May, 2018 |
517517

518-
List of Changes to this extension can be found [here](https://github.com/Appdynamics/websphere-mq-monitoring-extension/blob/v7.0/CHANGELOG.md)
518+
List of Changes to this extension can be found [here](https://github.com/Appdynamics/websphere-mq-monitoring-extension/blob/master/CHANGELOG.md)
519519

520520

521521

src/main/java/com/appdynamics/extensions/webspheremq/metricscollector/ListenerMetricsCollector.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ public ListenerMetricsCollector(Map<String, WMQMetricOverride> metricsToReport,
3939
this.countDownLatch = countDownLatch;
4040
}
4141

42-
43-
@Override
4442
public void run() {
4543
try {
4644
this.process();

src/main/java/com/appdynamics/extensions/webspheremq/metricscollector/QueueMetricsCollector.java

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public QueueMetricsCollector(Map<String, WMQMetricOverride> metricsToReport, Mon
4343
this.countDownLatch = countDownLatch;
4444
}
4545

46-
@Override
4746
public void run() {
4847
try {
4948
this.process();
@@ -137,21 +136,25 @@ protected void processPCFRequestAndPublishQMetrics(String queueGenericName, PCFM
137136
WMQMetricOverride wmqOverride = getMetricsToReport().get(metrickey);
138137
try{
139138
PCFParameter pcfParam = response[i].getParameter(wmqOverride.getConstantValue());
140-
if(pcfParam instanceof MQCFIN){
141-
int metricVal = response[i].getIntParameterValue(wmqOverride.getConstantValue());
142-
Metric metric = createMetric(metrickey, metricVal, wmqOverride, queueManager.getName(), getAtrifact(), queueName, metrickey);
143-
metrics.add(metric);
144-
}
145-
else if(pcfParam instanceof MQCFIL){
146-
int[] metricVals = response[i].getIntListParameterValue(wmqOverride.getConstantValue());
147-
if(metricVals != null){
148-
int count=0;
149-
for(int val : metricVals){
150-
count++;
151-
Metric metric = createMetric(metrickey+ "_" + Integer.toString(count), val, wmqOverride, queueManager.getName(), getAtrifact(), queueName, metrickey+ "_" + Integer.toString(count));
152-
metrics.add(metric);
139+
if (pcfParam != null) {
140+
if(pcfParam instanceof MQCFIN){
141+
int metricVal = response[i].getIntParameterValue(wmqOverride.getConstantValue());
142+
Metric metric = createMetric(metrickey, metricVal, wmqOverride, queueManager.getName(), getAtrifact(), queueName, metrickey);
143+
metrics.add(metric);
144+
}
145+
else if(pcfParam instanceof MQCFIL){
146+
int[] metricVals = response[i].getIntListParameterValue(wmqOverride.getConstantValue());
147+
if(metricVals != null){
148+
int count=0;
149+
for(int val : metricVals){
150+
count++;
151+
Metric metric = createMetric(metrickey+ "_" + Integer.toString(count), val, wmqOverride, queueManager.getName(), getAtrifact(), queueName, metrickey+ "_" + Integer.toString(count));
152+
metrics.add(metric);
153+
}
153154
}
154155
}
156+
} else {
157+
logger.warn("PCF parameter is null in response for Queue: {} for metric: {} in command {}", queueName, wmqOverride.getIbmCommand(),command);
155158
}
156159
}
157160
catch (PCFException pcfe) {
@@ -165,6 +168,5 @@ else if(pcfParam instanceof MQCFIL){
165168
logger.debug("Queue name {} is excluded.",queueName);
166169
}
167170
}
168-
169171
}
170172
}

src/main/java/com/appdynamics/extensions/webspheremq/metricscollector/TopicMetricsCollector.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public TopicMetricsCollector(Map<String, WMQMetricOverride> metricsToReport, Mon
4242
this.countDownLatch = countDownLatch;
4343
}
4444

45-
@Override
4645
public void run() {
4746
try {
4847
this.process();

0 commit comments

Comments
 (0)