@@ -73,6 +73,16 @@ const (
73
73
SQUASH_CHL_STATUS_RUNNING = 2
74
74
)
75
75
76
+ // If connected to a z/OS queue manager, the short/long index is
77
+ // as setup here. Otherwise we need to swap 0/1 indices.
78
+ func idxDefault (zos bool , val int ) int {
79
+ if zos {
80
+ return val
81
+ } else {
82
+ return (1 - val )
83
+ }
84
+ }
85
+
76
86
/*
77
87
Unlike the statistics produced via a topic, there is no discovery
78
88
of the attributes available in object STATUS queries. There is also
@@ -88,6 +98,11 @@ func ChannelInitAttributes() {
88
98
os := & ci .objectStatus [OT_CHANNEL ]
89
99
st := GetObjectStatus (GetConnectionKey (), OT_CHANNEL )
90
100
101
+ zos := false
102
+ if ci .si .platform == ibmmq .MQPL_ZOS {
103
+ zos = true
104
+ }
105
+
91
106
if os .init {
92
107
traceExit ("ChannelInitAttributes" , 1 )
93
108
return
@@ -143,26 +158,32 @@ func ChannelInitAttributes() {
143
158
st .Attributes [attr ].squash = true
144
159
os .init = true
145
160
161
+ // Some of the short/long status values are the opposite way round on the different platforms!
162
+ // Really a bug in the PCF code (internal reference 304982), but it's not likely to be fixed because of compatibility.
163
+ // In most cases, and always on ZOS, the SHORT is first followed by LONG. But the following
164
+ // attributes are reversed:
165
+ // COMPRESSION_RATE, COMPRESSION_TIME, EXIT_TIME: Not reported here anyway
166
+ // NETWORK_TIME, XMITQ_TIME, BATCH_SIZE: Reported here
146
167
attr = ATTR_CHL_NETTIME_SHORT
147
168
st .Attributes [attr ] = newStatusAttribute (attr , "Network Time Short" , ibmmq .MQIACH_NETWORK_TIME_INDICATOR )
148
- st .Attributes [attr ].index = 0
169
+ st .Attributes [attr ].index = idxDefault ( zos , 0 )
149
170
attr = ATTR_CHL_NETTIME_LONG
150
171
st .Attributes [attr ] = newStatusAttribute (attr , "Network Time Long" , ibmmq .MQIACH_NETWORK_TIME_INDICATOR )
151
- st .Attributes [attr ].index = 1
172
+ st .Attributes [attr ].index = idxDefault ( zos , 1 )
152
173
153
174
attr = ATTR_CHL_BATCHSZ_SHORT
154
175
st .Attributes [attr ] = newStatusAttribute (attr , "Batch Size Average Short" , ibmmq .MQIACH_BATCH_SIZE_INDICATOR )
155
- st .Attributes [attr ].index = 0
176
+ st .Attributes [attr ].index = idxDefault ( zos , 0 )
156
177
attr = ATTR_CHL_BATCHSZ_LONG
157
- st .Attributes [attr ] = newStatusAttribute (attr , "Batch Size Average Short " , ibmmq .MQIACH_BATCH_SIZE_INDICATOR )
158
- st .Attributes [attr ].index = 1
178
+ st .Attributes [attr ] = newStatusAttribute (attr , "Batch Size Average Long " , ibmmq .MQIACH_BATCH_SIZE_INDICATOR )
179
+ st .Attributes [attr ].index = idxDefault ( zos , 1 )
159
180
160
181
attr = ATTR_CHL_XQTIME_SHORT
161
182
st .Attributes [attr ] = newStatusAttribute (attr , "XmitQ Time Average Short" , ibmmq .MQIACH_XMITQ_TIME_INDICATOR )
162
- st .Attributes [attr ].index = 0
183
+ st .Attributes [attr ].index = idxDefault ( zos , 0 )
163
184
attr = ATTR_CHL_XQTIME_LONG
164
- st .Attributes [attr ] = newStatusAttribute (attr , "XmitQ Time Average Short " , ibmmq .MQIACH_XMITQ_TIME_INDICATOR )
165
- st .Attributes [attr ].index = 1
185
+ st .Attributes [attr ] = newStatusAttribute (attr , "XmitQ Time Average Long " , ibmmq .MQIACH_XMITQ_TIME_INDICATOR )
186
+ st .Attributes [attr ].index = idxDefault ( zos , 1 )
166
187
167
188
attr = ATTR_CHL_SINCE_MSG
168
189
st .Attributes [attr ] = newStatusAttribute (attr , "Time Since Msg" , - 1 )
0 commit comments