Skip to content

Commit eb72465

Browse files
committed
Add SBSTATUS
1 parent 99a45f6 commit eb72465

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1576
-10679
lines changed

Gopkg.lock

Lines changed: 16 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[[constraint]]
22
name = "github.com/ibm-messaging/mq-golang"
3-
version = "4.0.3"
3+
version = "4.0.4"
44

55
[prune]
66
go-tests = true

cmd/mq_json/exporter.go

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
/*
4-
Copyright (c) IBM Corporation 2016, 2018
4+
Copyright (c) IBM Corporation 2016, 2019
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -122,6 +122,12 @@ func Collect() error {
122122
} else {
123123
log.Debugf("Collected all topic status")
124124
}
125+
err = mqmetric.CollectSubStatus("*")
126+
if err != nil {
127+
log.Errorf("Error collecting topic status: %v", err)
128+
} else {
129+
log.Debugf("Collected all topic status")
130+
}
125131

126132
if config.qStatus {
127133
err = mqmetric.CollectQueueStatus(config.monitoredQueues)
@@ -295,6 +301,36 @@ func Collect() error {
295301
}
296302
}
297303
}
304+
305+
for _, attr := range mqmetric.SubStatus.Attributes {
306+
for key, value := range attr.Values {
307+
if value.IsInt64 {
308+
subId := mqmetric.SubStatus.Attributes[mqmetric.ATTR_SUB_ID].Values[key].ValueString
309+
subName := mqmetric.SubStatus.Attributes[mqmetric.ATTR_SUB_NAME].Values[key].ValueString
310+
subType := int(mqmetric.SubStatus.Attributes[mqmetric.ATTR_SUB_TYPE].Values[key].ValueInt64)
311+
subTypeString := strings.Replace(ibmmq.MQItoString("SUBTYPE", subType), "MQSUBTYPE_", "", -1)
312+
topicString := mqmetric.SubStatus.Attributes[mqmetric.ATTR_SUB_TOPIC_STRING].Values[key].ValueString
313+
314+
key1 := subId
315+
316+
if pt, ok = ptMap[key1]; !ok {
317+
pt = pointsStruct{}
318+
pt.ObjectType = "subscription"
319+
pt.Metric = make(map[string]float64)
320+
pt.Tags = make(map[string]string)
321+
pt.Tags["qmgr"] = strings.TrimSpace(config.qMgrName)
322+
pt.Tags["platform"] = platformString
323+
pt.Tags["subid"] = subId
324+
pt.Tags["subscription"] = subName
325+
pt.Tags["type"] = subTypeString
326+
pt.Tags["topic"] = topicString
327+
}
328+
329+
pt.Metric[fixup(attr.MetricName)] = mqmetric.QueueManagerNormalise(attr, value.ValueInt64)
330+
ptMap[key1] = pt
331+
}
332+
}
333+
}
298334
}
299335

300336
for _, pt := range ptMap {

cmd/mq_json/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
/*
4-
Copyright (c) IBM Corporation 2016, 2018
4+
Copyright (c) IBM Corporation 2016, 2019
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)