Skip to content

Commit 7d5b775

Browse files
committed
make the counter and gauges function different to reflect what they do
1 parent b45afeb commit 7d5b775

5 files changed

Lines changed: 12 additions & 59 deletions

File tree

ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqMonitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void run(QueueManager queueManager) {
109109
if (e.getCause() instanceof MQException) {
110110
MQException mqe = (MQException) e.getCause();
111111
String errorCode = String.valueOf(mqe.getReason());
112-
producer.recordIbmMqConnectionErrors(
112+
producer.addIbmMqConnectionErrors(
113113
1, Attributes.of(IBM_MQ_QUEUE_MANAGER, queueManagerName, ERROR_CODE, errorCode));
114114
}
115115
} finally {

ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/metrics/MetricProducer.java

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public MetricProducer(Resource resource, InstrumentationScopeInfo info) {
5353
}
5454

5555
public void recordIbmMqMessageRetryCount(long value, Attributes attributes) {
56-
5756
List<MetricData> currentMetrics = this.metricData.get();
5857
if (currentMetrics != null) {
5958
currentMetrics.add(
@@ -72,7 +71,6 @@ public void recordIbmMqMessageRetryCount(long value, Attributes attributes) {
7271
}
7372

7473
public void recordIbmMqStatus(long value, Attributes attributes) {
75-
7674
List<MetricData> currentMetrics = this.metricData.get();
7775
if (currentMetrics != null) {
7876
currentMetrics.add(
@@ -91,7 +89,6 @@ public void recordIbmMqStatus(long value, Attributes attributes) {
9189
}
9290

9391
public void recordIbmMqMaxSharingConversations(long value, Attributes attributes) {
94-
9592
List<MetricData> currentMetrics = this.metricData.get();
9693
if (currentMetrics != null) {
9794
currentMetrics.add(
@@ -110,7 +107,6 @@ public void recordIbmMqMaxSharingConversations(long value, Attributes attributes
110107
}
111108

112109
public void recordIbmMqCurrentSharingConversations(long value, Attributes attributes) {
113-
114110
List<MetricData> currentMetrics = this.metricData.get();
115111
if (currentMetrics != null) {
116112
currentMetrics.add(
@@ -129,7 +125,6 @@ public void recordIbmMqCurrentSharingConversations(long value, Attributes attrib
129125
}
130126

131127
public void recordIbmMqByteReceived(long value, Attributes attributes) {
132-
133128
List<MetricData> currentMetrics = this.metricData.get();
134129
if (currentMetrics != null) {
135130
currentMetrics.add(
@@ -148,7 +143,6 @@ public void recordIbmMqByteReceived(long value, Attributes attributes) {
148143
}
149144

150145
public void recordIbmMqByteSent(long value, Attributes attributes) {
151-
152146
List<MetricData> currentMetrics = this.metricData.get();
153147
if (currentMetrics != null) {
154148
currentMetrics.add(
@@ -167,7 +161,6 @@ public void recordIbmMqByteSent(long value, Attributes attributes) {
167161
}
168162

169163
public void recordIbmMqBuffersReceived(long value, Attributes attributes) {
170-
171164
List<MetricData> currentMetrics = this.metricData.get();
172165
if (currentMetrics != null) {
173166
currentMetrics.add(
@@ -186,7 +179,6 @@ public void recordIbmMqBuffersReceived(long value, Attributes attributes) {
186179
}
187180

188181
public void recordIbmMqBuffersSent(long value, Attributes attributes) {
189-
190182
List<MetricData> currentMetrics = this.metricData.get();
191183
if (currentMetrics != null) {
192184
currentMetrics.add(
@@ -205,7 +197,6 @@ public void recordIbmMqBuffersSent(long value, Attributes attributes) {
205197
}
206198

207199
public void recordIbmMqMessageCount(long value, Attributes attributes) {
208-
209200
List<MetricData> currentMetrics = this.metricData.get();
210201
if (currentMetrics != null) {
211202
currentMetrics.add(
@@ -224,7 +215,6 @@ public void recordIbmMqMessageCount(long value, Attributes attributes) {
224215
}
225216

226217
public void recordIbmMqOpenInputCount(long value, Attributes attributes) {
227-
228218
List<MetricData> currentMetrics = this.metricData.get();
229219
if (currentMetrics != null) {
230220
currentMetrics.add(
@@ -243,7 +233,6 @@ public void recordIbmMqOpenInputCount(long value, Attributes attributes) {
243233
}
244234

245235
public void recordIbmMqOpenOutputCount(long value, Attributes attributes) {
246-
247236
List<MetricData> currentMetrics = this.metricData.get();
248237
if (currentMetrics != null) {
249238
currentMetrics.add(
@@ -262,7 +251,6 @@ public void recordIbmMqOpenOutputCount(long value, Attributes attributes) {
262251
}
263252

264253
public void recordIbmMqHighQueueDepth(long value, Attributes attributes) {
265-
266254
List<MetricData> currentMetrics = this.metricData.get();
267255
if (currentMetrics != null) {
268256
currentMetrics.add(
@@ -281,7 +269,6 @@ public void recordIbmMqHighQueueDepth(long value, Attributes attributes) {
281269
}
282270

283271
public void recordIbmMqServiceInterval(long value, Attributes attributes) {
284-
285272
List<MetricData> currentMetrics = this.metricData.get();
286273
if (currentMetrics != null) {
287274
currentMetrics.add(
@@ -299,8 +286,7 @@ public void recordIbmMqServiceInterval(long value, Attributes attributes) {
299286
}
300287
}
301288

302-
public void recordIbmMqQueueDepthFullEvent(long value, Attributes attributes) {
303-
289+
public void addIbmMqQueueDepthFullEvent(long value, Attributes attributes) {
304290
long cumulativeValue =
305291
this.counterIbmMqQueueDepthFullEvent.compute(
306292
attributes,
@@ -333,8 +319,7 @@ public void recordIbmMqQueueDepthFullEvent(long value, Attributes attributes) {
333319
}
334320
}
335321

336-
public void recordIbmMqQueueDepthHighEvent(long value, Attributes attributes) {
337-
322+
public void addIbmMqQueueDepthHighEvent(long value, Attributes attributes) {
338323
long cumulativeValue =
339324
this.counterIbmMqQueueDepthHighEvent.compute(
340325
attributes,
@@ -367,8 +352,7 @@ public void recordIbmMqQueueDepthHighEvent(long value, Attributes attributes) {
367352
}
368353
}
369354

370-
public void recordIbmMqQueueDepthLowEvent(long value, Attributes attributes) {
371-
355+
public void addIbmMqQueueDepthLowEvent(long value, Attributes attributes) {
372356
long cumulativeValue =
373357
this.counterIbmMqQueueDepthLowEvent.compute(
374358
attributes,
@@ -402,7 +386,6 @@ public void recordIbmMqQueueDepthLowEvent(long value, Attributes attributes) {
402386
}
403387

404388
public void recordIbmMqExpiredMessages(long value, Attributes attributes) {
405-
406389
List<MetricData> currentMetrics = this.metricData.get();
407390
if (currentMetrics != null) {
408391
currentMetrics.add(
@@ -421,7 +404,6 @@ public void recordIbmMqExpiredMessages(long value, Attributes attributes) {
421404
}
422405

423406
public void recordIbmMqUncommittedMessages(long value, Attributes attributes) {
424-
425407
List<MetricData> currentMetrics = this.metricData.get();
426408
if (currentMetrics != null) {
427409
currentMetrics.add(
@@ -440,7 +422,6 @@ public void recordIbmMqUncommittedMessages(long value, Attributes attributes) {
440422
}
441423

442424
public void recordIbmMqOldestMsgAge(long value, Attributes attributes) {
443-
444425
List<MetricData> currentMetrics = this.metricData.get();
445426
if (currentMetrics != null) {
446427
currentMetrics.add(
@@ -459,7 +440,6 @@ public void recordIbmMqOldestMsgAge(long value, Attributes attributes) {
459440
}
460441

461442
public void recordIbmMqCurrentMaxQueueFilesize(long value, Attributes attributes) {
462-
463443
List<MetricData> currentMetrics = this.metricData.get();
464444
if (currentMetrics != null) {
465445
currentMetrics.add(
@@ -478,7 +458,6 @@ public void recordIbmMqCurrentMaxQueueFilesize(long value, Attributes attributes
478458
}
479459

480460
public void recordIbmMqCurrentQueueFilesize(long value, Attributes attributes) {
481-
482461
List<MetricData> currentMetrics = this.metricData.get();
483462
if (currentMetrics != null) {
484463
currentMetrics.add(
@@ -497,7 +476,6 @@ public void recordIbmMqCurrentQueueFilesize(long value, Attributes attributes) {
497476
}
498477

499478
public void recordIbmMqInstancesPerClient(long value, Attributes attributes) {
500-
501479
List<MetricData> currentMetrics = this.metricData.get();
502480
if (currentMetrics != null) {
503481
currentMetrics.add(
@@ -516,7 +494,6 @@ public void recordIbmMqInstancesPerClient(long value, Attributes attributes) {
516494
}
517495

518496
public void recordIbmMqMessageDeqCount(long value, Attributes attributes) {
519-
520497
List<MetricData> currentMetrics = this.metricData.get();
521498
if (currentMetrics != null) {
522499
currentMetrics.add(
@@ -535,7 +512,6 @@ public void recordIbmMqMessageDeqCount(long value, Attributes attributes) {
535512
}
536513

537514
public void recordIbmMqMessageEnqCount(long value, Attributes attributes) {
538-
539515
List<MetricData> currentMetrics = this.metricData.get();
540516
if (currentMetrics != null) {
541517
currentMetrics.add(
@@ -554,7 +530,6 @@ public void recordIbmMqMessageEnqCount(long value, Attributes attributes) {
554530
}
555531

556532
public void recordIbmMqQueueDepth(long value, Attributes attributes) {
557-
558533
List<MetricData> currentMetrics = this.metricData.get();
559534
if (currentMetrics != null) {
560535
currentMetrics.add(
@@ -573,7 +548,6 @@ public void recordIbmMqQueueDepth(long value, Attributes attributes) {
573548
}
574549

575550
public void recordIbmMqServiceIntervalEvent(long value, Attributes attributes) {
576-
577551
List<MetricData> currentMetrics = this.metricData.get();
578552
if (currentMetrics != null) {
579553
currentMetrics.add(
@@ -592,7 +566,6 @@ public void recordIbmMqServiceIntervalEvent(long value, Attributes attributes) {
592566
}
593567

594568
public void recordIbmMqReusableLogSize(long value, Attributes attributes) {
595-
596569
List<MetricData> currentMetrics = this.metricData.get();
597570
if (currentMetrics != null) {
598571
currentMetrics.add(
@@ -611,7 +584,6 @@ public void recordIbmMqReusableLogSize(long value, Attributes attributes) {
611584
}
612585

613586
public void recordIbmMqManagerActiveChannels(long value, Attributes attributes) {
614-
615587
List<MetricData> currentMetrics = this.metricData.get();
616588
if (currentMetrics != null) {
617589
currentMetrics.add(
@@ -630,7 +602,6 @@ public void recordIbmMqManagerActiveChannels(long value, Attributes attributes)
630602
}
631603

632604
public void recordIbmMqRestartLogSize(long value, Attributes attributes) {
633-
634605
List<MetricData> currentMetrics = this.metricData.get();
635606
if (currentMetrics != null) {
636607
currentMetrics.add(
@@ -649,7 +620,6 @@ public void recordIbmMqRestartLogSize(long value, Attributes attributes) {
649620
}
650621

651622
public void recordIbmMqMaxQueueDepth(long value, Attributes attributes) {
652-
653623
List<MetricData> currentMetrics = this.metricData.get();
654624
if (currentMetrics != null) {
655625
currentMetrics.add(
@@ -668,7 +638,6 @@ public void recordIbmMqMaxQueueDepth(long value, Attributes attributes) {
668638
}
669639

670640
public void recordIbmMqOnqtimeShortPeriod(long value, Attributes attributes) {
671-
672641
List<MetricData> currentMetrics = this.metricData.get();
673642
if (currentMetrics != null) {
674643
currentMetrics.add(
@@ -687,7 +656,6 @@ public void recordIbmMqOnqtimeShortPeriod(long value, Attributes attributes) {
687656
}
688657

689658
public void recordIbmMqOnqtimeLongPeriod(long value, Attributes attributes) {
690-
691659
List<MetricData> currentMetrics = this.metricData.get();
692660
if (currentMetrics != null) {
693661
currentMetrics.add(
@@ -706,7 +674,6 @@ public void recordIbmMqOnqtimeLongPeriod(long value, Attributes attributes) {
706674
}
707675

708676
public void recordIbmMqMessageReceivedCount(long value, Attributes attributes) {
709-
710677
List<MetricData> currentMetrics = this.metricData.get();
711678
if (currentMetrics != null) {
712679
currentMetrics.add(
@@ -725,7 +692,6 @@ public void recordIbmMqMessageReceivedCount(long value, Attributes attributes) {
725692
}
726693

727694
public void recordIbmMqMessageSentCount(long value, Attributes attributes) {
728-
729695
List<MetricData> currentMetrics = this.metricData.get();
730696
if (currentMetrics != null) {
731697
currentMetrics.add(
@@ -744,7 +710,6 @@ public void recordIbmMqMessageSentCount(long value, Attributes attributes) {
744710
}
745711

746712
public void recordIbmMqMaxInstances(long value, Attributes attributes) {
747-
748713
List<MetricData> currentMetrics = this.metricData.get();
749714
if (currentMetrics != null) {
750715
currentMetrics.add(
@@ -763,7 +728,6 @@ public void recordIbmMqMaxInstances(long value, Attributes attributes) {
763728
}
764729

765730
public void recordIbmMqConnectionCount(long value, Attributes attributes) {
766-
767731
List<MetricData> currentMetrics = this.metricData.get();
768732
if (currentMetrics != null) {
769733
currentMetrics.add(
@@ -782,7 +746,6 @@ public void recordIbmMqConnectionCount(long value, Attributes attributes) {
782746
}
783747

784748
public void recordIbmMqManagerStatus(long value, Attributes attributes) {
785-
786749
List<MetricData> currentMetrics = this.metricData.get();
787750
if (currentMetrics != null) {
788751
currentMetrics.add(
@@ -801,7 +764,6 @@ public void recordIbmMqManagerStatus(long value, Attributes attributes) {
801764
}
802765

803766
public void recordIbmMqHeartbeat(long value, Attributes attributes) {
804-
805767
List<MetricData> currentMetrics = this.metricData.get();
806768
if (currentMetrics != null) {
807769
currentMetrics.add(
@@ -820,7 +782,6 @@ public void recordIbmMqHeartbeat(long value, Attributes attributes) {
820782
}
821783

822784
public void recordIbmMqArchiveLogSize(long value, Attributes attributes) {
823-
824785
List<MetricData> currentMetrics = this.metricData.get();
825786
if (currentMetrics != null) {
826787
currentMetrics.add(
@@ -839,7 +800,6 @@ public void recordIbmMqArchiveLogSize(long value, Attributes attributes) {
839800
}
840801

841802
public void recordIbmMqManagerMaxActiveChannels(long value, Attributes attributes) {
842-
843803
List<MetricData> currentMetrics = this.metricData.get();
844804
if (currentMetrics != null) {
845805
currentMetrics.add(
@@ -858,7 +818,6 @@ public void recordIbmMqManagerMaxActiveChannels(long value, Attributes attribute
858818
}
859819

860820
public void recordIbmMqManagerStatisticsInterval(long value, Attributes attributes) {
861-
862821
List<MetricData> currentMetrics = this.metricData.get();
863822
if (currentMetrics != null) {
864823
currentMetrics.add(
@@ -877,7 +836,6 @@ public void recordIbmMqManagerStatisticsInterval(long value, Attributes attribut
877836
}
878837

879838
public void recordIbmMqPublishCount(long value, Attributes attributes) {
880-
881839
List<MetricData> currentMetrics = this.metricData.get();
882840
if (currentMetrics != null) {
883841
currentMetrics.add(
@@ -896,7 +854,6 @@ public void recordIbmMqPublishCount(long value, Attributes attributes) {
896854
}
897855

898856
public void recordIbmMqSubscriptionCount(long value, Attributes attributes) {
899-
900857
List<MetricData> currentMetrics = this.metricData.get();
901858
if (currentMetrics != null) {
902859
currentMetrics.add(
@@ -915,7 +872,6 @@ public void recordIbmMqSubscriptionCount(long value, Attributes attributes) {
915872
}
916873

917874
public void recordIbmMqListenerStatus(long value, Attributes attributes) {
918-
919875
List<MetricData> currentMetrics = this.metricData.get();
920876
if (currentMetrics != null) {
921877
currentMetrics.add(
@@ -933,8 +889,7 @@ public void recordIbmMqListenerStatus(long value, Attributes attributes) {
933889
}
934890
}
935891

936-
public void recordIbmMqUnauthorizedEvent(long value, Attributes attributes) {
937-
892+
public void addIbmMqUnauthorizedEvent(long value, Attributes attributes) {
938893
long cumulativeValue =
939894
this.counterIbmMqUnauthorizedEvent.compute(
940895
attributes,
@@ -968,7 +923,6 @@ public void recordIbmMqUnauthorizedEvent(long value, Attributes attributes) {
968923
}
969924

970925
public void recordIbmMqManagerMaxHandles(long value, Attributes attributes) {
971-
972926
List<MetricData> currentMetrics = this.metricData.get();
973927
if (currentMetrics != null) {
974928
currentMetrics.add(
@@ -986,8 +940,7 @@ public void recordIbmMqManagerMaxHandles(long value, Attributes attributes) {
986940
}
987941
}
988942

989-
public void recordIbmMqConnectionErrors(long value, Attributes attributes) {
990-
943+
public void addIbmMqConnectionErrors(long value, Attributes attributes) {
991944
long cumulativeValue =
992945
this.counterIbmMqConnectionErrors.compute(
993946
attributes,

0 commit comments

Comments
 (0)