|
15 | 15 | */
|
16 | 16 | package io.micrometer.core.instrument.binder.commonspool2;
|
17 | 17 |
|
| 18 | +import io.micrometer.common.KeyValue; |
18 | 19 | import io.micrometer.common.lang.NonNull;
|
19 | 20 | import io.micrometer.common.lang.Nullable;
|
20 | 21 | import io.micrometer.common.util.internal.logging.InternalLogger;
|
@@ -129,17 +130,18 @@ public void bindTo(@NonNull MeterRegistry registry) {
|
129 | 130 |
|
130 | 131 | private Iterable<Tag> nameTag(ObjectName name, String type)
|
131 | 132 | throws AttributeNotFoundException, MBeanException, ReflectionException, InstanceNotFoundException {
|
132 |
| - return Tags.of("name", name.getKeyProperty("name"), "type", type, "factoryType", getFactoryType(name, type)); |
| 133 | + return Tags.of("name", name.getKeyProperty("name"), "type", type, "factoryType", |
| 134 | + getFactoryTypeTagValue(name, type)); |
133 | 135 | }
|
134 | 136 |
|
135 |
| - private String getFactoryType(ObjectName name, String type) |
| 137 | + private String getFactoryTypeTagValue(ObjectName name, String type) |
136 | 138 | throws ReflectionException, AttributeNotFoundException, InstanceNotFoundException, MBeanException {
|
137 | 139 | if (Objects.equals(type, "GenericObjectPool")) {
|
138 | 140 | // for GenericObjectPool, we want to include the name and factoryType as tags
|
139 | 141 | return mBeanServer.getAttribute(name, "FactoryType").toString();
|
140 | 142 | }
|
141 | 143 | else {
|
142 |
| - return "none"; |
| 144 | + return KeyValue.NONE_VALUE; |
143 | 145 | }
|
144 | 146 | }
|
145 | 147 |
|
|
0 commit comments