From 53fe42c32be8ed00187ffaff8ed91bc41a9bcfaa Mon Sep 17 00:00:00 2001 From: ga-ram Date: Wed, 14 Dec 2022 18:52:36 +0900 Subject: [PATCH] [#9504] Cleanup --- .../plugin/ProfilerPluginSetupContext.java | 1 - .../bootstrap/plugin/http/URITemplate.java | 2 +- .../plugin/uri/BypassingUriExtractor.java | 22 ----- .../uri/BypassingUriExtractorService.java | 12 --- .../plugin/uri/DisabledUriStatRecorder.java | 37 --------- .../bootstrap/plugin/uri/UriExtractor.java | 36 -------- .../plugin/uri/UriExtractorChain.java | 68 --------------- .../plugin/uri/UriExtractorProvider.java | 31 ------- .../uri/UriExtractorProviderLocator.java | 30 ------- .../uri/UriExtractorProviderRegistry.java | 58 ------------- .../plugin/uri/UriExtractorService.java | 26 ------ .../uri/UriMappingExtractorProvider.java | 67 --------------- .../plugin/uri/UriStatRecorderFactory.java | 26 ------ .../uri/UriExtractorProviderRegistryTest.java | 66 --------------- .../common/trace/UriExtractorType.java | 30 ------- ...vletRequestAttributesMappingExtractor.java | 82 ------------------- .../ServletRequestUriExtractorService.java | 51 ------------ .../spring/web/SpringWebMvcConstants.java | 2 - .../pinpoint/plugin/vertx/VertxConstants.java | 1 - .../test/MockPluginContextLoadResult.java | 11 --- .../module/ApplicationContextModule.java | 6 -- .../provider/ObjectBinderFactoryProvider.java | 9 +- .../UriExtractorProviderLocatorProvider.java | 49 ----------- .../UriStatRecorderFactoryProvider.java | 46 ----------- .../recorder/DefaultUriStatRecorder.java | 78 ------------------ .../DefaultUriStatRecorderFactory.java | 56 ------------- .../storage/AsyncQueueingUriStatStorage.java | 2 +- .../factory/AnnotatedInterceptorFactory.java | 9 +- .../InterceptorArgumentProvider.java | 9 +- .../objectfactory/ObjectBinderFactory.java | 14 +--- .../DefaultPluginContextLoadResult.java | 14 ---- .../DefaultProfilerPluginSetupContext.java | 1 - .../GuardProfilerPluginSetupContext.java | 1 - .../plugin/PluginContextLoadResult.java | 2 - .../profiler/plugin/PluginSetupResult.java | 5 -- .../profiler/instrument/ASMClassTest.java | 5 +- .../AnnotatedInterceptorFactoryTest.java | 5 +- 37 files changed, 12 insertions(+), 958 deletions(-) delete mode 100644 bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/BypassingUriExtractor.java delete mode 100644 bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/BypassingUriExtractorService.java delete mode 100644 bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/DisabledUriStatRecorder.java delete mode 100644 bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractor.java delete mode 100644 bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorChain.java delete mode 100644 bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProvider.java delete mode 100644 bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderLocator.java delete mode 100644 bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderRegistry.java delete mode 100644 bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorService.java delete mode 100644 bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriMappingExtractorProvider.java delete mode 100644 bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriStatRecorderFactory.java delete mode 100644 bootstraps/bootstrap-core/src/test/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderRegistryTest.java delete mode 100644 commons/src/main/java/com/navercorp/pinpoint/common/trace/UriExtractorType.java delete mode 100644 plugins/common-servlet/src/main/java/com/navercorp/pinpoint/plugin/common/servlet/ServletRequestAttributesMappingExtractor.java delete mode 100644 plugins/common-servlet/src/main/java/com/navercorp/pinpoint/plugin/common/servlet/ServletRequestUriExtractorService.java delete mode 100644 profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/UriExtractorProviderLocatorProvider.java delete mode 100644 profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/UriStatRecorderFactoryProvider.java delete mode 100644 profiler/src/main/java/com/navercorp/pinpoint/profiler/context/recorder/DefaultUriStatRecorder.java delete mode 100644 profiler/src/main/java/com/navercorp/pinpoint/profiler/context/recorder/DefaultUriStatRecorderFactory.java diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/ProfilerPluginSetupContext.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/ProfilerPluginSetupContext.java index 43933c90049bf..eceaa0a298d20 100644 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/ProfilerPluginSetupContext.java +++ b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/ProfilerPluginSetupContext.java @@ -16,7 +16,6 @@ import com.navercorp.pinpoint.bootstrap.config.ProfilerConfig; import com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProvider; import com.navercorp.pinpoint.common.trace.ServiceType; /** diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/http/URITemplate.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/http/URITemplate.java index 40d1d154c6a77..7788e9c63e244 100644 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/http/URITemplate.java +++ b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/http/URITemplate.java @@ -7,5 +7,5 @@ public final class URITemplate { private URITemplate() { } - public static final String NOT_FOUNDED = "/NOT_FOUND_URI"; + public static final String NOT_FOUND = "/NOT_FOUND_URI"; } diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/BypassingUriExtractor.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/BypassingUriExtractor.java deleted file mode 100644 index 5b1428c53574f..0000000000000 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/BypassingUriExtractor.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.navercorp.pinpoint.bootstrap.plugin.uri; - -import com.navercorp.pinpoint.common.trace.UriExtractorType; - -public class BypassingUriExtractor implements UriExtractor { - public static final UriExtractorType TYPE = UriExtractorType.BYPASSING; - - @Override - public UriExtractorType getExtractorType() { - return TYPE; - } - - @Override - public String getUri(T target, String rawUrl) { - return null; - } - - @Override - public boolean usingUserInputAttribute() { - return false; - } -} diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/BypassingUriExtractorService.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/BypassingUriExtractorService.java deleted file mode 100644 index 6eb91d20743e3..0000000000000 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/BypassingUriExtractorService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.navercorp.pinpoint.bootstrap.plugin.uri; - -import java.util.Collections; - -public class BypassingUriExtractorService implements UriExtractorService { - @Override - public UriExtractor get(UriExtractorProviderLocator locator) { - BypassingUriExtractor extractor = new BypassingUriExtractor<>(); - return new UriExtractorChain<>(Collections.singletonList(extractor)); - } - -} diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/DisabledUriStatRecorder.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/DisabledUriStatRecorder.java deleted file mode 100644 index f840267bded6c..0000000000000 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/DisabledUriStatRecorder.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.bootstrap.plugin.uri; - - -/** - * @author Taejin Koo - */ -public class DisabledUriStatRecorder implements UriStatRecorder { - - private static final UriStatRecorder INSTANCE = new DisabledUriStatRecorder<>(); - - public static UriStatRecorder create() { - return (UriStatRecorder) INSTANCE; - } - - @Override - public String record(String uriTemplate, T request, String rawUri) { - // do nothing - return null; - } - -} diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractor.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractor.java deleted file mode 100644 index 6821aefc8d656..0000000000000 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractor.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.bootstrap.plugin.uri; - -import com.navercorp.pinpoint.common.trace.UriExtractorType; - - -/** - * Class that extract URI from Request - * (Ex : ServletRequestAttributesMappingExtractor is that extract URI from SevlerRequest's attributes) - * - * @author Taejin Koo - */ -public interface UriExtractor { - - UriExtractorType getExtractorType(); - - String getUri(T target, String rawUrl); - - boolean usingUserInputAttribute(); - -} diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorChain.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorChain.java deleted file mode 100644 index 54dcb577d75f7..0000000000000 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorChain.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.bootstrap.plugin.uri; - -import com.navercorp.pinpoint.common.trace.UriExtractorType; -import com.navercorp.pinpoint.common.util.CollectionUtils; - -import java.util.List; - -/** - * @author Taejin Koo - */ -public class UriExtractorChain implements UriExtractor { - - private final UriExtractor[] uriExtractorList; - - public UriExtractorChain(List> uriExtractorList) { - if (CollectionUtils.isEmpty(uriExtractorList)) { - throw new IllegalArgumentException("uriExtractorList may not be empty"); - } - this.uriExtractorList = uriExtractorList.toArray(new UriExtractor[0]); - } - - @Override - public UriExtractorType getExtractorType() { - return uriExtractorList[0].getExtractorType(); - } - - @Override - public String getUri(T target, String rawUrl) { - for (UriExtractor uriExtractor : uriExtractorList) { - if (uriExtractor.usingUserInputAttribute()) { - final String uri = uriExtractor.getUri(target, rawUrl); - if (uri != null) { - return uri; - } - } - } - - return null; - } - - @Override - public boolean usingUserInputAttribute() { - for (UriExtractor uriExtractor : uriExtractorList) { - boolean usingUserInputAttribute = uriExtractor.usingUserInputAttribute(); - if (usingUserInputAttribute) { - return true; - } - } - return false; - } - -} diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProvider.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProvider.java deleted file mode 100644 index 1222c958fde49..0000000000000 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProvider.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.bootstrap.plugin.uri; - -import com.navercorp.pinpoint.common.trace.UriExtractorType; - -/** - * Use this when processing request target is different from deciding how to extract - * ex) Spring plugin decides how to extract URI and Tomcat Plugin deals with extracting - * - * @author Taejin Koo - */ -public interface UriExtractorProvider { - - UriExtractorType getUriExtractorType(); - -} diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderLocator.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderLocator.java deleted file mode 100644 index 41894282641dc..0000000000000 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderLocator.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.bootstrap.plugin.uri; - -import com.navercorp.pinpoint.common.trace.UriExtractorType; - -import java.util.List; - -/** - * @author Taejin Koo - */ -public interface UriExtractorProviderLocator { - - List get(Class type, UriExtractorType uriExtractorType); - -} diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderRegistry.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderRegistry.java deleted file mode 100644 index a829e7a236c2a..0000000000000 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderRegistry.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.bootstrap.plugin.uri; - -import com.navercorp.pinpoint.common.trace.UriExtractorType; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * @author Taejin Koo - */ -public class UriExtractorProviderRegistry implements UriExtractorProviderLocator { - - private final List uriExtractorProviderList; - - public UriExtractorProviderRegistry(List uriExtractorProviderList) { - this.uriExtractorProviderList = Objects.requireNonNull(uriExtractorProviderList, "uriExtractorProviderList"); - } - - @Override - public List get(Class type, UriExtractorType uriExtractorType) { - List result = new ArrayList<>(); - for (UriExtractorProvider uriExtractorProvider : uriExtractorProviderList) { - if (!type.isInstance(uriExtractorProvider)) { - continue; - } - if (uriExtractorProvider.getUriExtractorType() == uriExtractorType) { - result.add((T) uriExtractorProvider); - } - } - - return result; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("UriExtractorProviderRegistry{"); - sb.append("uriExtractorProviderList=").append(uriExtractorProviderList); - sb.append('}'); - return sb.toString(); - } -} diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorService.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorService.java deleted file mode 100644 index b7c23ff0b7339..0000000000000 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorService.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.bootstrap.plugin.uri; - -/** - * @author Taejin Koo - */ -public interface UriExtractorService { - - UriExtractor get(UriExtractorProviderLocator uriExtractorProviderLocator); - -} diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriMappingExtractorProvider.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriMappingExtractorProvider.java deleted file mode 100644 index da5a7b4a03c54..0000000000000 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriMappingExtractorProvider.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.bootstrap.plugin.uri; - -import com.navercorp.pinpoint.common.trace.UriExtractorType; -import com.navercorp.pinpoint.common.util.ArrayUtils; - -import java.util.Arrays; -import java.util.Objects; - -/** - * @author Taejin Koo - */ -public class UriMappingExtractorProvider implements UriExtractorProvider { - - private final UriExtractorType uriExtractorType; - private final String[] mappingKeyCandidates; - - private final boolean useUserInputAttribute; - - public UriMappingExtractorProvider(UriExtractorType uriExtractorType, String[] mappingKeyCandidates, boolean useUserInputAttribute) { - this.uriExtractorType = Objects.requireNonNull(uriExtractorType, "uriExtractorType"); - - if (ArrayUtils.isEmpty(mappingKeyCandidates)) { - throw new IllegalArgumentException("mappingKeyCandidates may not be empty"); - } - this.mappingKeyCandidates = mappingKeyCandidates; - this.useUserInputAttribute = useUserInputAttribute; - } - - @Override - public UriExtractorType getUriExtractorType() { - return uriExtractorType; - } - - public String[] getMappingKeyCandidates() { - return mappingKeyCandidates; - } - - public boolean isUseUserInputAttribute() { - return useUserInputAttribute; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("UriMappingExtractorProvider{"); - sb.append("uriExtractorType=").append(uriExtractorType); - sb.append(", mappingKeyCandidates=").append(Arrays.toString(mappingKeyCandidates)); - sb.append('}'); - return sb.toString(); - } - -} diff --git a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriStatRecorderFactory.java b/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriStatRecorderFactory.java deleted file mode 100644 index 7a8bf4cc6e02b..0000000000000 --- a/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriStatRecorderFactory.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.bootstrap.plugin.uri; - -/** - * @author Taejin Koo - */ -public interface UriStatRecorderFactory { - - UriStatRecorder create(UriExtractorService uriExtractorService); - -} diff --git a/bootstraps/bootstrap-core/src/test/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderRegistryTest.java b/bootstraps/bootstrap-core/src/test/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderRegistryTest.java deleted file mode 100644 index 718007afcb1ee..0000000000000 --- a/bootstraps/bootstrap-core/src/test/java/com/navercorp/pinpoint/bootstrap/plugin/uri/UriExtractorProviderRegistryTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.bootstrap.plugin.uri; - -import com.navercorp.pinpoint.common.trace.UriExtractorType; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Taejin Koo - */ -public class UriExtractorProviderRegistryTest { - - @Test - public void providerRegistryTest() { - String[] parameterArray1 = {"hello"}; - UriMappingExtractorProvider provider1 - = new UriMappingExtractorProvider(UriExtractorType.SERVLET_REQUEST_ATTRIBUTE, parameterArray1, false); - - String[] parameterArray2 = {"hi"}; - UriMappingExtractorProvider provider2 - = new UriMappingExtractorProvider(UriExtractorType.SERVLET_REQUEST_ATTRIBUTE, parameterArray2, false); - - List uriExtractorProviderList = new ArrayList<>(); - uriExtractorProviderList.add(provider1); - uriExtractorProviderList.add(provider2); - - - UriExtractorProviderRegistry registry = new UriExtractorProviderRegistry(uriExtractorProviderList); - List result = registry.get(UriMappingExtractorProvider.class, UriExtractorType.SERVLET_REQUEST_ATTRIBUTE); - Assertions.assertEquals(2, result.size()); - - result = registry.get(UriMappingExtractorProvider.class, UriExtractorType.NONE); - Assertions.assertEquals(0, result.size()); - - List result2 = registry.get(MockUriExtractorProvider.class, UriExtractorType.SERVLET_REQUEST_ATTRIBUTE); - Assertions.assertEquals(0, result2.size()); - } - - static class MockUriExtractorProvider implements UriExtractorProvider { - - @Override - public UriExtractorType getUriExtractorType() { - return null; - } - - } - -} diff --git a/commons/src/main/java/com/navercorp/pinpoint/common/trace/UriExtractorType.java b/commons/src/main/java/com/navercorp/pinpoint/common/trace/UriExtractorType.java deleted file mode 100644 index 93f4a2c77a461..0000000000000 --- a/commons/src/main/java/com/navercorp/pinpoint/common/trace/UriExtractorType.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.common.trace; - -/** - * @author Taejin Koo - */ -public enum UriExtractorType { - - SERVLET_REQUEST_ATTRIBUTE, - - BYPASSING, - - NONE - -} diff --git a/plugins/common-servlet/src/main/java/com/navercorp/pinpoint/plugin/common/servlet/ServletRequestAttributesMappingExtractor.java b/plugins/common-servlet/src/main/java/com/navercorp/pinpoint/plugin/common/servlet/ServletRequestAttributesMappingExtractor.java deleted file mode 100644 index 5a75284fdfe75..0000000000000 --- a/plugins/common-servlet/src/main/java/com/navercorp/pinpoint/plugin/common/servlet/ServletRequestAttributesMappingExtractor.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.plugin.common.servlet; - -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractor; -import com.navercorp.pinpoint.common.trace.UriExtractorType; -import com.navercorp.pinpoint.common.util.ArrayUtils; -import com.navercorp.pinpoint.common.util.StringUtils; - -import javax.servlet.http.HttpServletRequest; -import java.util.Arrays; - -/** - * @author Taejin Koo - */ -public class ServletRequestAttributesMappingExtractor implements UriExtractor { - - static final UriExtractorType TYPE = UriExtractorType.SERVLET_REQUEST_ATTRIBUTE; - - private final String[] attributeNames; - private final boolean useUserInputAttribute; - - public ServletRequestAttributesMappingExtractor(String[] attributeNames, boolean useUserInputAttribute) { - if (ArrayUtils.isEmpty(attributeNames)) { - throw new IllegalArgumentException("attributeNames must not be empty"); - } - - this.attributeNames = attributeNames; - this.useUserInputAttribute = useUserInputAttribute; - } - - @Override - public UriExtractorType getExtractorType() { - return TYPE; - } - - @Override - public boolean usingUserInputAttribute() { - return useUserInputAttribute; - } - - @Override - public String getUri(HttpServletRequest request, String rawUri) { - if (useUserInputAttribute) { - for (String attributeName : attributeNames) { - Object uriMapping = request.getAttribute(attributeName); - if (!(uriMapping instanceof String)) { - continue; - } - - if (StringUtils.hasLength((String) uriMapping)) { - return (String) uriMapping; - } - } - } - - return null; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("ServletRequestAttributesMappingExtractor{"); - sb.append("attributeNames=").append(Arrays.toString(attributeNames)); - sb.append('}'); - return sb.toString(); - } - -} diff --git a/plugins/common-servlet/src/main/java/com/navercorp/pinpoint/plugin/common/servlet/ServletRequestUriExtractorService.java b/plugins/common-servlet/src/main/java/com/navercorp/pinpoint/plugin/common/servlet/ServletRequestUriExtractorService.java deleted file mode 100644 index 773b8ee04e393..0000000000000 --- a/plugins/common-servlet/src/main/java/com/navercorp/pinpoint/plugin/common/servlet/ServletRequestUriExtractorService.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.plugin.common.servlet; - -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractor; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorChain; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProviderLocator; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorService; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriMappingExtractorProvider; - -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Taejin Koo - */ -public class ServletRequestUriExtractorService implements UriExtractorService { - - @Override - public UriExtractor get(UriExtractorProviderLocator locator) { - List uriMappingExtractorProviderList = locator.get(UriMappingExtractorProvider.class, ServletRequestAttributesMappingExtractor.TYPE); - - List> result = new ArrayList<>(); - for (UriMappingExtractorProvider uriMappingExtractorProvider : uriMappingExtractorProviderList) { - ServletRequestAttributesMappingExtractor servletRequestAttributesMappingExtractor = new ServletRequestAttributesMappingExtractor(uriMappingExtractorProvider.getMappingKeyCandidates(), uriMappingExtractorProvider.isUseUserInputAttribute()); - result.add(servletRequestAttributesMappingExtractor); - } - - if (result.isEmpty()) { - return null; - } else { - return new UriExtractorChain<>(result); - } - } - -} diff --git a/plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/SpringWebMvcConstants.java b/plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/SpringWebMvcConstants.java index e56fe6758e2df..1fdd1a03e9c4d 100644 --- a/plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/SpringWebMvcConstants.java +++ b/plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/SpringWebMvcConstants.java @@ -18,7 +18,6 @@ import com.navercorp.pinpoint.common.trace.ServiceType; import com.navercorp.pinpoint.common.trace.ServiceTypeFactory; -import com.navercorp.pinpoint.common.trace.UriExtractorType; /** * @author Woonduk Kang(emeroad) @@ -29,7 +28,6 @@ private SpringWebMvcConstants() { public static final ServiceType SPRING_MVC = ServiceTypeFactory.of(5051, "SPRING_MVC", "SPRING"); - public static final UriExtractorType SPRING_MVC_URI_EXTRACTOR_TYPE = UriExtractorType.SERVLET_REQUEST_ATTRIBUTE; public static final String[] SPRING_MVC_DEFAULT_URI_ATTRIBUTE_KEYS = {"org.springframework.web.servlet.HandlerMapping.bestMatchingPattern"}; public static final String[] SPRING_MVC_URI_USER_INPUT_ATTRIBUTE_KEYS = {"pinpoint.metric.uri-template"}; diff --git a/plugins/vertx/src/main/java/com/navercorp/pinpoint/plugin/vertx/VertxConstants.java b/plugins/vertx/src/main/java/com/navercorp/pinpoint/plugin/vertx/VertxConstants.java index 147ad91e37f56..4521679ffd661 100644 --- a/plugins/vertx/src/main/java/com/navercorp/pinpoint/plugin/vertx/VertxConstants.java +++ b/plugins/vertx/src/main/java/com/navercorp/pinpoint/plugin/vertx/VertxConstants.java @@ -17,7 +17,6 @@ import com.navercorp.pinpoint.common.trace.ServiceType; import com.navercorp.pinpoint.common.trace.ServiceTypeProvider; -import com.navercorp.pinpoint.common.trace.UriExtractorType; /** * @author jaehong.kim diff --git a/profiler-test/src/main/java/com/navercorp/pinpoint/test/MockPluginContextLoadResult.java b/profiler-test/src/main/java/com/navercorp/pinpoint/test/MockPluginContextLoadResult.java index 23e24b93aa733..d95e15de21d24 100644 --- a/profiler-test/src/main/java/com/navercorp/pinpoint/test/MockPluginContextLoadResult.java +++ b/profiler-test/src/main/java/com/navercorp/pinpoint/test/MockPluginContextLoadResult.java @@ -18,7 +18,6 @@ import com.navercorp.pinpoint.bootstrap.plugin.ProfilerPlugin; import com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProvider; import com.navercorp.pinpoint.common.trace.ServiceType; import com.navercorp.pinpoint.loader.plugins.profiler.ProfilerPluginLoader; import com.navercorp.pinpoint.profiler.plugin.PluginContextLoadResult; @@ -88,14 +87,4 @@ public List getJdbcUrlParserList() { return result; } - @Override - public List getUriExtractorProviderList() { - final List result = new ArrayList<>(); - PluginsSetupResult pluginsSetupResult = getPluginsSetupResult(); - for (PluginSetupResult context : pluginsSetupResult.getPluginSetupResults()) { - List uriExtractorProviderList = context.getUriExtractorProviderList(); - result.addAll(uriExtractorProviderList); - } - return result; - } } diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/module/ApplicationContextModule.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/module/ApplicationContextModule.java index fb384a0b6b501..bc75d1dbd92a0 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/module/ApplicationContextModule.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/module/ApplicationContextModule.java @@ -23,16 +23,12 @@ import com.navercorp.pinpoint.bootstrap.plugin.RequestRecorderFactory; import com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcContext; import com.navercorp.pinpoint.bootstrap.plugin.jdbc.BindVariableService; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProviderLocator; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriStatRecorderFactory; import com.navercorp.pinpoint.bootstrap.sampler.Sampler; import com.navercorp.pinpoint.bootstrap.sampler.TraceSampler; import com.navercorp.pinpoint.common.trace.ServiceType; import com.navercorp.pinpoint.profiler.AgentInfoSender; import com.navercorp.pinpoint.profiler.AgentInformation; import com.navercorp.pinpoint.profiler.context.provider.BindVariableServiceProvider; -import com.navercorp.pinpoint.profiler.context.provider.UriExtractorProviderLocatorProvider; -import com.navercorp.pinpoint.profiler.context.provider.UriStatRecorderFactoryProvider; import com.navercorp.pinpoint.profiler.context.provider.UriStatStorageProvider; import com.navercorp.pinpoint.profiler.context.storage.UriStatStorage; import com.navercorp.pinpoint.profiler.transformer.DefaultDynamicTransformerRegistry; @@ -199,8 +195,6 @@ protected void configure() { bind(BindVariableService.class).toProvider(BindVariableServiceProvider.class).in(Scopes.SINGLETON); - bind(UriExtractorProviderLocator.class).toProvider(UriExtractorProviderLocatorProvider.class).in(Scopes.SINGLETON); - bind(UriStatRecorderFactory.class).toProvider(UriStatRecorderFactoryProvider.class).in(Scopes.SINGLETON); bind(UriStatStorage.class).toProvider(UriStatStorageProvider.class).in(Scopes.SINGLETON); bind(AgentInformation.class).toProvider(AgentInformationProvider.class).in(Scopes.SINGLETON); diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/ObjectBinderFactoryProvider.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/ObjectBinderFactoryProvider.java index e697bdf4d353f..efe83fd438137 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/ObjectBinderFactoryProvider.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/ObjectBinderFactoryProvider.java @@ -19,7 +19,6 @@ import com.navercorp.pinpoint.bootstrap.config.ProfilerConfig; import com.navercorp.pinpoint.bootstrap.context.TraceContext; import com.navercorp.pinpoint.bootstrap.plugin.RequestRecorderFactory; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriStatRecorderFactory; import com.navercorp.pinpoint.profiler.context.monitor.DataSourceMonitorRegistryService; import com.navercorp.pinpoint.profiler.context.monitor.metric.CustomMetricRegistryService; import com.navercorp.pinpoint.profiler.interceptor.factory.ExceptionHandlerFactory; @@ -44,8 +43,6 @@ public class ObjectBinderFactoryProvider implements Provider uriStatRecorderFactoryProvider; - @Inject public ObjectBinderFactoryProvider(ProfilerConfig profilerConfig, @@ -54,8 +51,7 @@ public ObjectBinderFactoryProvider(ProfilerConfig profilerConfig, DataSourceMonitorRegistryService dataSourceMonitorRegistryService, Provider apiMetaDataServiceProvider, ExceptionHandlerFactory exceptionHandlerFactory, - RequestRecorderFactory requestRecorderFactory, - Provider uriStatRecorderFactoryProvider) { + RequestRecorderFactory requestRecorderFactory) { this.profilerConfig = Objects.requireNonNull(profilerConfig, "profilerConfig"); this.traceContextProvider = Objects.requireNonNull(traceContextProvider, "traceContextProvider"); this.dataSourceMonitorRegistryService = Objects.requireNonNull(dataSourceMonitorRegistryService, "dataSourceMonitorRegistryService"); @@ -64,14 +60,13 @@ public ObjectBinderFactoryProvider(ProfilerConfig profilerConfig, this.exceptionHandlerFactory = Objects.requireNonNull(exceptionHandlerFactory, "exceptionHandlerFactory"); this.requestRecorderFactory = Objects.requireNonNull(requestRecorderFactory, "requestRecorderFactory"); - this.uriStatRecorderFactoryProvider = Objects.requireNonNull(uriStatRecorderFactoryProvider, "uriStatRecorderFactoryProvider"); } @Override public ObjectBinderFactory get() { return new ObjectBinderFactory(profilerConfig, traceContextProvider, dataSourceMonitorRegistryService, customMetricRegistryService, apiMetaDataServiceProvider, - exceptionHandlerFactory, requestRecorderFactory, uriStatRecorderFactoryProvider); + exceptionHandlerFactory, requestRecorderFactory); } } diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/UriExtractorProviderLocatorProvider.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/UriExtractorProviderLocatorProvider.java deleted file mode 100644 index 2fc8969df8eb8..0000000000000 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/UriExtractorProviderLocatorProvider.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.profiler.context.provider; - -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProvider; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProviderLocator; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProviderRegistry; -import java.util.Objects; -import com.navercorp.pinpoint.profiler.plugin.PluginContextLoadResult; - -import com.google.inject.Inject; -import com.google.inject.Provider; - -import java.util.List; - -/** - * @author Taejin Koo - */ -public class UriExtractorProviderLocatorProvider implements Provider { - - private final Provider pluginContextLoadResultProvider; - - @Inject - public UriExtractorProviderLocatorProvider(Provider pluginContextLoadResultProvider) { - this.pluginContextLoadResultProvider = Objects.requireNonNull(pluginContextLoadResultProvider, "pluginContextLoadResultProvider"); - } - - @Override - public UriExtractorProviderLocator get() { - PluginContextLoadResult pluginContextLoadResult = this.pluginContextLoadResultProvider.get(); - List uriExtractorProviderList = pluginContextLoadResult.getUriExtractorProviderList(); - return new UriExtractorProviderRegistry(uriExtractorProviderList); - } - -} diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/UriStatRecorderFactoryProvider.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/UriStatRecorderFactoryProvider.java deleted file mode 100644 index c8bfefd20dea1..0000000000000 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/UriStatRecorderFactoryProvider.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.profiler.context.provider; - -import com.google.inject.Inject; -import com.google.inject.Provider; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProviderLocator; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriStatRecorderFactory; -import com.navercorp.pinpoint.profiler.context.monitor.config.MonitorConfig; -import com.navercorp.pinpoint.profiler.context.recorder.DefaultUriStatRecorderFactory; - -import java.util.Objects; - -/** - * @author Taejin Koo - */ -public class UriStatRecorderFactoryProvider implements Provider { - - private final Provider uriExtractorProviderLocatorProvider; - - @Inject - public UriStatRecorderFactoryProvider(Provider uriExtractorProviderLocatorProvider){ - this.uriExtractorProviderLocatorProvider = Objects.requireNonNull(uriExtractorProviderLocatorProvider, "uriExtractorProviderLocatorProvider"); - } - - @Override - public UriStatRecorderFactory get() { - return new DefaultUriStatRecorderFactory(uriExtractorProviderLocatorProvider); - } - -} - diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/recorder/DefaultUriStatRecorder.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/recorder/DefaultUriStatRecorder.java deleted file mode 100644 index de17757d47c60..0000000000000 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/recorder/DefaultUriStatRecorder.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.profiler.context.recorder; - -import com.navercorp.pinpoint.bootstrap.plugin.http.URITemplate; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractor; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriStatRecorder; -import com.navercorp.pinpoint.common.util.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.util.List; -import java.util.Objects; - -/** - * @author Taejin Koo - */ -public class DefaultUriStatRecorder implements UriStatRecorder { - - private final Logger logger = LogManager.getLogger(this.getClass()); - private final String[] DEFAULT_OFTEN_USED_URL = {"/", "/index.html", "/main"}; - private final List defaultResourcePostfixes; - - private final UriExtractor uriExtractor; - - - public DefaultUriStatRecorder(UriExtractor uriExtractor, String oftenUsedResources) { - this.uriExtractor = Objects.requireNonNull(uriExtractor, "uriExtractor"); - String resourcesPostfixes = Objects.requireNonNull(oftenUsedResources, "oftenUsedResources"); - this.defaultResourcePostfixes = StringUtils.tokenizeToStringList(resourcesPostfixes, ","); - } - - @Override - public String record(String uriTemplate, T request, String rawUri) { - - String userAttributeUri = uriExtractor.getUri(request, rawUri); - if (userAttributeUri != null) { - return userAttributeUri; - } else if (uriTemplate != null) { - return uriTemplate; - } - - String uri = checkOftenUsed(rawUri); - if (uri == null) { - uri = URITemplate.NOT_FOUNDED; - } - return uri; - } - - private String checkOftenUsed(String rawUri) { - for (String oftenUsedUrl : DEFAULT_OFTEN_USED_URL) { - if (oftenUsedUrl.equals(rawUri)) { - return oftenUsedUrl; - } - } - for (String oftenUsedResources : defaultResourcePostfixes) { - if (rawUri.endsWith(oftenUsedResources)) { - return "*" + oftenUsedResources; - } - } - return null; - } - -} diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/recorder/DefaultUriStatRecorderFactory.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/recorder/DefaultUriStatRecorderFactory.java deleted file mode 100644 index 2b2fce98415e3..0000000000000 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/recorder/DefaultUriStatRecorderFactory.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.profiler.context.recorder; - -import com.google.inject.Provider; -import com.navercorp.pinpoint.bootstrap.plugin.uri.DisabledUriStatRecorder; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractor; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProviderLocator; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorService; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriStatRecorder; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriStatRecorderFactory; -import com.navercorp.pinpoint.profiler.context.monitor.config.MonitorConfig; - -import java.util.Objects; - -/** - * @author Taejin Koo - */ -public class DefaultUriStatRecorderFactory implements UriStatRecorderFactory { - - private final UriExtractorProviderLocator uriExtractorProviderLocator; - - public DefaultUriStatRecorderFactory(Provider uriExtractorProviderLocatorProvider) { - Objects.requireNonNull(uriExtractorProviderLocatorProvider, "uriExtractorProviderLocatorProvider"); - - UriExtractorProviderLocator uriExtractorProviderLocator = uriExtractorProviderLocatorProvider.get(); - this.uriExtractorProviderLocator = Objects.requireNonNull(uriExtractorProviderLocator, "uriExtractorProviderLocator"); - } - - @Override - public UriStatRecorder create(UriExtractorService uriExtractorService) { - Objects.requireNonNull(uriExtractorService, "uriExtractorService"); - UriExtractor uriExtractor = uriExtractorService.get(uriExtractorProviderLocator); - - if (uriExtractor == null) { - return DisabledUriStatRecorder.create(); - } else { - return new DefaultUriStatRecorder<>(uriExtractor); - } - } - -} diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/storage/AsyncQueueingUriStatStorage.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/storage/AsyncQueueingUriStatStorage.java index e9a369191382b..23c2bb21f3952 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/storage/AsyncQueueingUriStatStorage.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/storage/AsyncQueueingUriStatStorage.java @@ -58,7 +58,7 @@ private AsyncQueueingUriStatStorage(int queueSize, String executorName, Executor @Override public void store(String uri, boolean status, long startTime, long endTime) { if (uri == null) { - uri = URITemplate.NOT_FOUNDED; + uri = URITemplate.NOT_FOUND; } UriStatInfo uriStatInfo = new UriStatInfo(uri, status, startTime, endTime); execute(uriStatInfo); diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/interceptor/factory/AnnotatedInterceptorFactory.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/interceptor/factory/AnnotatedInterceptorFactory.java index 5ec2e3b4b8a15..aed3fa718f860 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/interceptor/factory/AnnotatedInterceptorFactory.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/interceptor/factory/AnnotatedInterceptorFactory.java @@ -64,7 +64,6 @@ import com.navercorp.pinpoint.bootstrap.plugin.RequestRecorderFactory; import com.navercorp.pinpoint.bootstrap.plugin.monitor.DataSourceMonitorRegistry; import com.navercorp.pinpoint.bootstrap.plugin.monitor.metric.CustomMetricRegistry; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriStatRecorderFactory; import com.navercorp.pinpoint.profiler.instrument.ScopeInfo; import com.navercorp.pinpoint.profiler.metadata.ApiMetaDataService; import com.navercorp.pinpoint.profiler.objectfactory.AutoBindingObjectFactory; @@ -86,7 +85,6 @@ public class AnnotatedInterceptorFactory implements InterceptorFactory { private final InstrumentContext pluginContext; private final ExceptionHandlerFactory exceptionHandlerFactory; private final RequestRecorderFactory requestRecorderFactory; - private final UriStatRecorderFactory uriStatRecorderFactory; public AnnotatedInterceptorFactory(ProfilerConfig profilerConfig, TraceContext traceContext, @@ -95,8 +93,7 @@ public AnnotatedInterceptorFactory(ProfilerConfig profilerConfig, ApiMetaDataService apiMetaDataService, InstrumentContext pluginContext, ExceptionHandlerFactory exceptionHandlerFactory, - RequestRecorderFactory requestRecorderFactory, - UriStatRecorderFactory uriStatRecorderFactory) { + RequestRecorderFactory requestRecorderFactory) { this.profilerConfig = Objects.requireNonNull(profilerConfig, "profilerConfig"); this.traceContext = Objects.requireNonNull(traceContext, "traceContext"); this.dataSourceMonitorRegistry = Objects.requireNonNull(dataSourceMonitorRegistry, "dataSourceMonitorRegistry"); @@ -106,7 +103,6 @@ public AnnotatedInterceptorFactory(ProfilerConfig profilerConfig, this.pluginContext = Objects.requireNonNull(pluginContext, "pluginContext"); this.exceptionHandlerFactory = Objects.requireNonNull(exceptionHandlerFactory, "exceptionHandlerFactory"); this.requestRecorderFactory = Objects.requireNonNull(requestRecorderFactory, "requestRecorderFactory"); - this.uriStatRecorderFactory = Objects.requireNonNull(uriStatRecorderFactory, "uriStatRecorderFactory"); } @Override @@ -116,8 +112,7 @@ public Interceptor newInterceptor(Class interceptorClass, Object[] providedAr final InterceptorScope interceptorScope = scopeInfo.getInterceptorScope(); InterceptorArgumentProvider interceptorArgumentProvider = new InterceptorArgumentProvider(dataSourceMonitorRegistry, - customMetricRegistry, apiMetaDataService, requestRecorderFactory, uriStatRecorderFactory, - interceptorScope, target, targetMethod); + customMetricRegistry, apiMetaDataService, requestRecorderFactory, interceptorScope, target, targetMethod); AutoBindingObjectFactory factory = new AutoBindingObjectFactory(profilerConfig, traceContext, pluginContext, interceptorClass.getClassLoader()); Interceptor interceptor = (Interceptor) factory.createInstance(interceptorClass, providedArguments, interceptorArgumentProvider); diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/objectfactory/InterceptorArgumentProvider.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/objectfactory/InterceptorArgumentProvider.java index 642cc9141ce5d..e77c1df1d6e4c 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/objectfactory/InterceptorArgumentProvider.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/objectfactory/InterceptorArgumentProvider.java @@ -23,7 +23,6 @@ import com.navercorp.pinpoint.bootstrap.plugin.RequestRecorderFactory; import com.navercorp.pinpoint.bootstrap.plugin.monitor.DataSourceMonitorRegistry; import com.navercorp.pinpoint.bootstrap.plugin.monitor.metric.CustomMetricRegistry; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriStatRecorderFactory; import com.navercorp.pinpoint.exception.PinpointException; import com.navercorp.pinpoint.profiler.metadata.ApiMetaDataService; import com.navercorp.pinpoint.profiler.util.TypeUtils; @@ -42,22 +41,19 @@ public class InterceptorArgumentProvider implements ArgumentProvider { private final InstrumentClass targetClass; private final InstrumentMethod targetMethod; private final RequestRecorderFactory requestRecorderFactory; - private final UriStatRecorderFactory uriStatRecorderFactory; public InterceptorArgumentProvider(DataSourceMonitorRegistry dataSourceMonitorRegistry, CustomMetricRegistry customMetricRegistry, ApiMetaDataService apiMetaDataService, RequestRecorderFactory requestRecorderFactory, - UriStatRecorderFactory uriStatRecorderFactory, InstrumentClass targetClass) { - this(dataSourceMonitorRegistry, customMetricRegistry, apiMetaDataService, requestRecorderFactory, uriStatRecorderFactory, null, targetClass, null); + this(dataSourceMonitorRegistry, customMetricRegistry, apiMetaDataService, requestRecorderFactory, null, targetClass, null); } public InterceptorArgumentProvider(DataSourceMonitorRegistry dataSourceMonitorRegistry, CustomMetricRegistry customMetricRegistry, ApiMetaDataService apiMetaDataService, RequestRecorderFactory requestRecorderFactory, - UriStatRecorderFactory uriStatRecorderFactory, InterceptorScope interceptorScope, InstrumentClass targetClass, InstrumentMethod targetMethod) { this.dataSourceMonitorRegistry = Objects.requireNonNull(dataSourceMonitorRegistry, "dataSourceMonitorRegistry"); @@ -65,7 +61,6 @@ public InterceptorArgumentProvider(DataSourceMonitorRegistry dataSourceMonitorRe this.apiMetaDataService = Objects.requireNonNull(apiMetaDataService, "apiMetaDataService"); this.requestRecorderFactory = requestRecorderFactory; - this.uriStatRecorderFactory = uriStatRecorderFactory; this.interceptorScope = interceptorScope; this.targetClass = targetClass; this.targetMethod = targetMethod; @@ -101,8 +96,6 @@ public Option get(int index, Class type, Annotation[] annotations) { return Option.withValue(requestRecorderFactory); } else if (type == CustomMetricRegistry.class) { return Option.withValue(customMetricRegistry); - } else if (type == UriStatRecorderFactory.class) { - return Option.withValue(uriStatRecorderFactory); } return Option.empty(); diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/objectfactory/ObjectBinderFactory.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/objectfactory/ObjectBinderFactory.java index 915cabe8bff21..09c085a19c90a 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/objectfactory/ObjectBinderFactory.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/objectfactory/ObjectBinderFactory.java @@ -23,7 +23,6 @@ import com.navercorp.pinpoint.bootstrap.plugin.RequestRecorderFactory; import com.navercorp.pinpoint.bootstrap.plugin.monitor.DataSourceMonitorRegistry; import com.navercorp.pinpoint.bootstrap.plugin.monitor.metric.CustomMetricRegistry; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriStatRecorderFactory; import com.navercorp.pinpoint.profiler.context.monitor.DataSourceMonitorRegistryAdaptor; import com.navercorp.pinpoint.profiler.context.monitor.DataSourceMonitorRegistryService; import com.navercorp.pinpoint.profiler.context.monitor.metric.CustomMetricRegistryAdaptor; @@ -48,7 +47,6 @@ public class ObjectBinderFactory { private final ExceptionHandlerFactory exceptionHandlerFactory; private final RequestRecorderFactory requestRecorderFactory; - private final Provider uriStatRecorderFactoryProvider; public ObjectBinderFactory(ProfilerConfig profilerConfig, @@ -57,8 +55,7 @@ public ObjectBinderFactory(ProfilerConfig profilerConfig, CustomMetricRegistryService customMonitorRegistryService, Provider apiMetaDataServiceProvider, ExceptionHandlerFactory exceptionHandlerFactory, - RequestRecorderFactory requestRecorderFactory, - Provider uriStatRecorderFactoryProvider) { + RequestRecorderFactory requestRecorderFactory) { this.profilerConfig = Objects.requireNonNull(profilerConfig, "profilerConfig"); this.traceContextProvider = Objects.requireNonNull(traceContextProvider, "traceContextProvider"); @@ -72,8 +69,6 @@ public ObjectBinderFactory(ProfilerConfig profilerConfig, this.exceptionHandlerFactory = Objects.requireNonNull(exceptionHandlerFactory, "exceptionHandlerFactory"); this.requestRecorderFactory = Objects.requireNonNull(requestRecorderFactory, "requestRecorderFactory"); - - this.uriStatRecorderFactoryProvider = Objects.requireNonNull(uriStatRecorderFactoryProvider, "uriStatRecorderFactoryProvider"); } public AutoBindingObjectFactory newAutoBindingObjectFactory(InstrumentContext pluginContext, ClassLoader classLoader, ArgumentProvider... argumentProviders) { @@ -84,17 +79,14 @@ public AutoBindingObjectFactory newAutoBindingObjectFactory(InstrumentContext pl public InterceptorArgumentProvider newInterceptorArgumentProvider(InstrumentClass instrumentClass) { ApiMetaDataService apiMetaDataService = this.apiMetaDataServiceProvider.get(); - - UriStatRecorderFactory uriStatRecorderFactory = uriStatRecorderFactoryProvider.get(); - return new InterceptorArgumentProvider(dataSourceMonitorRegistry, customMetricRegistry, apiMetaDataService, requestRecorderFactory, uriStatRecorderFactory, instrumentClass); + return new InterceptorArgumentProvider(dataSourceMonitorRegistry, customMetricRegistry, apiMetaDataService, requestRecorderFactory, instrumentClass); } public AnnotatedInterceptorFactory newAnnotatedInterceptorFactory(InstrumentContext pluginContext) { final TraceContext traceContext = this.traceContextProvider.get(); ApiMetaDataService apiMetaDataService = this.apiMetaDataServiceProvider.get(); - UriStatRecorderFactory uriStatRecorderFactory = uriStatRecorderFactoryProvider.get(); return new AnnotatedInterceptorFactory(profilerConfig, traceContext, dataSourceMonitorRegistry, customMetricRegistry, apiMetaDataService, - pluginContext, exceptionHandlerFactory, requestRecorderFactory, uriStatRecorderFactory); + pluginContext, exceptionHandlerFactory, requestRecorderFactory); } } diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/DefaultPluginContextLoadResult.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/DefaultPluginContextLoadResult.java index 8b5579da51d1c..959c384b311df 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/DefaultPluginContextLoadResult.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/DefaultPluginContextLoadResult.java @@ -17,7 +17,6 @@ package com.navercorp.pinpoint.profiler.plugin; import com.navercorp.pinpoint.bootstrap.plugin.ProfilerPlugin; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProvider; import com.navercorp.pinpoint.common.trace.ServiceType; import java.util.Objects; import com.navercorp.pinpoint.loader.plugins.profiler.ProfilerPluginLoader; @@ -70,17 +69,4 @@ public List getJdbcUrlParserList() { return result; } - @Override - public List getUriExtractorProviderList() { - final List result = new ArrayList<>(); - - for (PluginSetupResult context : pluginsSetupResult.getPluginSetupResults()) { - List uriExtractorProviderList= context.getUriExtractorProviderList(); - result.addAll(uriExtractorProviderList); - } - - return result; - } - - } diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/DefaultProfilerPluginSetupContext.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/DefaultProfilerPluginSetupContext.java index 4e685a40a6d97..010bf8fe1d77d 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/DefaultProfilerPluginSetupContext.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/DefaultProfilerPluginSetupContext.java @@ -20,7 +20,6 @@ import com.navercorp.pinpoint.bootstrap.plugin.ProfilerPluginGlobalContext; import com.navercorp.pinpoint.bootstrap.plugin.ProfilerPluginSetupContext; import com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProvider; import com.navercorp.pinpoint.common.trace.ServiceType; import java.util.Objects; diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/GuardProfilerPluginSetupContext.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/GuardProfilerPluginSetupContext.java index 03fc71c993b12..4ad679b21399f 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/GuardProfilerPluginSetupContext.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/GuardProfilerPluginSetupContext.java @@ -19,7 +19,6 @@ import com.navercorp.pinpoint.bootstrap.config.ProfilerConfig; import com.navercorp.pinpoint.bootstrap.plugin.ProfilerPluginSetupContext; import com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProvider; import com.navercorp.pinpoint.common.trace.ServiceType; import java.util.Objects; diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginContextLoadResult.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginContextLoadResult.java index 4482767971668..e6d671394d390 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginContextLoadResult.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginContextLoadResult.java @@ -17,7 +17,6 @@ package com.navercorp.pinpoint.profiler.plugin; import com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProvider; import com.navercorp.pinpoint.common.trace.ServiceType; import java.lang.instrument.ClassFileTransformer; @@ -34,5 +33,4 @@ public interface PluginContextLoadResult { List getJdbcUrlParserList(); - List getUriExtractorProviderList(); } diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginSetupResult.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginSetupResult.java index f9c502a35c87d..96346139b3b1a 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginSetupResult.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginSetupResult.java @@ -17,7 +17,6 @@ package com.navercorp.pinpoint.profiler.plugin; import com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriExtractorProvider; import java.lang.instrument.ClassFileTransformer; import java.util.List; @@ -43,8 +42,4 @@ public List getClassTransformerList() { return transformerRegistry.getClassTransformerList(); } - public List getUriExtractorProviderList() { - return this.setupContext.getUriExtractorProviderList(); - } - } diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassTest.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassTest.java index ba2b2c488aa91..813b814aba662 100644 --- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassTest.java +++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassTest.java @@ -24,7 +24,6 @@ import com.navercorp.pinpoint.bootstrap.instrument.InstrumentMethod; import com.navercorp.pinpoint.bootstrap.instrument.MethodFilters; import com.navercorp.pinpoint.bootstrap.plugin.RequestRecorderFactory; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriStatRecorderFactory; import com.navercorp.pinpoint.profiler.context.monitor.DataSourceMonitorRegistryService; import com.navercorp.pinpoint.profiler.context.monitor.metric.CustomMetricRegistryService; import com.navercorp.pinpoint.profiler.instrument.interceptor.InterceptorDefinitionFactory; @@ -82,11 +81,9 @@ public class ASMClassTest { private final ExceptionHandlerFactory exceptionHandlerFactory = new ExceptionHandlerFactory(false); private final RequestRecorderFactory requestRecorderFactory = mock(RequestRecorderFactory.class); - private final Provider uriStatRecorderFactoryProvider = Providers.of(mock(UriStatRecorderFactory.class)); private final ObjectBinderFactory objectBinderFactory = new ObjectBinderFactory(profilerConfig, traceContextProvider, dataSourceMonitorRegistryService, - customMetricRegistryService, apiMetaDataService, exceptionHandlerFactory, - requestRecorderFactory, uriStatRecorderFactoryProvider); + customMetricRegistryService, apiMetaDataService, exceptionHandlerFactory, requestRecorderFactory); private final ScopeFactory scopeFactory = new ScopeFactory(); private final InterceptorDefinitionFactory interceptorDefinitionFactory = new InterceptorDefinitionFactory(); diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/plugin/AnnotatedInterceptorFactoryTest.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/plugin/AnnotatedInterceptorFactoryTest.java index 6b32d31eb844a..f896012934ffc 100644 --- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/plugin/AnnotatedInterceptorFactoryTest.java +++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/plugin/AnnotatedInterceptorFactoryTest.java @@ -27,7 +27,6 @@ import com.navercorp.pinpoint.bootstrap.plugin.RequestRecorderFactory; import com.navercorp.pinpoint.bootstrap.plugin.monitor.DataSourceMonitorRegistry; import com.navercorp.pinpoint.bootstrap.plugin.monitor.metric.CustomMetricRegistry; -import com.navercorp.pinpoint.bootstrap.plugin.uri.UriStatRecorderFactory; import com.navercorp.pinpoint.exception.PinpointException; import com.navercorp.pinpoint.profiler.instrument.ScopeInfo; import com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory; @@ -65,7 +64,6 @@ public class AnnotatedInterceptorFactoryTest { private final InstrumentMethod instrumentMethod = mock(InstrumentMethod.class); private final MethodDescriptor descriptor = mock(MethodDescriptor.class); private final RequestRecorderFactory requestRecorderFactory = mock(RequestRecorderFactory.class); - private final UriStatRecorderFactory uriStatRecorderFactory = mock(UriStatRecorderFactory.class); private final ExceptionHandlerFactory exceptionHandlerFactory = new ExceptionHandlerFactory(false); @@ -88,8 +86,7 @@ public Class answer(InvocationOnMock invocation) throws Throwable { private AnnotatedInterceptorFactory newAnnotatedInterceptorFactory() { return new AnnotatedInterceptorFactory(profilerConfig, traceContext, dataSourceMonitorRegistry, customMetricRegistry, - apiMetaDataService, pluginContext, exceptionHandlerFactory, requestRecorderFactory, - uriStatRecorderFactory); + apiMetaDataService, pluginContext, exceptionHandlerFactory, requestRecorderFactory); } private ScopeInfo newEmptyScopeInfo() {