3
3
import com .ojr .core .metric .MetricQueryResult ;
4
4
5
5
public class MQDcUtil {
6
+
7
+ /**
8
+ * Configuration Parameters:
9
+ */
10
+ public static final String PARAM_QUEUE_MANAGER = "queueManager" ;
11
+ public static final String PARAM_IS_LOCAL = "isLocal" ;
12
+ public static final String PARAM_USER = "user" ;
13
+ public static final String PARAM_PASSWORD = "password" ;
14
+ public static final String PARAM_HOST = "host" ;
15
+ public static final String PARAM_PORT = "port" ;
16
+ public static final String PARAM_CHANNEL = "channel" ;
17
+ public static final String PARAM_QUEUES_MONITORED = "queuesMonitored" ;
18
+ public static final String PARAM_CUSTOM_EVENT_QUEUES = "customEventQueues" ;
19
+ public static final String PARAM_KEYSTORE = "keystore" ;
20
+ public static final String PARAM_KEYSTORE_PASSWORD = "keystorePassword" ;
21
+ public static final String PARAM_CIPHER_SUITE = "cipherSuite" ;
22
+
23
+
6
24
/**
7
25
* Metrics definitions:
8
26
*/
@@ -12,82 +30,125 @@ public class MQDcUtil {
12
30
public static final String UNIT_STATUS = "{status}" ;
13
31
public static final String UNIT_COUNT = "{count}" ;
14
32
15
- public static final String QMGR_META = "qmgr.metadata" ;
33
+ public static final String QMGR_META = "ibmmq. qmgr.metadata" ;
16
34
public static final String QMGR_META_DESC = "The metadata of the queue manager" ;
17
35
public static final String QMGR_META_UNIT = "{metadata}" ;
18
36
public static final String VERSION = "version" ;
19
37
public static final String PLATFORM = "platform" ;
20
38
21
- public static final String QMGR_CMD_LEVEL = "qmgr.cmd.level" ;
39
+ public static final String QMGR_CMD_LEVEL = "ibmmq. qmgr.cmd.level" ;
22
40
public static final String QMGR_CMD_LEVEL_DESC = "The command level of the queue manager" ;
23
41
public static final String QMGR_CMD_LEVEL_UNIT = "{level}" ;
24
42
25
- public static final String QMGR_MAX_HANDLES = "qmgr.max.handles" ;
43
+ public static final String QMGR_MAX_HANDLES = "ibmmq. qmgr.max.handles" ;
26
44
public static final String QMGR_MAX_HANDLES_DESC = "Maximum handles of the queue manager" ;
27
45
public static final String QMGR_MAX_HANDLES_UNIT = UNIT_COUNT ;
28
46
29
- public static final String QMGR_CONNECTION_COUNT = "qmgr.connection.count" ;
47
+ public static final String QMGR_CONNECTION_COUNT = "ibmmq. qmgr.connection.count" ;
30
48
public static final String QMGR_CONNECTION_COUNT_DESC = "The count of connections to the queue manager" ;
31
49
public static final String QMGR_CONNECTION_COUNT_UNIT = UNIT_COUNT ;
32
50
33
- public static final String QMGR_STATUS = "qmgr.status" ;
51
+ public static final String QMGR_STATUS = "ibmmq. qmgr.status" ;
34
52
public static final String QMGR_STATUS_DESC = "The status of the queue manager. (1: STARTING, 2: RUNNING, 3: QUIESCING, 4: STANDBY)" ;
35
53
public static final String QMGR_STATUS_UNIT = UNIT_STATUS ;
36
54
37
- public static final String QMGR_CHINIT_STATUS = "qmgr.chinit.status" ;
55
+ public static final String QMGR_CHINIT_STATUS = "ibmmq. qmgr.chinit.status" ;
38
56
public static final String QMGR_CHINIT_STATUS_DESC = "The status of the channel initiator of the queue manager" +
39
- "(0: INACTIVE, 1: STARTING, 2: RUNNING, 3: STOPPING, 4: RETRYING)" ;
57
+ " (0: INACTIVE, 1: STARTING, 2: RUNNING, 3: STOPPING, 4: RETRYING)" ;
40
58
public static final String QMGR_CHINIT_STATUS_UNIT = UNIT_STATUS ;
41
59
42
- public static final String QMGR_START_TIME = "qmgr.start.time" ;
60
+ public static final String QMGR_START_TIME = "ibmmq. qmgr.start.time" ;
43
61
public static final String QMGR_START_TIME_DESC = "The time (Epoch second) when the queue manager was started" ;
44
62
public static final String QMGR_START_TIME_UNIT = UNIT_SEC ;
45
63
46
- public static final String QMGR_START_TIME_FORMATED = "qmgr.start.time.formated" ;
64
+ public static final String QMGR_START_TIME_FORMATED = "ibmmq. qmgr.start.time.formated" ;
47
65
public static final String QMGR_START_TIME_FORMATED_DESC = "The time (formated as \" yyyyMMdd.HHmmss\" ) when the queue manager was started" ;
48
66
public static final String QMGR_START_TIME_FORMATED_UNIT = "{time}" ;
49
67
50
- public static final String QMGR_PUBSUB_STATUS = "qmgr.pubsub.status" ;
68
+ public static final String QMGR_PUBSUB_STATUS = "ibmmq. qmgr.pubsub.status" ;
51
69
public static final String QMGR_PUBSUB_STATUS_DESC = "The status of the pub/sub of the queue manager" +
52
- "(0: INACTIVE, 1: STARTING, 2: STOPPING, 3: ACTIVE, 4: COMPAT, 5: ERROR, 6: REFUSED)" ;
70
+ " (0: INACTIVE, 1: STARTING, 2: STOPPING, 3: ACTIVE, 4: COMPAT, 5: ERROR, 6: REFUSED)" ;
53
71
public static final String QMGR_PUBSUB_STATUS_UNIT = UNIT_STATUS ;
54
72
55
- public static final String QUEUE_META = "queue.metadata" ;
73
+ public static final String QUEUE_META = "ibmmq. queue.metadata" ;
56
74
public static final String QUEUE_META_DESC = "The metadata of the queue" ;
57
75
public static final String QUEUE_META_UNIT = "{metadata}" ;
58
76
public static final String QUEUE = "queue" ;
59
77
public static final String TYPE = "type" ;
60
78
public static final String DELIVERY = "delivery" ;
61
79
public static final String USAGE = "usage" ;
62
80
63
- public static final String QUEUE_DEPTH = "queue.depth" ;
81
+ public static final String QUEUE_DEPTH = "ibmmq. queue.depth" ;
64
82
public static final String QUEUE_DEPTH_DESC = "Current depth of the queue" ;
65
83
public static final String QUEUE_DEPTH_UNIT = UNIT_COUNT ;
66
84
67
- public static final String QUEUE_MAX_DEPTH = "queue.max.depth" ;
85
+ public static final String QUEUE_MAX_DEPTH = "ibmmq. queue.max.depth" ;
68
86
public static final String QUEUE_MAX_DEPTH_DESC = "Maximum depth of the queue" ;
69
87
public static final String QUEUE_MAX_DEPTH_UNIT = UNIT_COUNT ;
70
88
71
- public static final String QUEUE_UNCOMMITED_MSG = "queue.uncommited.messages" ;
89
+ public static final String QUEUE_UNCOMMITED_MSG = "ibmmq. queue.uncommited.messages" ;
72
90
public static final String QUEUE_UNCOMMITED_MSG_DESC = "Uncommited messages of the queue" ;
73
91
public static final String QUEUE_UNCOMMITED_MSG_UNIT = UNIT_COUNT ;
74
92
75
- public static final String QUEUE_OPEN_INPUT = "queue.open.input" ;
93
+ public static final String QUEUE_OPEN_INPUT = "ibmmq. queue.open.input" ;
76
94
public static final String QUEUE_OPEN_INPUT_DESC = "Number of open for input from the queue" ;
77
95
public static final String QUEUE_OPEN_INPUT_UNIT = UNIT_COUNT ;
78
96
79
- public static final String QUEUE_OPEN_OUTPUT = "queue.open.output" ;
97
+ public static final String QUEUE_OPEN_OUTPUT = "ibmmq. queue.open.output" ;
80
98
public static final String QUEUE_OPEN_OUTPUT_DESC = "Number of open for output to the queue" ;
81
99
public static final String QUEUE_OPEN_OUTPUT_UNIT = UNIT_COUNT ;
82
100
83
- public static final String QUEUE_ENQ_COUNT = "queue.enq.count" ;
101
+ public static final String QUEUE_ENQ_COUNT = "ibmmq. queue.enq.count" ;
84
102
public static final String QUEUE_ENQ_COUNT_DESC = "The count of enqueue to the queue" ;
85
103
public static final String QUEUE_ENQ_COUNT_UNIT = UNIT_COUNT ;
86
104
87
- public static final String QUEUE_DEQ_COUNT = "queue.deq.count" ;
105
+ public static final String QUEUE_DEQ_COUNT = "ibmmq. queue.deq.count" ;
88
106
public static final String QUEUE_DEQ_COUNT_DESC = "The count of dequeue from the queue" ;
89
107
public static final String QUEUE_DEQ_COUNT_UNIT = UNIT_COUNT ;
90
108
109
+ public static final String LISTENER_META = "ibmmq.listener.metadata" ;
110
+ public static final String LISTENER_META_DESC = "The metadata of the listener" ;
111
+ public static final String LISTENER_META_UNIT = "{metadata}" ;
112
+ public static final String LISTENER = "listener" ;
113
+ public static final String IP = "ip" ;
114
+ public static final String PORT = "port" ;
115
+
116
+ public static final String LISTENER_STATUS = "ibmmq.listener.status" ;
117
+ public static final String LISTENER_STATUS_DESC = "The status of the listener" +
118
+ " (0: Stopped, 1: Quiescing, 2: Running, 3: Stopping, 4: Retrying)" ;
119
+ public static final String LISTENER_STATUS_UNIT = "{status}" ;
120
+
121
+ public static final String CHANNEL_STATUS = "ibmmq.channel.status" ;
122
+ public static final String CHANNEL_STATUS_DESC = "The status of the channel" +
123
+ " (0: Inactive, 1: Binding, 2: Quiescing, 3: Running, 4: Stopping, 5: Retrying, 6: Stopped, 7: Requesting, 8: Paused, 13: Initializing, 14: Switching)" ;
124
+ public static final String CHANNEL_STATUS_UNIT = "{status}" ;
125
+ public static final String CHANNEL = "channel" ;
126
+
127
+ public static final String CHANNEL_INDOUBT_STATUS = "ibmmq.channel.indoubt.status" ;
128
+ public static final String CHANNEL_INDOUBT_STATUS_DESC = "The in-doubt status of the channel (0: No, 1: Yes)" ;
129
+ public static final String CHANNEL_INDOUBT_STATUS_UNIT = "{status}" ;
130
+
131
+ public static final String CHANNEL_TYPE = "ibmmq.channel.type" ;
132
+ public static final String CHANNEL_TYPE_DESC = "The type of the channel" +
133
+ " (1: Sender, 2: Server, 3: Receiver, 4: Requester, 5: All, 6: Client connection, 7: Server connection, 8: Cluster receiver, 9: Cluster sender, 10: Telemetry channel, 11: AMQP)" ;
134
+ public static final String CHANNEL_TYPE_UNIT = "{type}" ;
135
+
136
+ public static final String CHANNEL_BUFFERS_SENT = "ibmmq.channel.buffers.sent" ;
137
+ public static final String CHANNEL_BUFFERS_SENT_DESC = "The number of buffers sent by the channel" ;
138
+ public static final String CHANNEL_BUFFERS_SENT_UNIT = UNIT_COUNT ;
139
+
140
+ public static final String CHANNEL_BUFFERS_RECEIVED = "ibmmq.channel.buffers.received" ;
141
+ public static final String CHANNEL_BUFFERS_RECEIVED_DESC = "The number of buffers received by the channel" ;
142
+ public static final String CHANNEL_BUFFERS_RECEIVED_UNIT = UNIT_COUNT ;
143
+
144
+ public static final String CHANNEL_BYTES_SENT = "ibmmq.channel.bytes.sent" ;
145
+ public static final String CHANNEL_BYTES_SENT_DESC = "The number of bytes sent by the channel" ;
146
+ public static final String CHANNEL_BYTES_SENT_UNIT = UNIT_COUNT ;
147
+
148
+ public static final String CHANNEL_BYTES_RECEIVED = "ibmmq.channel.bytes.received" ;
149
+ public static final String CHANNEL_BYTES_RECEIVED_DESC = "The number of bytes received by the channel" ;
150
+ public static final String CHANNEL_BYTES_RECEIVED_UNIT = UNIT_COUNT ;
151
+
91
152
92
153
/**
93
154
* Query results:
@@ -110,27 +171,34 @@ public static MetricQueryResult getQueueMetadataResult(String queue, String type
110
171
return result ;
111
172
}
112
173
113
-
114
- public static MetricQueryResult getSimpleQueueMetricResult (String queue , int depth ) {
115
- MetricQueryResult result = new MetricQueryResult (depth );
174
+ public static MetricQueryResult getSimpleQueueMetricResult (String queue , int value ) {
175
+ MetricQueryResult result = new MetricQueryResult (value );
116
176
result .setAttribute (QUEUE , queue );
117
177
result .setKey (queue );
118
178
return result ;
119
179
}
120
180
121
- /**
122
- * Configuration Parameters:
123
- */
124
- public static final String PARAM_QUEUE_MANAGER = "queueManager" ;
125
- public static final String PARAM_IS_LOCAL = "isLocal" ;
126
- public static final String PARAM_USER = "user" ;
127
- public static final String PARAM_PASSWORD = "password" ;
128
- public static final String PARAM_HOST = "host" ;
129
- public static final String PARAM_PORT = "port" ;
130
- public static final String PARAM_CHANNEL = "channel" ;
131
- public static final String PARAM_QUEUES_MONITORED = "queuesMonitored" ;
132
- public static final String PARAM_CUSTOM_EVENT_QUEUES = "customEventQueues" ;
133
- public static final String PARAM_KEYSTORE = "keystore" ;
134
- public static final String PARAM_KEYSTORE_PASSWORD = "keystorePassword" ;
135
- public static final String PARAM_CIPHER_SUITE = "cipherSuite" ;
181
+ public static MetricQueryResult getListenerMetadataResult (String listener , String ip , int port ) {
182
+ MetricQueryResult result = new MetricQueryResult (1 );
183
+ result .setAttribute (LISTENER , listener );
184
+ result .setAttribute (IP , ip );
185
+ result .setAttribute (PORT , port );
186
+ result .setKey (listener );
187
+ return result ;
188
+ }
189
+
190
+ public static MetricQueryResult getSimpleListenerMetricResult (String listener , int value ) {
191
+ MetricQueryResult result = new MetricQueryResult (value );
192
+ result .setAttribute (LISTENER , listener );
193
+ result .setKey (listener );
194
+ return result ;
195
+ }
196
+
197
+ public static MetricQueryResult getSimpleChannelMetricResult (String channel , int value ) {
198
+ MetricQueryResult result = new MetricQueryResult (value );
199
+ result .setAttribute (CHANNEL , channel );
200
+ result .setKey (channel );
201
+ return result ;
202
+ }
203
+
136
204
}
0 commit comments