3535 */
3636public class MicrometerNodeEnhancer {
3737
38+ private static final String UNUSED = "unused" ;
39+
40+ private static final String TAG_TYPE = "type" ;
41+
42+ private static final String TAG_NAME = "name" ;
43+
44+ private static final String TAG_RESULT = "result" ;
45+
3846 private static final TimerStats ZERO_TIMER_STATS = new TimerStats (0L , 0.0 , 0.0 );
3947
4048 private final MeterRegistry registry ;
@@ -81,25 +89,23 @@ private <T extends IntegrationNode> SendTimers retrieveTimers(T node, String typ
8189 Timer successTimer = null ;
8290 try {
8391 successTimer = this .registry .get (IntegrationManagement .SEND_TIMER_NAME )
84- .tag ("type" , type )
85- .tag ("name" , node .getName ())
86- .tag ("result" , "success" )
92+ .tag (TAG_TYPE , type )
93+ .tag (TAG_NAME , node .getName ())
94+ .tag (TAG_RESULT , "success" )
8795 .timer ();
8896 }
89- catch (@ SuppressWarnings ("unused" )
90- Exception e ) {
97+ catch (@ SuppressWarnings (UNUSED ) Exception e ) { // NOSONAR ignored
9198 // NOSONAR empty
9299 }
93100 Timer failureTimer = null ;
94101 try {
95102 failureTimer = this .registry .get (IntegrationManagement .SEND_TIMER_NAME )
96- .tag ("type" , type )
97- .tag ("name" , node .getName ())
98- .tag ("result" , "failure" )
103+ .tag (TAG_TYPE , type )
104+ .tag (TAG_NAME , node .getName ())
105+ .tag (TAG_RESULT , "failure" )
99106 .timer ();
100107 }
101- catch (@ SuppressWarnings ("unused" )
102- Exception e ) {
108+ catch (@ SuppressWarnings (UNUSED ) Exception e ) { // NOSONAR ignored
103109 // NOSONAR empty;
104110 }
105111 TimerStats successes = successTimer == null ? ZERO_TIMER_STATS
@@ -120,23 +126,23 @@ private <T extends IntegrationNode> ReceiveCounters retrieveCounters(T node, Str
120126 String name = node .getName ();
121127 try {
122128 successes = this .registry .get (IntegrationManagement .RECEIVE_COUNTER_NAME )
123- .tag ("type" , type )
124- .tag ("name" , name )
125- .tag ("result" , "success" )
129+ .tag (TAG_TYPE , type )
130+ .tag (TAG_NAME , name )
131+ .tag (TAG_RESULT , "success" )
126132 .counter ();
127133 }
128- catch (@ SuppressWarnings ("unused" ) Exception e ) {
134+ catch (@ SuppressWarnings (UNUSED ) Exception e ) { // NOSONAR ignored
129135 // NOSONAR empty;
130136 }
131137 Counter failures = null ;
132138 try {
133139 failures = this .registry .get (IntegrationManagement .RECEIVE_COUNTER_NAME )
134- .tag ("type" , type )
135- .tag ("name" , name )
136- .tag ("result" , "failure" )
140+ .tag (TAG_TYPE , type )
141+ .tag (TAG_NAME , name )
142+ .tag (TAG_RESULT , "failure" )
137143 .counter ();
138144 }
139- catch (@ SuppressWarnings ("unused" ) Exception e ) {
145+ catch (@ SuppressWarnings (UNUSED ) Exception e ) { // NOSONAR ignored
140146 // NOSONAR empty;
141147 }
142148 return new ReceiveCounters (
0 commit comments