Loading apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ import java.util.ServiceLoader; */ public class ModuleManager { private Map<String, Module> loadedModules = new HashMap<>(); private boolean isServiceInstrument = false; private boolean isServiceInstrument = true; /** * Init the given modules Loading apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/instrument/MetricCollector.java 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright 2017, OpenSkywalking Organization All rights reserved. * * 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. * * Project repository: https://github.com/OpenSkywalking/skywalking */ package org.skywalking.apm.collector.core.module.instrument; /** * The <code>MetricCollector</code> collects the service metrics by Module/Provider/Service structure. */ public enum MetricCollector { INSTANCE; } apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/instrument/ServiceInstrumentation.java +4 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ import static net.bytebuddy.matcher.ElementMatchers.named; import static net.bytebuddy.matcher.ElementMatchers.not; /** * The <code>ServiceInstrumentation</code> create the dynamic service implementations based on the provider * implementation. So the new implementation will report performance metric to {@link MetricCollector}. * * @author wu-sheng */ public enum ServiceInstrumentation { Loading @@ -40,7 +43,7 @@ public enum ServiceInstrumentation { private ElementMatcher<? super MethodDescription> excludeObjectMethodsMatcher; public Service buildServiceUnderMonitor(Service implementation) { if (TracedService.class.isInstance(implementation)) { if (implementation instanceof TracedService) { // Duplicate service instrument, ignore. return implementation; } Loading apm-collector/apm-collector-core/src/test/java/org/skywalking/apm/collector/core/module/ModuleABusiness1Impl.java 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright 2017, OpenSkywalking Organization All rights reserved. * * 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. * * Project repository: https://github.com/OpenSkywalking/skywalking */ package org.skywalking.apm.collector.core.module; /** * @author wu-sheng */ public class ModuleABusiness1Impl implements BaseModuleA.ServiceABusiness1 { @Override public void print() { } } apm-collector/apm-collector-core/src/test/java/org/skywalking/apm/collector/core/module/ModuleABusiness2Impl.java 0 → 100644 +26 −0 Original line number Diff line number Diff line /* * Copyright 2017, OpenSkywalking Organization All rights reserved. * * 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. * * Project repository: https://github.com/OpenSkywalking/skywalking */ package org.skywalking.apm.collector.core.module; /** * @author wu-sheng */ public class ModuleABusiness2Impl implements BaseModuleA.ServiceABusiness2 { } Loading
apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ import java.util.ServiceLoader; */ public class ModuleManager { private Map<String, Module> loadedModules = new HashMap<>(); private boolean isServiceInstrument = false; private boolean isServiceInstrument = true; /** * Init the given modules Loading
apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/instrument/MetricCollector.java 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright 2017, OpenSkywalking Organization All rights reserved. * * 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. * * Project repository: https://github.com/OpenSkywalking/skywalking */ package org.skywalking.apm.collector.core.module.instrument; /** * The <code>MetricCollector</code> collects the service metrics by Module/Provider/Service structure. */ public enum MetricCollector { INSTANCE; }
apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/instrument/ServiceInstrumentation.java +4 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ import static net.bytebuddy.matcher.ElementMatchers.named; import static net.bytebuddy.matcher.ElementMatchers.not; /** * The <code>ServiceInstrumentation</code> create the dynamic service implementations based on the provider * implementation. So the new implementation will report performance metric to {@link MetricCollector}. * * @author wu-sheng */ public enum ServiceInstrumentation { Loading @@ -40,7 +43,7 @@ public enum ServiceInstrumentation { private ElementMatcher<? super MethodDescription> excludeObjectMethodsMatcher; public Service buildServiceUnderMonitor(Service implementation) { if (TracedService.class.isInstance(implementation)) { if (implementation instanceof TracedService) { // Duplicate service instrument, ignore. return implementation; } Loading
apm-collector/apm-collector-core/src/test/java/org/skywalking/apm/collector/core/module/ModuleABusiness1Impl.java 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright 2017, OpenSkywalking Organization All rights reserved. * * 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. * * Project repository: https://github.com/OpenSkywalking/skywalking */ package org.skywalking.apm.collector.core.module; /** * @author wu-sheng */ public class ModuleABusiness1Impl implements BaseModuleA.ServiceABusiness1 { @Override public void print() { } }
apm-collector/apm-collector-core/src/test/java/org/skywalking/apm/collector/core/module/ModuleABusiness2Impl.java 0 → 100644 +26 −0 Original line number Diff line number Diff line /* * Copyright 2017, OpenSkywalking Organization All rights reserved. * * 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. * * Project repository: https://github.com/OpenSkywalking/skywalking */ package org.skywalking.apm.collector.core.module; /** * @author wu-sheng */ public class ModuleABusiness2Impl implements BaseModuleA.ServiceABusiness2 { }