Commit 7bbe0693 authored by 吴晟's avatar 吴晟
Browse files

Make service instrument works

parent 11b2170a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+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;


}
+4 −1
Original line number Diff line number Diff line
@@ -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 {
@@ -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;
        }
+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() {
    }
}
+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