diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/pom.xml b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/pom.xml
deleted file mode 100644
index ca0eb81e014e4fa435b97f8236f317956300472b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/pom.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
- agent-grpc
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- agent-grpc-define
- jar
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
deleted file mode 100644
index 502c70faae94f0f7a06fc9567ebd69adda7b15e6..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-#
-
-org.apache.skywalking.apm.collector.agent.grpc.define.AgentGRPCModule
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/pom.xml b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/pom.xml
deleted file mode 100644
index b41ad3cd549e448eafe685a6a649bcca3f5ea72a..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/pom.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
- agent-grpc
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- agent-grpc-provider
-
- 1.14.0
- 20.0
-
-
-
-
- com.google.guava
- guava
-
-
-
-
-
- org.apache.skywalking
- agent-grpc-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-cluster-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-naming-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-grpc-manager-define
- ${project.version}
-
-
- org.apache.skywalking
- segment-parser-define
- ${project.version}
-
-
- org.apache.skywalking
- jvm-define
- ${project.version}
-
-
- org.apache.skywalking
- metric-define
- ${project.version}
-
-
- org.apache.skywalking
- register-define
- ${project.version}
-
-
- io.grpc
- grpc-testing
- ${grpc.version}
- test
-
-
- mockito-core
- org.mockito
-
-
-
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCConfig.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCConfig.java
deleted file mode 100644
index 47049d2a6884447ae9c7bd5df6dadd624da334a3..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCConfig.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider;
-
-import org.apache.skywalking.apm.collector.server.grpc.GRPCServerConfig;
-
-/**
- * @author peng-yongsheng
- */
-class AgentModuleGRPCConfig extends GRPCServerConfig {
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProvider.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProvider.java
deleted file mode 100644
index f4487171dd114cb42a56e0ae1ee5591be0d9c759..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProvider.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider;
-
-import java.io.File;
-import org.apache.skywalking.apm.collector.agent.grpc.define.AgentGRPCModule;
-import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.ApplicationRegisterServiceHandler;
-import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.InstanceDiscoveryServiceHandler;
-import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.JVMMetricsServiceHandler;
-import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.NetworkAddressRegisterServiceHandler;
-import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.ServiceNameDiscoveryServiceHandler;
-import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.TraceSegmentServiceHandler;
-import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming.AgentGRPCNamingHandler;
-import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming.AgentGRPCNamingListener;
-import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule;
-import org.apache.skywalking.apm.collector.analysis.segment.parser.define.AnalysisSegmentParserModule;
-import org.apache.skywalking.apm.collector.cluster.ClusterModule;
-import org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService;
-import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService;
-import org.apache.skywalking.apm.collector.core.module.ModuleDefine;
-import org.apache.skywalking.apm.collector.core.module.ModuleConfig;
-import org.apache.skywalking.apm.collector.core.module.ModuleProvider;
-import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.StringUtils;
-import org.apache.skywalking.apm.collector.grpc.manager.GRPCManagerModule;
-import org.apache.skywalking.apm.collector.grpc.manager.service.GRPCManagerService;
-import org.apache.skywalking.apm.collector.naming.NamingModule;
-import org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterService;
-import org.apache.skywalking.apm.collector.server.grpc.GRPCServer;
-import org.eclipse.jetty.util.StringUtil;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentModuleGRPCProvider extends ModuleProvider {
-
- public static final String NAME = "gRPC";
- private final AgentModuleGRPCConfig config;
-
- public AgentModuleGRPCProvider() {
- super();
- this.config = new AgentModuleGRPCConfig();
- }
-
- @Override
- public String name() {
- return NAME;
- }
-
- @Override
- public Class extends ModuleDefine> module() {
- return AgentGRPCModule.class;
- }
-
- @Override public ModuleConfig createConfigBeanIfAbsent() {
- return config;
- }
-
- @Override
- public void prepare() {
- }
-
- @Override
- public void start() throws ServiceNotProvidedException {
- String host = config.getHost();
- Integer port = config.getPort();
- String sslCertChainFilePath = config.getSslCertChainFilePath();
- String sslPrivateKeyFilePath = config.getSslPrivateKeyFilePath();
- String authentication = StringUtils.isNotEmpty(config.getAuthentication()) ? config.getAuthentication() : Const.EMPTY_STRING;
-
- AuthenticationSimpleChecker.INSTANCE.setExpectedToken(authentication);
- File sslCertChainFile = null;
- File sslPrivateKeyFile = null;
- if (StringUtil.isNotBlank(sslCertChainFilePath)) {
- sslCertChainFile = new File(sslCertChainFilePath);
- if (!(sslCertChainFile.exists() && sslCertChainFile.isFile())) {
- sslCertChainFile = null;
- }
- }
- if (StringUtil.isNotBlank(sslPrivateKeyFilePath)) {
- sslPrivateKeyFile = new File(sslPrivateKeyFilePath);
- if (!(sslPrivateKeyFile.exists() && sslPrivateKeyFile.isFile())) {
- sslPrivateKeyFile = null;
- }
- }
-
- ModuleRegisterService moduleRegisterService = getManager().find(ClusterModule.NAME).getService(ModuleRegisterService.class);
- moduleRegisterService.register(AgentGRPCModule.NAME, this.name(), new AgentModuleGRPCRegistration(host, port));
-
- AgentGRPCNamingListener namingListener = new AgentGRPCNamingListener();
- ModuleListenerService moduleListenerService = getManager().find(ClusterModule.NAME).getService(ModuleListenerService.class);
- moduleListenerService.addListener(namingListener);
-
- NamingHandlerRegisterService namingHandlerRegisterService = getManager().find(NamingModule.NAME).getService(NamingHandlerRegisterService.class);
- namingHandlerRegisterService.register(new AgentGRPCNamingHandler(namingListener));
-
- GRPCManagerService managerService = getManager().find(GRPCManagerModule.NAME).getService(GRPCManagerService.class);
- GRPCServer gRPCServer;
- if (sslCertChainFile != null && sslPrivateKeyFile != null) {
- gRPCServer = managerService.createIfAbsent(host, port, sslCertChainFile, sslPrivateKeyFile);
- } else {
- gRPCServer = managerService.createIfAbsent(host, port);
- }
-
- addHandlers(gRPCServer);
- }
-
- @Override
- public void notifyAfterCompleted() {
- }
-
- @Override
- public String[] requiredModules() {
- return new String[] {ClusterModule.NAME, NamingModule.NAME, GRPCManagerModule.NAME, AnalysisSegmentParserModule.NAME, AnalysisMetricModule.NAME};
- }
-
- private void addHandlers(GRPCServer gRPCServer) {
- AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new ApplicationRegisterServiceHandler(getManager()));
- AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new InstanceDiscoveryServiceHandler(getManager()));
- AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new ServiceNameDiscoveryServiceHandler(getManager()));
- AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new JVMMetricsServiceHandler(getManager()));
- AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new TraceSegmentServiceHandler(getManager()));
- AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new NetworkAddressRegisterServiceHandler(getManager()));
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleChecker.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleChecker.java
deleted file mode 100644
index 10e69da87b65a4e51ca46835b9f6babdf702003e..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleChecker.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider;
-
-import io.grpc.BindableService;
-import io.grpc.Metadata;
-import io.grpc.ServerCall;
-import io.grpc.ServerCallHandler;
-import io.grpc.ServerInterceptor;
-import io.grpc.ServerInterceptors;
-import io.grpc.Status;
-import org.apache.skywalking.apm.collector.core.util.StringUtils;
-import org.apache.skywalking.apm.collector.server.grpc.GRPCServer;
-
-/**
- * Active the authentication token checker if expected token exists in application.yml
- *
- * @author wusheng
- */
-public enum AuthenticationSimpleChecker {
- INSTANCE;
-
- private static final Metadata.Key AUTH_HEAD_HEADER_NAME =
- Metadata.Key.of("Authentication", Metadata.ASCII_STRING_MARSHALLER);
-
- private String expectedToken = "";
-
- public void build(GRPCServer gRPCServer, BindableService targetService) {
- if (StringUtils.isNotEmpty(expectedToken)) {
- gRPCServer.addHandler(ServerInterceptors.intercept(targetService, new ServerInterceptor() {
- @Override
- public ServerCall.Listener interceptCall(ServerCall serverCall,
- Metadata metadata,
- ServerCallHandler next) {
- String token = metadata.get(AUTH_HEAD_HEADER_NAME);
- if (expectedToken.equals(token)) {
- return next.startCall(serverCall, metadata);
- } else {
- serverCall.close(Status.PERMISSION_DENIED, new Metadata());
- return new ServerCall.Listener() {
- };
- }
-
- }
- }));
- } else {
- gRPCServer.addHandler(targetService);
- }
- }
-
- public void setExpectedToken(String expectedToken) {
- this.expectedToken = expectedToken;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandler.java
deleted file mode 100644
index 8c23d849ffc0efd99f717587ba181c3d21824ee0..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandler.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler;
-import org.apache.skywalking.apm.network.language.agent.Application;
-import org.apache.skywalking.apm.network.language.agent.ApplicationMapping;
-import org.apache.skywalking.apm.network.language.agent.ApplicationRegisterServiceGrpc;
-import org.apache.skywalking.apm.network.language.agent.KeyWithIntegerValue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationRegisterServiceHandler extends ApplicationRegisterServiceGrpc.ApplicationRegisterServiceImplBase implements GRPCHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(ApplicationRegisterServiceHandler.class);
-
- private final IApplicationIDService applicationIDService;
-
- public ApplicationRegisterServiceHandler(ModuleManager moduleManager) {
- applicationIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IApplicationIDService.class);
- }
-
- @Override
- public void applicationCodeRegister(Application request, StreamObserver responseObserver) {
- if (logger.isDebugEnabled()) {
- logger.debug("register application");
- }
-
- ApplicationMapping.Builder builder = ApplicationMapping.newBuilder();
- String applicationCode = request.getApplicationCode();
- int applicationId = applicationIDService.getOrCreateForApplicationCode(applicationCode);
-
- if (applicationId != 0) {
- KeyWithIntegerValue value = KeyWithIntegerValue.newBuilder().setKey(applicationCode).setValue(applicationId).build();
- builder.setApplication(value);
- }
- responseObserver.onNext(builder.build());
- responseObserver.onCompleted();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java
deleted file mode 100644
index b044211c48c4ad2fa8990e1089a6ed1335d3912c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule;
-import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService;
-import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.AgentOsInfo;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstance;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceHeartbeat;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceMapping;
-import org.apache.skywalking.apm.network.language.agent.Downstream;
-import org.apache.skywalking.apm.network.language.agent.InstanceDiscoveryServiceGrpc;
-import org.apache.skywalking.apm.network.language.agent.OSInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceDiscoveryServiceHandler extends InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceImplBase implements GRPCHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(InstanceDiscoveryServiceHandler.class);
-
- private final IInstanceIDService instanceIDService;
- private final IInstanceHeartBeatService instanceHeartBeatService;
-
- public InstanceDiscoveryServiceHandler(ModuleManager moduleManager) {
- this.instanceIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IInstanceIDService.class);
- this.instanceHeartBeatService = moduleManager.find(AnalysisMetricModule.NAME).getService(IInstanceHeartBeatService.class);
- }
-
- @Override
- public void registerInstance(ApplicationInstance request,
- StreamObserver responseObserver) {
- OSInfo osinfo = request.getOsinfo();
- AgentOsInfo agentOsInfo = new AgentOsInfo();
- agentOsInfo.setHostname(osinfo.getHostname());
- agentOsInfo.setOsName(osinfo.getOsName());
- agentOsInfo.setProcessNo(osinfo.getProcessNo());
- agentOsInfo.setIpv4s(osinfo.getIpv4SList());
-
- int instanceId = instanceIDService.getOrCreateByAgentUUID(request.getApplicationId(), request.getAgentUUID(), request.getRegisterTime(), agentOsInfo);
- ApplicationInstanceMapping.Builder builder = ApplicationInstanceMapping.newBuilder();
- builder.setApplicationId(request.getApplicationId());
- builder.setApplicationInstanceId(instanceId);
- responseObserver.onNext(builder.build());
- responseObserver.onCompleted();
- }
-
- @Override public void heartbeat(ApplicationInstanceHeartbeat request, StreamObserver responseObserver) {
- int instanceId = request.getApplicationInstanceId();
- long heartBeatTime = request.getHeartbeatTime();
- this.instanceHeartBeatService.heartBeat(instanceId, heartBeatTime);
- responseObserver.onNext(Downstream.getDefaultInstance());
- responseObserver.onCompleted();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandler.java
deleted file mode 100644
index 2608e42f193f489d553b729bb67f41d2acdf83d3..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandler.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import io.grpc.stub.StreamObserver;
-import java.util.List;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.AnalysisJVMModule;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.*;
-import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule;
-import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler;
-import org.apache.skywalking.apm.network.language.agent.*;
-import org.slf4j.*;
-
-/**
- * @author peng-yongsheng
- */
-public class JVMMetricsServiceHandler extends JVMMetricsServiceGrpc.JVMMetricsServiceImplBase implements GRPCHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(JVMMetricsServiceHandler.class);
-
- private final ICpuMetricService cpuMetricService;
- private final IGCMetricService gcMetricService;
- private final IMemoryMetricService memoryMetricService;
- private final IMemoryPoolMetricService memoryPoolMetricService;
- private final IInstanceHeartBeatService instanceHeartBeatService;
-
- public JVMMetricsServiceHandler(ModuleManager moduleManager) {
- this.cpuMetricService = moduleManager.find(AnalysisJVMModule.NAME).getService(ICpuMetricService.class);
- this.gcMetricService = moduleManager.find(AnalysisJVMModule.NAME).getService(IGCMetricService.class);
- this.memoryMetricService = moduleManager.find(AnalysisJVMModule.NAME).getService(IMemoryMetricService.class);
- this.memoryPoolMetricService = moduleManager.find(AnalysisJVMModule.NAME).getService(IMemoryPoolMetricService.class);
- this.instanceHeartBeatService = moduleManager.find(AnalysisMetricModule.NAME).getService(IInstanceHeartBeatService.class);
- }
-
- @Override public void collect(JVMMetrics request, StreamObserver responseObserver) {
- int instanceId = request.getApplicationInstanceId();
-
- if (logger.isDebugEnabled()) {
- logger.debug("receive the jvm metric from application instance, id: {}", instanceId);
- }
-
- request.getMetricsList().forEach(metric -> {
- long minuteTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(metric.getTime());
- sendToCpuMetricService(instanceId, minuteTimeBucket, metric.getCpu());
- sendToMemoryMetricService(instanceId, minuteTimeBucket, metric.getMemoryList());
- sendToMemoryPoolMetricService(instanceId, minuteTimeBucket, metric.getMemoryPoolList());
- sendToGCMetricService(instanceId, minuteTimeBucket, metric.getGcList());
- sendToInstanceHeartBeatService(instanceId, metric.getTime());
- });
-
- responseObserver.onNext(Downstream.newBuilder().build());
- responseObserver.onCompleted();
- }
-
- private void sendToMemoryMetricService(int instanceId, long timeBucket, List memories) {
- memories.forEach(memory -> memoryMetricService.send(instanceId, timeBucket, memory.getIsHeap(), memory.getInit(), memory.getMax(), memory.getUsed(), memory.getCommitted()));
- }
-
- private void sendToMemoryPoolMetricService(int instanceId, long timeBucket,
- List memoryPools) {
-
- memoryPools.forEach(memoryPool -> memoryPoolMetricService.send(instanceId, timeBucket, memoryPool.getType().getNumber(), memoryPool.getInit(), memoryPool.getMax(), memoryPool.getUsed(), memoryPool.getCommited()));
- }
-
- private void sendToCpuMetricService(int instanceId, long timeBucket, CPU cpu) {
- cpuMetricService.send(instanceId, timeBucket, cpu.getUsagePercent());
- }
-
- private void sendToGCMetricService(int instanceId, long timeBucket, List gcs) {
- gcs.forEach(gc -> gcMetricService.send(instanceId, timeBucket, gc.getPhraseValue(), gc.getCount(), gc.getTime()));
- }
-
- private void sendToInstanceHeartBeatService(int instanceId, long heartBeatTime) {
- instanceHeartBeatService.heartBeat(instanceId, heartBeatTime);
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandler.java
deleted file mode 100644
index 0ebaf87cc6113061c35d61a3e2e7f3b4d7f8d9c6..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandler.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import com.google.protobuf.ProtocolStringList;
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler;
-import org.apache.skywalking.apm.network.language.agent.KeyWithIntegerValue;
-import org.apache.skywalking.apm.network.language.agent.NetworkAddressMappings;
-import org.apache.skywalking.apm.network.language.agent.NetworkAddressRegisterServiceGrpc;
-import org.apache.skywalking.apm.network.language.agent.NetworkAddresses;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class NetworkAddressRegisterServiceHandler extends NetworkAddressRegisterServiceGrpc.NetworkAddressRegisterServiceImplBase implements GRPCHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(NetworkAddressRegisterServiceHandler.class);
-
- private final INetworkAddressIDService networkAddressIDService;
-
- public NetworkAddressRegisterServiceHandler(ModuleManager moduleManager) {
- this.networkAddressIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(INetworkAddressIDService.class);
- }
-
- @Override
- public void batchRegister(NetworkAddresses request, StreamObserver responseObserver) {
- if (logger.isDebugEnabled()) {
- logger.debug("register application");
- }
-
- ProtocolStringList addressesList = request.getAddressesList();
-
- NetworkAddressMappings.Builder builder = NetworkAddressMappings.newBuilder();
- for (String networkAddress : addressesList) {
- int addressId = networkAddressIDService.get(networkAddress);
-
- if (addressId != 0) {
- KeyWithIntegerValue value = KeyWithIntegerValue.newBuilder().setKey(networkAddress).setValue(addressId).build();
- builder.addAddressIds(value);
- }
- }
- responseObserver.onNext(builder.build());
- responseObserver.onCompleted();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandler.java
deleted file mode 100644
index 50bd2bf4834dab6a6aa3846bd4d807329ed0a095..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandler.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import io.grpc.stub.StreamObserver;
-import java.util.List;
-import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler;
-import org.apache.skywalking.apm.network.language.agent.ServiceNameCollection;
-import org.apache.skywalking.apm.network.language.agent.ServiceNameDiscoveryServiceGrpc;
-import org.apache.skywalking.apm.network.language.agent.ServiceNameElement;
-import org.apache.skywalking.apm.network.language.agent.ServiceNameMappingCollection;
-import org.apache.skywalking.apm.network.language.agent.ServiceNameMappingElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameDiscoveryServiceHandler extends ServiceNameDiscoveryServiceGrpc.ServiceNameDiscoveryServiceImplBase implements GRPCHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(ServiceNameDiscoveryServiceHandler.class);
-
- private final IServiceNameService serviceNameService;
-
- public ServiceNameDiscoveryServiceHandler(ModuleManager moduleManager) {
- this.serviceNameService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IServiceNameService.class);
- }
-
- @Override public void discovery(ServiceNameCollection request,
- StreamObserver responseObserver) {
- List serviceNameElementList = request.getElementsList();
-
- ServiceNameMappingCollection.Builder builder = ServiceNameMappingCollection.newBuilder();
- for (ServiceNameElement serviceNameElement : serviceNameElementList) {
- int applicationId = serviceNameElement.getApplicationId();
- String serviceName = serviceNameElement.getServiceName();
- int srcSpanType = serviceNameElement.getSrcSpanTypeValue();
- int serviceId = serviceNameService.get(applicationId, srcSpanType, serviceName);
-
- if (serviceId != 0) {
- ServiceNameMappingElement.Builder mappingElement = ServiceNameMappingElement.newBuilder();
- mappingElement.setServiceId(serviceId);
- mappingElement.setElement(serviceNameElement);
- builder.addElements(mappingElement);
- }
- }
-
- responseObserver.onNext(builder.build());
- responseObserver.onCompleted();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandler.java
deleted file mode 100644
index cf505d01f1c4a234a164be7376dc750014fcc804..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandler.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import java.util.Set;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentGRPCNamingHandler extends JettyJsonHandler {
-
- private final AgentGRPCNamingListener namingListener;
-
- public AgentGRPCNamingHandler(AgentGRPCNamingListener namingListener) {
- this.namingListener = namingListener;
- }
-
- @Override public String pathSpec() {
- return "/agent/gRPC";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- Set servers = namingListener.getAddresses();
- JsonArray serverArray = new JsonArray();
- servers.forEach(serverArray::add);
- return serverArray;
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListener.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListener.java
deleted file mode 100644
index c6e2310320014ff80e00d9985ffdb0dd16851e1f..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming;
-
-import org.apache.skywalking.apm.collector.agent.grpc.define.AgentGRPCModule;
-import org.apache.skywalking.apm.collector.agent.grpc.provider.AgentModuleGRPCProvider;
-import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentGRPCNamingListener extends ClusterModuleListener {
-
- public static final String PATH = "/" + AgentGRPCModule.NAME + "/" + AgentModuleGRPCProvider.NAME;
-
- @Override public String path() {
- return PATH;
- }
-
- @Override public void serverJoinNotify(String serverAddress) {
-
- }
-
- @Override public void serverQuitNotify(String serverAddress) {
-
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider
deleted file mode 100644
index c32b4c9379692354d011d407b868c0e892008951..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-#
-
-org.apache.skywalking.apm.collector.agent.grpc.provider.AgentModuleGRPCProvider
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProviderTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProviderTest.java
deleted file mode 100644
index 8196f4445e65ae4a660d9e19b6e06aac4dec6a95..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProviderTest.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider;
-
-import org.apache.skywalking.apm.collector.agent.grpc.define.AgentGRPCModule;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.internal.util.reflection.Whitebox;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.anyString;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class AgentModuleGRPCProviderTest {
-
- private AgentModuleGRPCProvider agentModuleGRPCProvider;
-
- @Mock
- private AgentModuleGRPCConfig config;
-
- @Mock
- private ModuleManager moduleManager;
-
-
- @Before
- public void setUp() throws Exception {
- agentModuleGRPCProvider = new AgentModuleGRPCProvider();
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- Whitebox.setInternalState(agentModuleGRPCProvider, "config", config);
- Whitebox.setInternalState(agentModuleGRPCProvider, "manager", moduleManager);
- }
-
- @Test
- public void name() {
- Assert.assertEquals(agentModuleGRPCProvider.name(), "gRPC");
- }
-
- @Test
- public void module() {
- Assert.assertEquals(agentModuleGRPCProvider.module(), AgentGRPCModule.class);
- }
-
- @Test
- public void createConfigBeanIfAbsent() {
- assertEquals(agentModuleGRPCProvider.createConfigBeanIfAbsent(), config);
- }
-
- @Test
- public void prepare() {
- agentModuleGRPCProvider.prepare();
- }
-
- @Test
- public void start() throws ServiceNotProvidedException {
- String host = "127.0.0.1";
- Integer port = 12801;
- Mockito.when(config.getHost()).thenReturn(host);
- Mockito.when(config.getPort()).thenReturn(port);
- Mockito.when(config.getAuthentication()).thenReturn("test_token");
- agentModuleGRPCProvider.start();
-
- }
-
- @Test
- public void notifyAfterCompleted() {
- agentModuleGRPCProvider.notifyAfterCompleted();
- }
-
- @Test
- public void requiredModules() {
- String[] strings = agentModuleGRPCProvider.requiredModules();
- assertTrue(strings.length > 0);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCRegistrationTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCRegistrationTest.java
deleted file mode 100644
index 5239ca19f5e97ffd7430b7e36d55898d4fb439a3..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCRegistrationTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider;
-
-import org.apache.skywalking.apm.collector.cluster.ModuleRegistration;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.junit.Assert.*;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class AgentModuleGRPCRegistrationTest {
-
- private AgentModuleGRPCRegistration agentModuleGRPCRegistration;
-
- @Before
- public void setUp() throws Exception {
- agentModuleGRPCRegistration = new AgentModuleGRPCRegistration("127.0.0.1", 10900);
- }
-
- @Test
- public void buildValue() {
- ModuleRegistration.Value value = agentModuleGRPCRegistration.buildValue();
- Assert.assertEquals(value.getHostPort(),"127.0.0.1:10900");
- Assert.assertEquals(value.getContextPath(),"");
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleCheckerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleCheckerTest.java
deleted file mode 100644
index fc3df53d9670e15bec4650d28b304ef5454efdb1..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleCheckerTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider;
-
-import io.grpc.ServerServiceDefinition;
-import io.grpc.StatusRuntimeException;
-import io.grpc.testing.GrpcServerRule;
-import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.ApplicationRegisterServiceHandler;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.ServerException;
-import org.apache.skywalking.apm.collector.server.grpc.GRPCServer;
-import org.apache.skywalking.apm.network.language.agent.Application;
-import org.apache.skywalking.apm.network.language.agent.ApplicationMapping;
-import org.apache.skywalking.apm.network.language.agent.ApplicationRegisterServiceGrpc;
-import org.apache.skywalking.apm.network.language.agent.KeyWithIntegerValue;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.anyString;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class AuthenticationSimpleCheckerTest {
-
- @Rule
- public final GrpcServerRule grpcServerRule = new GrpcServerRule().directExecutor();
-
- @Mock
- private ModuleManager moduleManager;
-
- @Before
- public void setUp() throws Exception {
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- }
-
- @Test(expected = StatusRuntimeException.class)
- public void build() throws ServerException {
- ApplicationRegisterServiceHandler applicationRegisterServiceHandler = new ApplicationRegisterServiceHandler(moduleManager);
- MockGRPCServer mockGRPCServer = new MockGRPCServer(grpcServerRule);
- mockGRPCServer.initialize();
-
- AuthenticationSimpleChecker.INSTANCE.build(mockGRPCServer, applicationRegisterServiceHandler);
- grpcServerRule.getServiceRegistry().addService(applicationRegisterServiceHandler);
-
- ApplicationRegisterServiceGrpc.ApplicationRegisterServiceBlockingStub stub = ApplicationRegisterServiceGrpc.newBlockingStub(grpcServerRule.getChannel());
- Application application = Application.newBuilder().setApplicationCode("test").build();
-
- ApplicationMapping applicationMapping = stub.applicationCodeRegister(application);
- assertEquals(applicationMapping.getApplication(), KeyWithIntegerValue.getDefaultInstance());
-
- AuthenticationSimpleChecker.INSTANCE.setExpectedToken("test");
- AuthenticationSimpleChecker.INSTANCE.build(mockGRPCServer, applicationRegisterServiceHandler);
- stub.applicationCodeRegister(application);
-
- }
-
- @Test
- public void setExpectedToken() {
-
- }
-
- class MockGRPCServer extends GRPCServer {
-
- private GrpcServerRule grpcServerRule;
-
- public MockGRPCServer(String host, int port) {
- super(host, port);
- }
-
- public MockGRPCServer(GrpcServerRule grpcServerRule) {
- super("127.0.0.1", 0);
- this.grpcServerRule = grpcServerRule;
- }
-
- public void addHandler(ServerServiceDefinition definition) {
- grpcServerRule.getServiceRegistry().addService(definition);
- }
-
-
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandlerTest.java
deleted file mode 100644
index 13b4a1a15c50c7494d7065123cb1c3b3c413df9e..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandlerTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.network.language.agent.Application;
-import org.apache.skywalking.apm.network.language.agent.ApplicationMapping;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.internal.util.reflection.Whitebox;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class ApplicationRegisterServiceHandlerTest {
-
- private ApplicationRegisterServiceHandler applicationRegisterServiceHandler;
-
- @Mock
- private IApplicationIDService applicationIDService;
-
-
- @Before
- public void setUp() {
-// MockitoAnnotations.initMocks(this);
- ModuleManager moduleManager = mock(ModuleManager.class);
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- applicationRegisterServiceHandler = new ApplicationRegisterServiceHandler(moduleManager);
- Whitebox.setInternalState(applicationRegisterServiceHandler, "applicationIDService", applicationIDService);
-
- }
-
- @Test
- public void applicationCodeRegister() {
- Application application = Application.newBuilder().setApplicationCode("test_code").build();
- when(applicationIDService.getOrCreateForApplicationCode(anyString())).thenReturn(1000);
- applicationRegisterServiceHandler.applicationCodeRegister(application, new StreamObserver() {
- @Override
- public void onNext(ApplicationMapping applicationMapping) {
- Assert.assertTrue(applicationMapping.getApplication().getValue() == 1000);
- }
-
- @Override
- public void onError(Throwable throwable) {
-
- }
-
- @Override
- public void onCompleted() {
-
- }
- });
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandlerTest.java
deleted file mode 100644
index 6ec0f458b3c5c80158299b08eadd27f967cebf4c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandlerTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import io.grpc.stub.StreamObserver;
-import java.util.UUID;
-import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstance;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceHeartbeat;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceMapping;
-import org.apache.skywalking.apm.network.language.agent.Downstream;
-import org.apache.skywalking.apm.network.language.agent.OSInfo;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.internal.util.reflection.Whitebox;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyLong;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class InstanceDiscoveryServiceHandlerTest {
-
- private InstanceDiscoveryServiceHandler instanceDiscoveryServiceHandler;
-
- @Mock
- private IInstanceIDService instanceIDService;
- @Mock
- private IInstanceHeartBeatService instanceHeartBeatService;
-
- @Before
- public void setUp() throws Exception {
- ModuleManager moduleManager = mock(ModuleManager.class);
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- instanceDiscoveryServiceHandler = new InstanceDiscoveryServiceHandler(moduleManager);
- Whitebox.setInternalState(instanceDiscoveryServiceHandler, "instanceIDService", instanceIDService);
- Whitebox.setInternalState(instanceDiscoveryServiceHandler, "instanceHeartBeatService", instanceHeartBeatService);
- }
-
- @Test
- public void registerInstance() {
- ApplicationInstance applicationInstance = ApplicationInstance.newBuilder()
- .setAgentUUID(UUID.randomUUID().toString())
- .setApplicationId(10)
- .setRegisterTime(System.currentTimeMillis())
- .setOsinfo(
- OSInfo.newBuilder()
- .setOsName("MAC OS")
- .setHostname("test")
- .addIpv4S("127.0.0.1")
- .setProcessNo(123456)
- .build()
- ).build();
- when(instanceIDService.getOrCreateByAgentUUID(anyInt(), anyString(), anyLong(), anyObject())).thenReturn(100);
- instanceDiscoveryServiceHandler.registerInstance(applicationInstance, new StreamObserver() {
- @Override
- public void onNext(ApplicationInstanceMapping applicationInstanceMapping) {
- Assert.assertEquals(100, applicationInstanceMapping.getApplicationInstanceId());
- }
-
- @Override
- public void onError(Throwable throwable) {
-
- }
-
- @Override
- public void onCompleted() {
-
- }
- });
- }
-
- @Test
- public void heartbeat() {
- ApplicationInstanceHeartbeat heartbeat = ApplicationInstanceHeartbeat.newBuilder()
- .setApplicationInstanceId(100)
- .setHeartbeatTime(System.currentTimeMillis())
- .build();
- instanceDiscoveryServiceHandler.heartbeat(heartbeat, new StreamObserver() {
- @Override
- public void onNext(Downstream downstream) {
- Assert.assertEquals(Downstream.getDefaultInstance(), downstream);
- }
-
- @Override
- public void onError(Throwable throwable) {
-
- }
-
- @Override
- public void onCompleted() {
-
- }
- });
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandlerTest.java
deleted file mode 100644
index b5963e90ebf97e2f7e92bcdef243124aed6932fd..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandlerTest.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.ICpuMetricService;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IGCMetricService;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryMetricService;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryPoolMetricService;
-import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.network.language.agent.*;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.internal.util.reflection.Whitebox;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import java.lang.management.*;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class JVMMetricsServiceHandlerTest {
-
- @Mock
- private ICpuMetricService cpuMetricService;
- @Mock
- private IGCMetricService gcMetricService;
- @Mock
- private IMemoryMetricService memoryMetricService;
- @Mock
- private IMemoryPoolMetricService memoryPoolMetricService;
- @Mock
- private IInstanceHeartBeatService instanceHeartBeatService;
-
- private JVMMetricsServiceHandler jvmMetricsServiceHandler;
-
- @Before
- public void setUp() {
- ModuleManager moduleManager = mock(ModuleManager.class);
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- jvmMetricsServiceHandler = new JVMMetricsServiceHandler(moduleManager);
- Whitebox.setInternalState(jvmMetricsServiceHandler, "cpuMetricService", cpuMetricService);
- Whitebox.setInternalState(jvmMetricsServiceHandler, "gcMetricService", gcMetricService);
- Whitebox.setInternalState(jvmMetricsServiceHandler, "memoryMetricService", memoryMetricService);
- Whitebox.setInternalState(jvmMetricsServiceHandler, "memoryPoolMetricService", memoryPoolMetricService);
- Whitebox.setInternalState(jvmMetricsServiceHandler, "instanceHeartBeatService", instanceHeartBeatService);
- }
-
-
- @Test
- public void collect() {
- List beans = ManagementFactory.getGarbageCollectorMXBeans();
- List gcList = new ArrayList<>();
- for (GarbageCollectorMXBean bean : beans) {
- gcList.add(GC.newBuilder().setPhrase(GCPhrase.NEW)
- .setCount(10)
- .setTime(100)
- .build());
- }
- CPU cpu = CPU.newBuilder()
- .setUsagePercent(80.0d)
- .build();
-
- List memoryList = new LinkedList();
-
- MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
- MemoryUsage heapMemoryUsage = memoryMXBean.getHeapMemoryUsage();
- Memory.Builder heapMemoryBuilder = Memory.newBuilder();
- heapMemoryBuilder.setIsHeap(true);
- heapMemoryBuilder.setInit(heapMemoryUsage.getInit());
- heapMemoryBuilder.setUsed(heapMemoryUsage.getUsed());
- heapMemoryBuilder.setCommitted(heapMemoryUsage.getCommitted());
- heapMemoryBuilder.setMax(heapMemoryUsage.getMax());
- memoryList.add(heapMemoryBuilder.build());
-
- MemoryUsage nonHeapMemoryUsage = memoryMXBean.getNonHeapMemoryUsage();
- Memory.Builder nonHeapMemoryBuilder = Memory.newBuilder();
- nonHeapMemoryBuilder.setIsHeap(false);
- nonHeapMemoryBuilder.setInit(nonHeapMemoryUsage.getInit());
- nonHeapMemoryBuilder.setUsed(nonHeapMemoryUsage.getUsed());
- nonHeapMemoryBuilder.setCommitted(nonHeapMemoryUsage.getCommitted());
- nonHeapMemoryBuilder.setMax(nonHeapMemoryUsage.getMax());
- memoryList.add(nonHeapMemoryBuilder.build());
-
- List memoryPoolMXBeans = ManagementFactory.getMemoryPoolMXBeans();
- List poolList = new LinkedList();
- for (MemoryPoolMXBean memoryPoolMXBean : memoryPoolMXBeans) {
- MemoryUsage usage = memoryPoolMXBean.getUsage();
- poolList.add(MemoryPool.newBuilder().setType(PoolType.CODE_CACHE_USAGE)
- .setInit(usage.getInit())
- .setMax(usage.getMax())
- .setCommited(usage.getCommitted())
- .setUsed(usage.getUsed())
- .build());
- }
-
- JVMMetric jvmMetric = JVMMetric.newBuilder()
- .addAllGc(gcList)
- .setCpu(cpu)
- .addAllMemory(memoryList)
- .addAllMemoryPool(poolList)
- .setTime(System.currentTimeMillis())
- .build();
- JVMMetrics request = JVMMetrics.newBuilder()
- .addMetrics(jvmMetric)
- .setApplicationInstanceId(120)
- .build();
-
- jvmMetricsServiceHandler.collect(request, new StreamObserver() {
- @Override
- public void onNext(Downstream downstream) {
- Assert.assertEquals(downstream.isInitialized(), true);
- }
-
- @Override
- public void onError(Throwable throwable) {
-
- }
-
- @Override
- public void onCompleted() {
-
- }
- });
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandlerTest.java
deleted file mode 100644
index cf4d2be54dd07bbf1335aba3b10ab7edf7d9a02c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandlerTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.network.language.agent.NetworkAddressMappings;
-import org.apache.skywalking.apm.network.language.agent.NetworkAddresses;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.internal.util.reflection.Whitebox;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class NetworkAddressRegisterServiceHandlerTest {
-
- @Mock
- private INetworkAddressIDService networkAddressIDService;
-
- private NetworkAddressRegisterServiceHandler networkAddressRegisterServiceHandler;
-
- @Before
- public void setUp() throws Exception {
- ModuleManager moduleManager = mock(ModuleManager.class);
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- networkAddressRegisterServiceHandler = new NetworkAddressRegisterServiceHandler(moduleManager);
- Whitebox.setInternalState(networkAddressRegisterServiceHandler, "networkAddressIDService", networkAddressIDService);
- }
-
- @Test
- public void batchRegister() {
- NetworkAddresses networkAddresses = NetworkAddresses.newBuilder()
- .addAddresses("127.0.0.1:6379")
- .build();
- when(networkAddressIDService.get(anyString())).thenReturn(1);
- networkAddressRegisterServiceHandler.batchRegister(networkAddresses, new StreamObserver() {
- @Override
- public void onNext(NetworkAddressMappings networkAddressMappings) {
- Assert.assertEquals(networkAddressMappings.getAddressIdsList().get(0).getValue(), 1);
- }
-
- @Override
- public void onError(Throwable throwable) {
-
- }
-
- @Override
- public void onCompleted() {
-
- }
- });
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/SegmentCounterTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/SegmentCounterTest.java
deleted file mode 100644
index 30f8191d32ed1db5a9b73022262ea8f1c63bafc0..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/SegmentCounterTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.mockito.internal.util.reflection.Whitebox;
-
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * @author lican
- */
-public class SegmentCounterTest {
-
- @Test
- public void incrementAndGet() {
- //set default value in case in other test has increments
- Whitebox.setInternalState(SegmentCounter.INSTANCE, "counter", new AtomicLong(0));
- long l = SegmentCounter.INSTANCE.incrementAndGet();
- Assert.assertEquals(1L, l);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java
deleted file mode 100644
index a67632a856e315e3d5a1774adfb898ba40d46489..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.network.language.agent.*;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.internal.util.reflection.Whitebox;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class ServiceNameDiscoveryServiceHandlerTest {
-
- @Mock
- private IServiceNameService serviceNameService;
-
- private ServiceNameDiscoveryServiceHandler serviceNameDiscoveryServiceHandler;
-
- @Before
- public void setUp() throws Exception {
- ModuleManager moduleManager = mock(ModuleManager.class);
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- serviceNameDiscoveryServiceHandler = new ServiceNameDiscoveryServiceHandler(moduleManager);
- Whitebox.setInternalState(serviceNameDiscoveryServiceHandler, "serviceNameService", serviceNameService);
-
- }
-
- @Test
- public void discovery() {
- ServiceNameElement element = ServiceNameElement.newBuilder()
- .setApplicationId(10)
- .setServiceName("/hello/world")
- .setSrcSpanType(SpanType.Entry)
- .build();
- ServiceNameCollection nameCollection = ServiceNameCollection.newBuilder()
- .addElements(element)
- .build();
- when(serviceNameService.get(anyInt(), anyInt(), anyString())).thenReturn(1);
- serviceNameDiscoveryServiceHandler.discovery(nameCollection, new StreamObserver() {
- @Override
- public void onNext(ServiceNameMappingCollection serviceNameMappingCollection) {
- ServiceNameMappingElement mappingElement = serviceNameMappingCollection.getElementsList().get(0);
- assertEquals(mappingElement.getElement(), element);
- int serviceId = mappingElement.getServiceId();
- assertEquals(serviceId, 1);
- }
-
- @Override
- public void onError(Throwable throwable) {
-
- }
-
- @Override
- public void onCompleted() {
-
- }
- });
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/TraceSegmentServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/TraceSegmentServiceHandlerTest.java
deleted file mode 100644
index dd55a73bf8bb2c1a1567ee2b13d139c4117672bc..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/TraceSegmentServiceHandlerTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
-
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParseService;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.network.language.agent.Downstream;
-import org.apache.skywalking.apm.network.language.agent.UpstreamSegment;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.internal.util.reflection.Whitebox;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class TraceSegmentServiceHandlerTest {
-
- private TraceSegmentServiceHandler traceSegmentServiceHandler;
-
- @Mock
- private ISegmentParseService segmentParseService;
-
- @Before
- public void setUp() {
- System.setProperty("debug", "true");
- ModuleManager moduleManager = mock(ModuleManager.class);
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- traceSegmentServiceHandler = new TraceSegmentServiceHandler(moduleManager);
- Whitebox.setInternalState(traceSegmentServiceHandler, "segmentParseService", segmentParseService);
-
- }
-
- @Test
- public void collect() {
- StreamObserver upstreamSegmentStreamObserver = traceSegmentServiceHandler.collect(new StreamObserver() {
- @Override
- public void onNext(Downstream downstream) {
- assertTrue(downstream.isInitialized());
- }
-
- @Override
- public void onError(Throwable throwable) {
- assertTrue(throwable instanceof IllegalArgumentException);
- }
-
- @Override
- public void onCompleted() {
-
-
- }
- });
- UpstreamSegment upstreamSegment = UpstreamSegment.newBuilder().build();
- upstreamSegmentStreamObserver.onNext(upstreamSegment);
- upstreamSegmentStreamObserver.onError(new IllegalArgumentException("exception"));
- upstreamSegmentStreamObserver.onCompleted();
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/AgentDataMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/AgentDataMock.java
deleted file mode 100644
index 7fba65379ef0fe5c89ebbd78699348bd2afba0d5..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/AgentDataMock.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock;
-
-import io.grpc.ManagedChannel;
-import io.grpc.ManagedChannelBuilder;
-import io.grpc.stub.StreamObserver;
-import java.util.LinkedList;
-import java.util.List;
-import org.apache.skywalking.apm.network.language.agent.Downstream;
-import org.apache.skywalking.apm.network.language.agent.TraceSegmentServiceGrpc;
-import org.apache.skywalking.apm.network.language.agent.UpstreamSegment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentDataMock {
-
- private static final Logger logger = LoggerFactory.getLogger(TraceSegmentMock.class);
-
- public static void main(String[] args) throws InterruptedException {
- ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).usePlaintext(true).build();
-
- List> upstreamSegments = new LinkedList<>();
- upstreamSegments.add(createStreamObserver());
- upstreamSegments.add(createStreamObserver());
- upstreamSegments.add(createStreamObserver());
- upstreamSegments.add(createStreamObserver());
-
- RegisterMock registerMock = new RegisterMock();
- registerMock.mock(channel);
-
- TraceSegmentMock segmentMock = new TraceSegmentMock();
- segmentMock.mock(upstreamSegments, new Long[] {System.currentTimeMillis()}, true);
-
- Thread.sleep(30000);
-
- Long[] times = TimeBuilder.INSTANCE.generateTimes();
- logger.info("times size: {}", times.length);
-
- segmentMock.mock(upstreamSegments, times, false);
-
- JVMMetricMock jvmMetricMock = new JVMMetricMock();
- jvmMetricMock.mock(channel, times);
-
- Thread.sleep(60);
- }
-
- private static StreamObserver createStreamObserver() {
- ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).usePlaintext(true).build();
- TraceSegmentServiceGrpc.TraceSegmentServiceStub stub = TraceSegmentServiceGrpc.newStub(channel);
- StreamObserver segmentStreamObserver = stub.collect(new StreamObserver() {
- @Override public void onNext(Downstream downstream) {
- }
-
- @Override public void onError(Throwable throwable) {
- }
-
- @Override public void onCompleted() {
- }
- });
-
- return segmentStreamObserver;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ConsumerMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ConsumerMock.java
deleted file mode 100644
index 90fdfe0cf2aa49247425e90b3ca318ee7bb562a7..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ConsumerMock.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock;
-
-import com.google.protobuf.ByteString;
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.network.language.agent.*;
-import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
-
-/**
- * @author peng-yongsheng
- */
-class ConsumerMock {
-
- void mock(StreamObserver segmentStreamObserver, UniqueId.Builder globalTraceId,
- UniqueId.Builder segmentId, long startTimestamp, boolean isPrepare) {
- UpstreamSegment.Builder upstreamSegment = UpstreamSegment.newBuilder();
- upstreamSegment.addGlobalTraceIds(globalTraceId);
- upstreamSegment.setSegment(createSegment(startTimestamp, segmentId, isPrepare));
-
- segmentStreamObserver.onNext(upstreamSegment.build());
- }
-
- private ByteString createSegment(long startTimestamp, UniqueId.Builder segmentId, boolean isPrepare) {
- TraceSegmentObject.Builder segment = TraceSegmentObject.newBuilder();
- segment.setTraceSegmentId(segmentId);
- segment.setApplicationId(-1);
- segment.setApplicationInstanceId(2);
- segment.addSpans(createEntrySpan(startTimestamp, isPrepare));
- segment.addSpans(createLocalSpan(startTimestamp, isPrepare));
- segment.addSpans(createMqEntrySpan(startTimestamp, isPrepare));
- segment.addSpans(createExitSpan(startTimestamp, isPrepare));
- segment.addSpans(createMqEntrySpan2(startTimestamp, isPrepare));
- segment.addSpans(createExitSpan2(startTimestamp, isPrepare));
-
- return segment.build().toByteString();
- }
-
- private SpanObject.Builder createEntrySpan(long startTimestamp, boolean isPrepare) {
- SpanObject.Builder span = SpanObject.newBuilder();
- span.setSpanId(0);
- span.setSpanType(SpanType.Entry);
- span.setSpanLayer(SpanLayer.Http);
- span.setParentSpanId(-1);
- span.setStartTime(startTimestamp);
- span.setEndTime(startTimestamp + 2000);
- span.setComponentId(ComponentsDefine.TOMCAT.getId());
- if (isPrepare) {
- span.setOperationName("/dubbox-case/case/dubbox-rest");
- } else {
- span.setOperationNameId(2);
- }
- span.setIsError(false);
- return span;
- }
-
- private SpanObject.Builder createLocalSpan(long startTimestamp, boolean isPrepare) {
- SpanObject.Builder span = SpanObject.newBuilder();
- span.setSpanId(1);
- span.setSpanType(SpanType.Local);
- span.setParentSpanId(0);
- span.setStartTime(startTimestamp + 100);
- span.setEndTime(startTimestamp + 1900);
- if (isPrepare) {
- span.setOperationName("org.apache.skywalking.Local.do");
- } else {
- span.setOperationNameId(2);
- }
- span.setIsError(false);
- return span;
- }
-
- private SpanObject.Builder createMqEntrySpan(long startTimestamp, boolean isPrepare) {
- SpanObject.Builder span = SpanObject.newBuilder();
- span.setSpanId(2);
- span.setSpanType(SpanType.Entry);
- span.setSpanLayer(SpanLayer.MQ);
- span.setParentSpanId(1);
- span.setStartTime(startTimestamp + 110);
- span.setEndTime(startTimestamp + 1800);
- span.setComponentId(ComponentsDefine.ROCKET_MQ_CONSUMER.getId());
- if (isPrepare) {
- span.setOperationName("org.apache.skywalking.RocketMQ");
- } else {
- span.setOperationNameId(2);
- }
- span.setIsError(false);
- return span;
- }
-
- private SpanObject.Builder createExitSpan(long startTimestamp, boolean isPrepare) {
- SpanObject.Builder span = SpanObject.newBuilder();
- span.setSpanId(3);
- span.setSpanType(SpanType.Exit);
- span.setSpanLayer(SpanLayer.RPCFramework);
- span.setParentSpanId(2);
- span.setStartTime(startTimestamp + 120);
- span.setEndTime(startTimestamp + 1780);
- span.setComponentId(ComponentsDefine.DUBBO.getId());
- if (isPrepare) {
- span.setPeer("172.25.0.4:20880");
- span.setOperationName("org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- } else {
- span.setOperationNameId(-1);
- span.setPeerId(-1);
- }
- span.setIsError(false);
- return span;
- }
-
- private SpanObject.Builder createMqEntrySpan2(long startTimestamp, boolean isPrepare) {
- SpanObject.Builder span = SpanObject.newBuilder();
- span.setSpanId(4);
- span.setSpanType(SpanType.Entry);
- span.setSpanLayer(SpanLayer.MQ);
- span.setParentSpanId(1);
- span.setStartTime(startTimestamp + 110);
- span.setEndTime(startTimestamp + 1800);
- span.setComponentId(ComponentsDefine.ROCKET_MQ_CONSUMER.getId());
- if (isPrepare) {
- span.setOperationName("org.apache.skywalking.RocketMQ");
- } else {
- span.setOperationNameId(2);
- }
- span.setIsError(false);
- return span;
- }
-
- private SpanObject.Builder createExitSpan2(long startTimestamp, boolean isPrepare) {
- SpanObject.Builder span = SpanObject.newBuilder();
- span.setSpanId(5);
- span.setSpanType(SpanType.Exit);
- span.setSpanLayer(SpanLayer.RPCFramework);
- span.setParentSpanId(4);
- span.setStartTime(startTimestamp + 120);
- span.setEndTime(startTimestamp + 1780);
- span.setComponentId(ComponentsDefine.DUBBO.getId());
- if (isPrepare) {
- span.setPeer("172.25.0.4:20880");
- span.setOperationName("org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- } else {
- span.setOperationNameId(-1);
- span.setPeerId(-1);
- }
- span.setIsError(false);
- return span;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/JVMMetricMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/JVMMetricMock.java
deleted file mode 100644
index bb8f492fe45cdd93f11c51c42f9d8d0e4e8ad599..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/JVMMetricMock.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock;
-
-import io.grpc.ManagedChannel;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.skywalking.apm.network.language.agent.CPU;
-import org.apache.skywalking.apm.network.language.agent.GC;
-import org.apache.skywalking.apm.network.language.agent.GCPhrase;
-import org.apache.skywalking.apm.network.language.agent.JVMMetric;
-import org.apache.skywalking.apm.network.language.agent.JVMMetrics;
-import org.apache.skywalking.apm.network.language.agent.JVMMetricsServiceGrpc;
-import org.apache.skywalking.apm.network.language.agent.Memory;
-import org.apache.skywalking.apm.network.language.agent.MemoryPool;
-import org.apache.skywalking.apm.network.language.agent.PoolType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-class JVMMetricMock {
-
- private static final Logger logger = LoggerFactory.getLogger(JVMMetricMock.class);
-
- void mock(ManagedChannel channel, Long[] times) {
- JVMMetricsServiceGrpc.JVMMetricsServiceBlockingStub jvmMetricsServiceBlockingStub = JVMMetricsServiceGrpc.newBlockingStub(channel);
-
- Set timeSet = new HashSet<>();
- timeSet.addAll(Arrays.asList(times));
-
- AtomicInteger increment = new AtomicInteger(0);
- timeSet.forEach(timestamp -> {
- JVMMetrics.Builder jvmMetrics = JVMMetrics.newBuilder();
- jvmMetrics.setApplicationInstanceId(2);
-
- JVMMetric.Builder jvmMetricBuilder = JVMMetric.newBuilder();
- jvmMetricBuilder.setTime(timestamp);
-
- buildCPUMetric(jvmMetricBuilder);
- buildGCMetric(jvmMetricBuilder);
- buildMemoryMetric(jvmMetricBuilder);
- buildMemoryPoolMetric(jvmMetricBuilder);
-
- jvmMetrics.addMetrics(jvmMetricBuilder.build());
- jvmMetricsServiceBlockingStub.collect(jvmMetrics.build());
-
- if (increment.incrementAndGet() % 100 == 0) {
- logger.info("sending jvm metric number: {}", increment.get());
- }
- });
- logger.info("sending jvm metric number: {}", increment.get());
- }
-
- private static void buildMemoryPoolMetric(JVMMetric.Builder metricBuilder) {
- MemoryPool.Builder codeCache = MemoryPool.newBuilder();
- codeCache.setInit(10);
- codeCache.setMax(100);
- codeCache.setCommited(10);
- codeCache.setUsed(50);
- codeCache.setType(PoolType.CODE_CACHE_USAGE);
- metricBuilder.addMemoryPool(codeCache);
-
- MemoryPool.Builder newGen = MemoryPool.newBuilder();
- newGen.setInit(10);
- newGen.setMax(100);
- newGen.setCommited(10);
- newGen.setUsed(50);
- newGen.setType(PoolType.NEWGEN_USAGE);
- metricBuilder.addMemoryPool(newGen);
-
- MemoryPool.Builder oldGen = MemoryPool.newBuilder();
- oldGen.setInit(10);
- oldGen.setMax(100);
- oldGen.setCommited(10);
- oldGen.setUsed(50);
- oldGen.setType(PoolType.OLDGEN_USAGE);
- metricBuilder.addMemoryPool(oldGen);
-
- MemoryPool.Builder survivor = MemoryPool.newBuilder();
- survivor.setInit(10);
- survivor.setMax(100);
- survivor.setCommited(10);
- survivor.setUsed(50);
- survivor.setType(PoolType.SURVIVOR_USAGE);
- metricBuilder.addMemoryPool(survivor);
-
- MemoryPool.Builder permGen = MemoryPool.newBuilder();
- permGen.setInit(10);
- permGen.setMax(100);
- permGen.setCommited(10);
- permGen.setUsed(50);
- permGen.setType(PoolType.PERMGEN_USAGE);
- metricBuilder.addMemoryPool(permGen);
-
- MemoryPool.Builder metaSpace = MemoryPool.newBuilder();
- metaSpace.setInit(10);
- metaSpace.setMax(100);
- metaSpace.setCommited(10);
- metaSpace.setUsed(50);
- metaSpace.setType(PoolType.METASPACE_USAGE);
- metricBuilder.addMemoryPool(metaSpace);
- }
-
- private static void buildMemoryMetric(JVMMetric.Builder metricBuilder) {
- Memory.Builder isHeap = Memory.newBuilder();
- isHeap.setInit(20);
- isHeap.setMax(100);
- isHeap.setCommitted(20);
- isHeap.setUsed(60);
- isHeap.setIsHeap(true);
- metricBuilder.addMemory(isHeap);
-
- Memory.Builder nonHeap = Memory.newBuilder();
- nonHeap.setInit(20);
- nonHeap.setMax(100);
- nonHeap.setCommitted(20);
- nonHeap.setUsed(60);
- nonHeap.setIsHeap(false);
- metricBuilder.addMemory(nonHeap);
- }
-
- private static void buildGCMetric(JVMMetric.Builder metricBuilder) {
- GC.Builder newGC = GC.newBuilder();
- newGC.setPhrase(GCPhrase.NEW);
- newGC.setCount(2);
- newGC.setTime(1000);
- metricBuilder.addGc(newGC);
-
- GC.Builder oldGC = GC.newBuilder();
- oldGC.setPhrase(GCPhrase.OLD);
- oldGC.setCount(4);
- oldGC.setTime(49);
- metricBuilder.addGc(oldGC);
- }
-
- private static void buildCPUMetric(JVMMetric.Builder metricBuilder) {
- CPU.Builder cpu = CPU.newBuilder();
- cpu.setUsagePercent(20);
- metricBuilder.setCpu(cpu.build());
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ProviderMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ProviderMock.java
deleted file mode 100644
index 11538b0a587c8a819146f15606efdf4b7ce5c261..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ProviderMock.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock;
-
-import com.google.protobuf.ByteString;
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.network.language.agent.RefType;
-import org.apache.skywalking.apm.network.language.agent.SpanLayer;
-import org.apache.skywalking.apm.network.language.agent.SpanObject;
-import org.apache.skywalking.apm.network.language.agent.SpanType;
-import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject;
-import org.apache.skywalking.apm.network.language.agent.TraceSegmentReference;
-import org.apache.skywalking.apm.network.language.agent.UniqueId;
-import org.apache.skywalking.apm.network.language.agent.UpstreamSegment;
-import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
-
-/**
- * @author peng-yongsheng
- */
-class ProviderMock {
-
- void mock(StreamObserver segmentStreamObserver, UniqueId.Builder globalTraceId,
- UniqueId.Builder segmentId, UniqueId.Builder parentTraceSegmentId, long startTimestamp, boolean isPrepare) {
- UpstreamSegment.Builder upstreamSegment = UpstreamSegment.newBuilder();
- upstreamSegment.addGlobalTraceIds(globalTraceId);
- upstreamSegment.setSegment(createSegment(startTimestamp, segmentId, parentTraceSegmentId, isPrepare));
-
- segmentStreamObserver.onNext(upstreamSegment.build());
- }
-
- private ByteString createSegment(long startTimestamp, UniqueId.Builder segmentId,
- UniqueId.Builder parentTraceSegmentId, boolean isPrepare) {
- TraceSegmentObject.Builder segment = TraceSegmentObject.newBuilder();
- segment.setTraceSegmentId(segmentId);
- segment.setApplicationId(2);
- segment.setApplicationInstanceId(3);
- segment.addSpans(createExitSpan(startTimestamp, isPrepare));
- segment.addSpans(createEntrySpan(startTimestamp, parentTraceSegmentId, isPrepare));
-
- return segment.build().toByteString();
- }
-
- private TraceSegmentReference.Builder createReference(UniqueId.Builder parentTraceSegmentId, boolean isPrepare) {
- TraceSegmentReference.Builder reference = TraceSegmentReference.newBuilder();
- reference.setParentTraceSegmentId(parentTraceSegmentId);
- reference.setParentApplicationInstanceId(2);
- reference.setParentSpanId(1);
- reference.setEntryApplicationInstanceId(2);
- reference.setRefType(RefType.CrossProcess);
-
- if (isPrepare) {
- reference.setParentServiceName("/dubbox-case/case/dubbox-rest");
- reference.setNetworkAddress("172.25.0.4:20880");
- reference.setEntryServiceName("/dubbox-case/case/dubbox-rest");
- } else {
- reference.setParentServiceId(2);
- reference.setNetworkAddressId(-1);
- reference.setEntryServiceId(2);
- }
- return reference;
- }
-
- private SpanObject.Builder createExitSpan(long startTimestamp, boolean isPrepare) {
- SpanObject.Builder span = SpanObject.newBuilder();
- span.setSpanId(1);
- span.setSpanType(SpanType.Exit);
- span.setSpanLayer(SpanLayer.Database);
- span.setParentSpanId(0);
- span.setStartTime(startTimestamp + 510);
- span.setEndTime(startTimestamp + 1490);
- span.setComponentId(ComponentsDefine.MONGO_DRIVER.getId());
- span.setIsError(true);
-
- if (isPrepare) {
- span.setOperationName("mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]");
- span.setPeer("localhost:27017");
- } else {
- span.setOperationNameId(-2);
- span.setPeerId(1);
- }
- return span;
- }
-
- private SpanObject.Builder createEntrySpan(long startTimestamp, UniqueId.Builder uniqueId, boolean isPrepare) {
- SpanObject.Builder span = SpanObject.newBuilder();
- span.setSpanId(0);
- span.setSpanType(SpanType.Entry);
- span.setSpanLayer(SpanLayer.RPCFramework);
- span.setParentSpanId(-1);
- span.setStartTime(startTimestamp + 500);
- span.setEndTime(startTimestamp + 1500);
- span.setComponentId(ComponentsDefine.DUBBO.getId());
- span.setIsError(false);
- span.addRefs(createReference(uniqueId, isPrepare));
-
- if (isPrepare) {
- span.setOperationName("org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- } else {
- span.setOperationNameId(3);
- }
- return span;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/RegisterMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/RegisterMock.java
deleted file mode 100644
index 3463d1f54106566bd85522607a56cc7dd7cf692c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/RegisterMock.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock;
-
-import io.grpc.ManagedChannel;
-import java.util.UUID;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import org.apache.skywalking.apm.network.language.agent.Application;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstance;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceHeartbeat;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceMapping;
-import org.apache.skywalking.apm.network.language.agent.ApplicationMapping;
-import org.apache.skywalking.apm.network.language.agent.ApplicationRegisterServiceGrpc;
-import org.apache.skywalking.apm.network.language.agent.InstanceDiscoveryServiceGrpc;
-import org.apache.skywalking.apm.network.language.agent.OSInfo;
-import org.apache.skywalking.apm.network.language.agent.ServiceNameCollection;
-import org.apache.skywalking.apm.network.language.agent.ServiceNameDiscoveryServiceGrpc;
-import org.apache.skywalking.apm.network.language.agent.ServiceNameElement;
-import org.apache.skywalking.apm.network.language.agent.ServiceNameMappingCollection;
-import org.apache.skywalking.apm.network.language.agent.SpanType;
-import org.apache.skywalking.apm.util.RunnableWithExceptionProtection;
-import org.joda.time.DateTime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-class RegisterMock {
-
- private static final Logger logger = LoggerFactory.getLogger(RegisterMock.class);
-
- private ApplicationRegisterServiceGrpc.ApplicationRegisterServiceBlockingStub applicationRegisterServiceBlockingStub;
- private InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceBlockingStub instanceDiscoveryServiceBlockingStub;
- private ServiceNameDiscoveryServiceGrpc.ServiceNameDiscoveryServiceBlockingStub serviceNameDiscoveryServiceBlockingStub;
-
- void mock(ManagedChannel channel) throws InterruptedException {
- applicationRegisterServiceBlockingStub = ApplicationRegisterServiceGrpc.newBlockingStub(channel);
- instanceDiscoveryServiceBlockingStub = InstanceDiscoveryServiceGrpc.newBlockingStub(channel);
- serviceNameDiscoveryServiceBlockingStub = ServiceNameDiscoveryServiceGrpc.newBlockingStub(channel);
- registerConsumer();
- registerProvider();
- }
-
- private void registerConsumer() throws InterruptedException {
- Application.Builder application = Application.newBuilder();
- application.setApplicationCode("dubbox-consumer");
-
- ApplicationMapping applicationMapping;
- do {
- applicationMapping = applicationRegisterServiceBlockingStub.applicationCodeRegister(application.build());
- logger.debug("application id: {}", applicationMapping.getApplication().getValue());
- Thread.sleep(20);
- }
- while (applicationMapping.getApplication().getValue() == 0);
-
- ApplicationInstance.Builder instance = ApplicationInstance.newBuilder();
- instance.setApplicationId(applicationMapping.getApplication().getValue());
- instance.setAgentUUID(UUID.randomUUID().toString());
- instance.setRegisterTime(new DateTime("2017-01-01T00:01:01.001").getMillis());
-
- OSInfo.Builder osInfo = OSInfo.newBuilder();
- osInfo.setHostname("pengys");
- osInfo.setOsName("MacOS XX");
- osInfo.setProcessNo(1001);
- osInfo.addIpv4S("10.0.0.3");
- osInfo.addIpv4S("10.0.0.4");
- instance.setOsinfo(osInfo);
-
- ApplicationInstanceMapping instanceMapping;
- do {
- instanceMapping = instanceDiscoveryServiceBlockingStub.registerInstance(instance.build());
- logger.debug("instance id: {}", instanceMapping.getApplicationInstanceId());
- Thread.sleep(20);
- }
- while (instanceMapping.getApplicationInstanceId() == 0);
-
- ServiceNameCollection.Builder serviceNameCollection = ServiceNameCollection.newBuilder();
- ServiceNameElement.Builder serviceNameElement = ServiceNameElement.newBuilder();
- serviceNameElement.setApplicationId(applicationMapping.getApplication().getValue());
- serviceNameElement.setServiceName("org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- serviceNameElement.setSrcSpanType(SpanType.Exit);
- serviceNameCollection.addElements(serviceNameElement);
-
-// registerServiceName(serviceNameCollection);
-
- heartBeatScheduled(instanceMapping.getApplicationInstanceId());
- }
-
- private void registerProvider() throws InterruptedException {
- Application.Builder application = Application.newBuilder();
- application.setApplicationCode("dubbox-provider");
-
- ApplicationMapping applicationMapping;
- do {
- applicationMapping = applicationRegisterServiceBlockingStub.applicationCodeRegister(application.build());
- logger.debug("application id: {}", applicationMapping.getApplication().getValue());
- Thread.sleep(20);
- }
- while (applicationMapping.getApplication().getValue() == 0);
-
- ApplicationInstance.Builder instance = ApplicationInstance.newBuilder();
- instance.setApplicationId(applicationMapping.getApplication().getValue());
- instance.setAgentUUID(UUID.randomUUID().toString());
- instance.setRegisterTime(new DateTime("2017-01-01T00:01:01.001").getMillis());
-
- OSInfo.Builder osInfo = OSInfo.newBuilder();
- osInfo.setHostname("peng-yongsheng");
- osInfo.setOsName("MacOS X");
- osInfo.setProcessNo(1000);
- osInfo.addIpv4S("10.0.0.1");
- osInfo.addIpv4S("10.0.0.2");
- instance.setOsinfo(osInfo);
-
- ApplicationInstanceMapping instanceMapping;
- do {
- instanceMapping = instanceDiscoveryServiceBlockingStub.registerInstance(instance.build());
- logger.debug("instance id: {}", instanceMapping.getApplicationInstanceId());
- Thread.sleep(20);
- }
- while (instanceMapping.getApplicationInstanceId() == 0);
-
- ServiceNameCollection.Builder serviceNameCollection = ServiceNameCollection.newBuilder();
- ServiceNameElement.Builder serviceNameElement = ServiceNameElement.newBuilder();
- serviceNameElement.setApplicationId(applicationMapping.getApplication().getValue());
- serviceNameElement.setServiceName("org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- serviceNameElement.setSrcSpanType(SpanType.Entry);
- serviceNameCollection.addElements(serviceNameElement);
-
-// registerServiceName(serviceNameCollection);
-
- heartBeatScheduled(instanceMapping.getApplicationInstanceId());
- }
-
- private void registerServiceName(ServiceNameCollection.Builder serviceNameCollection) throws InterruptedException {
- ServiceNameMappingCollection serviceNameMappingCollection;
- do {
- logger.debug("register service name: {}", serviceNameCollection.getElements(0).getServiceName());
- serviceNameMappingCollection = serviceNameDiscoveryServiceBlockingStub.discovery(serviceNameCollection.build());
- logger.debug("service name mapping collection size: {}", serviceNameMappingCollection.getElementsCount());
- if (serviceNameMappingCollection.getElementsCount() > 0) {
- logger.debug("service id: {}", serviceNameMappingCollection.getElements(0).getServiceId());
- }
- Thread.sleep(20);
- }
- while (serviceNameMappingCollection.getElementsCount() == 0 || serviceNameMappingCollection.getElements(0).getServiceId() == 0);
- }
-
- private void heartBeatScheduled(int instanceId) {
- Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(
- new RunnableWithExceptionProtection(() -> heartBeat(instanceId),
- t -> logger.error("instance heart beat scheduled error.", t)), 4, 1, TimeUnit.SECONDS);
- }
-
- private void heartBeat(int instanceId) {
- long now = System.currentTimeMillis();
- logger.debug("instance heart beat, instance id: {}, time: {}", instanceId, now);
- ApplicationInstanceHeartbeat.Builder heartbeat = ApplicationInstanceHeartbeat.newBuilder();
- heartbeat.setApplicationInstanceId(instanceId);
- heartbeat.setHeartbeatTime(now);
- instanceDiscoveryServiceBlockingStub.heartbeat(heartbeat.build());
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TimeBuilder.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TimeBuilder.java
deleted file mode 100644
index a1eaca7c4b1439a033a2f34ef8a4f833950561aa..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TimeBuilder.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock;
-
-import java.util.LinkedList;
-import java.util.List;
-import org.joda.time.DateTime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public enum TimeBuilder {
- INSTANCE;
-
- private static final Logger logger = LoggerFactory.getLogger(TimeBuilder.class);
-
- private Duration[] durations = {
- new Duration("2017-01-01T00:02:01.001", "2017-01-01T00:05:01.001", 20),
- new Duration("2017-02-01T00:02:01.001", "2017-02-01T00:05:01.001", 20),
- new Duration("2017-03-01T00:02:01.001", "2017-03-01T00:05:01.001", 20),
-
- new Duration("2017-04-01T00:02:01.001", "2017-04-01T00:05:01.001", 20),
- new Duration("2017-04-02T00:02:01.001", "2017-04-02T00:05:01.001", 20),
- new Duration("2017-04-03T00:02:01.001", "2017-04-03T00:05:01.001", 20),
-
- new Duration("2017-05-01T08:02:01.001", "2017-05-01T08:05:01.001", 20),
- new Duration("2017-05-01T09:02:01.001", "2017-05-01T09:05:01.001", 20),
- new Duration("2017-05-01T10:02:01.001", "2017-05-01T10:05:01.001", 20),
-
- new Duration("2017-06-01T1:02:01.001", "2017-06-01T11:02:01.001", 100),
- };
-
- public Long[] generateTimes() {
- List times = new LinkedList<>();
-
- for (Duration duration : durations) {
- DateTime start = new DateTime(duration.getStart());
- DateTime end = new DateTime(duration.getEnd());
-
- while (!start.isAfter(end)) {
- for (int i = 0; i < duration.getTps(); i++) {
- times.add(start.getMillis());
- }
- start = start.plusSeconds(1);
- }
- }
-
- return times.toArray(new Long[0]);
- }
-
- class Duration {
- private String start;
- private String end;
- private int tps;
-
- Duration(String start, String end, int tps) {
- this.start = start;
- this.end = end;
- this.tps = tps;
- }
-
- String getStart() {
- return start;
- }
-
- String getEnd() {
- return end;
- }
-
- int getTps() {
- return tps;
- }
- }
-
- public static void main(String[] args) {
- Long[] times = TimeBuilder.INSTANCE.generateTimes();
-
- for (Long time : times) {
- DateTime dateTime = new DateTime(time);
- logger.debug("{}-{}-{} {}:{}:{} {}", dateTime.year().getAsText(), dateTime.monthOfYear().getAsString(),
- dateTime.dayOfMonth().getAsText(), dateTime.hourOfDay().getAsText(),
- dateTime.minuteOfHour().getAsText(), dateTime.secondOfMinute().getAsText(),
- dateTime.millisOfSecond().getAsText());
- }
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TraceSegmentMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TraceSegmentMock.java
deleted file mode 100644
index ff881ca1a2fb1afc438038e5a0c4ba201a104c44..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TraceSegmentMock.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock;
-
-import io.grpc.stub.StreamObserver;
-import java.util.List;
-import org.apache.skywalking.apm.network.language.agent.UniqueId;
-import org.apache.skywalking.apm.network.language.agent.UpstreamSegment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-class TraceSegmentMock {
-
- private static final Logger logger = LoggerFactory.getLogger(TraceSegmentMock.class);
-
- void mock(List> upstreamSegments, Long[] times, boolean isPrepare) {
- long startTime = System.currentTimeMillis();
- long lastTime = System.currentTimeMillis();
- for (int i = 0; i < times.length; i++) {
- long startTimestamp = times[i];
-
- UniqueId.Builder globalTraceId = UniqueIdBuilder.INSTANCE.create();
-
- ConsumerMock consumerMock = new ConsumerMock();
- UniqueId.Builder consumerSegmentId = UniqueIdBuilder.INSTANCE.create();
- consumerMock.mock(upstreamSegments.get(i % 4), globalTraceId, consumerSegmentId, startTimestamp, isPrepare);
-
- ProviderMock providerMock = new ProviderMock();
- UniqueId.Builder providerSegmentId = UniqueIdBuilder.INSTANCE.create();
- providerMock.mock(upstreamSegments.get(i % 4), globalTraceId, providerSegmentId, consumerSegmentId, startTimestamp, isPrepare);
-
- if (i % 10000 == 0) {
- logger.info("sending segment number: {}", i);
- }
-
- if (i % 10000 == 0) {
- long endTime = System.currentTimeMillis();
- if (endTime - startTime > 0) {
- logger.info("tps: {}", ((long)i * 2 * 1000) / (endTime - startTime));
- }
- }
-
- if (i % 5000 == 0) {
- long endTime = System.currentTimeMillis();
- long duration = endTime - lastTime;
- if (duration > 0 && duration < 1000) {
- try {
- logger.info("begin sleeping...");
- Thread.sleep(1000 - duration + 100);
- logger.info("sleep: {}", 1000 - duration + 100);
- } catch (InterruptedException e) {
- logger.error(e.getMessage(), e);
- }
- } else {
- try {
- logger.info("begin sleeping...");
- Thread.sleep(duration);
- logger.info("sleep: {}", duration);
- } catch (InterruptedException e) {
- logger.error(e.getMessage(), e);
- }
- }
- lastTime = System.currentTimeMillis();
- }
- }
- logger.info("sending segment number: {}", times.length);
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/UniqueIdBuilder.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/UniqueIdBuilder.java
deleted file mode 100644
index 248cc0f1f8a36262b1cf5fafe3b549c95ec47964..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/UniqueIdBuilder.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock;
-
-import java.util.concurrent.atomic.AtomicLong;
-import org.apache.skywalking.apm.network.language.agent.UniqueId;
-
-/**
- * @author peng-yongsheng
- */
-public enum UniqueIdBuilder {
- INSTANCE;
-
- private AtomicLong idPart = new AtomicLong(1);
-
- UniqueId.Builder create() {
- UniqueId.Builder uniqueId = UniqueId.newBuilder();
- uniqueId.addIdParts(idPart.getAndIncrement());
- uniqueId.addIdParts(idPart.getAndIncrement());
- uniqueId.addIdParts(idPart.getAndIncrement());
- return uniqueId;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandlerTest.java
deleted file mode 100644
index 4db8a54b11e701a7d6b0adcf200fb0625054dcc4..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandlerTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-
-import javax.servlet.http.HttpServletRequest;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * @author lican
- */
-public class AgentGRPCNamingHandlerTest {
-
- private AgentGRPCNamingHandler handler;
-
- @Mock
- private HttpServletRequest request;
-
- @Before
- public void setUp() throws Exception {
- AgentGRPCNamingListener listener = new AgentGRPCNamingListener();
- listener.addAddress("127.0.0.1:10080");
- handler = new AgentGRPCNamingHandler(listener);
-
- }
-
- @Test
- public void pathSpec() {
- assertEquals(handler.pathSpec(), "/agent/gRPC");
- }
-
- @Test
- public void doGet() throws ArgumentsParseException {
- JsonElement jsonElement = handler.doGet(request);
- String s = ((JsonArray) jsonElement).get(0).getAsString();
- assertEquals(s, "127.0.0.1:10080");
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void doPost() throws ArgumentsParseException {
- handler.doPost(request);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListenerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListenerTest.java
deleted file mode 100644
index 997ac4872ef48e0b6e4eef33dd4ee0168c67a6b3..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListenerTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * @author lican
- */
-public class AgentGRPCNamingListenerTest {
-
- private AgentGRPCNamingListener listener;
-
- @Before
- public void setUp() throws Exception {
- listener = new AgentGRPCNamingListener();
- }
-
- @Test
- public void path() {
- assertEquals(listener.path(), "/agent_gRPC/gRPC");
- }
-
- @Test
- public void serverJoinNotify() {
- listener.serverJoinNotify(null);
- }
-
- @Test
- public void serverQuitNotify() {
- listener.serverQuitNotify(null);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java
deleted file mode 100644
index a6cc0bcd44d289fe22e36360b28ecc46a12facb8..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module;
-
-import com.google.common.collect.Lists;
-import org.apache.skywalking.apm.collector.grpc.manager.service.GRPCManagerService;
-import org.apache.skywalking.apm.collector.server.grpc.GRPCServer;
-import org.mockito.Mockito;
-import org.mockito.internal.util.reflection.Whitebox;
-
-import java.util.LinkedList;
-
-import static org.mockito.Matchers.*;
-import static org.mockito.Mockito.when;
-
-/**
- * @author lican
- */
-public class MockModule extends ModuleDefine {
-
- public MockModule() throws ServiceNotProvidedException {
- ModuleProvider moduleProvider = Mockito.mock(ModuleProvider.class);
- LinkedList linkedList = Lists.newLinkedList();
- linkedList.add(moduleProvider);
- Whitebox.setInternalState(this, "loadedProviders", linkedList);
- when(moduleProvider.getService(any())).then(invocation -> {
- Class argumentAt = invocation.getArgumentAt(0, Class.class);
- Object mock = Mockito.mock(argumentAt);
- if (mock instanceof GRPCManagerService) {
- when(((GRPCManagerService) mock).createIfAbsent(anyString(), anyInt())).then(invocation1 -> {
- GRPCServer grpcServer = new GRPCServer("127.0.0.1", 18098);
- grpcServer.initialize();
- return grpcServer;
- });
- }
- return mock;
- });
- }
-
- @Override
- public String name() {
- return null;
- }
-
- @Override
- public Class[] services() {
- return new Class[0];
- }
-
-
-}
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/resources/log4j2.xml b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/resources/log4j2.xml
deleted file mode 100644
index 92f26c58547aaad949cbb87c273144cb6bc3f919..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/resources/log4j2.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/apm-collector/apm-collector-agent/agent-grpc/pom.xml b/apm-collector/apm-collector-agent/agent-grpc/pom.xml
deleted file mode 100644
index 218601bd703810950e95e7e32be0c2f9078273ef..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-grpc/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
- apm-collector-agent
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- agent-grpc
- pom
-
- agent-grpc-define
- agent-grpc-provider
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/pom.xml b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/pom.xml
deleted file mode 100644
index 35e3c76f6ac74455ad1b4625fa130eff6e935d9b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/pom.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
- agent-jetty
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- agent-jetty-define
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/define/AgentJettyModule.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/define/AgentJettyModule.java
deleted file mode 100644
index 4adc6642794ef9210ff1046db33afc53de1192a0..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/define/AgentJettyModule.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.define;
-
-import org.apache.skywalking.apm.collector.core.module.ModuleDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentJettyModule extends ModuleDefine {
-
- public static final String NAME = "agent_jetty";
-
- @Override public String name() {
- return NAME;
- }
-
- @Override public Class[] services() {
- return new Class[0];
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/pom.xml b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/pom.xml
deleted file mode 100644
index 59d775a5f68f1bede21e089e7b8a1c2f613be001..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/pom.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
- agent-jetty
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- agent-jetty-provider
- jar
-
-
-
- org.apache.skywalking
- agent-jetty-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-cluster-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-naming-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-jetty-manager-define
- ${project.version}
-
-
- org.apache.skywalking
- register-define
- ${project.version}
-
-
- org.apache.skywalking
- segment-parser-define
- ${project.version}
-
-
- org.apache.skywalking
- jvm-define
- ${project.version}
-
-
- org.apache.skywalking
- metric-define
- ${project.version}
-
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyConfig.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyConfig.java
deleted file mode 100644
index d6c86c32b4d2a476feea3470ffe2cab2389c2a2a..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyConfig.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider;
-
-import org.apache.skywalking.apm.collector.server.jetty.JettyServerConfig;
-
-/**
- * @author peng-yongsheng
- */
-class AgentModuleJettyConfig extends JettyServerConfig {
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProvider.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProvider.java
deleted file mode 100644
index d099759cda203be0f285e0bfafb676fb991acdac..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProvider.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider;
-
-import org.apache.skywalking.apm.collector.agent.jetty.define.AgentJettyModule;
-import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.ApplicationRegisterServletHandler;
-import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.InstanceDiscoveryServletHandler;
-import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.InstanceHeartBeatServletHandler;
-import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.NetworkAddressRegisterServletHandler;
-import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.ServiceNameDiscoveryServiceHandler;
-import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.TraceSegmentServletHandler;
-import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming.AgentJettyNamingHandler;
-import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming.AgentJettyNamingListener;
-import org.apache.skywalking.apm.collector.cluster.ClusterModule;
-import org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService;
-import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService;
-import org.apache.skywalking.apm.collector.core.module.*;
-import org.apache.skywalking.apm.collector.core.module.ModuleDefine;
-import org.apache.skywalking.apm.collector.jetty.manager.JettyManagerModule;
-import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService;
-import org.apache.skywalking.apm.collector.naming.NamingModule;
-import org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterService;
-import org.apache.skywalking.apm.collector.server.jetty.JettyServer;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentModuleJettyProvider extends ModuleProvider {
-
- public static final String NAME = "jetty";
- private final AgentModuleJettyConfig config;
-
- public AgentModuleJettyProvider() {
- super();
- this.config = new AgentModuleJettyConfig();
- }
-
- @Override public String name() {
- return NAME;
- }
-
- @Override public Class extends ModuleDefine> module() {
- return AgentJettyModule.class;
- }
-
- @Override public ModuleConfig createConfigBeanIfAbsent() {
- return config;
- }
-
- @Override public void prepare() {
- }
-
- @Override public void start() {
- ModuleRegisterService moduleRegisterService = getManager().find(ClusterModule.NAME).getService(ModuleRegisterService.class);
- moduleRegisterService.register(AgentJettyModule.NAME, this.name(), new AgentModuleJettyRegistration(config.getHost(), config.getPort(), config.getContextPath()));
-
- AgentJettyNamingListener namingListener = new AgentJettyNamingListener();
- ModuleListenerService moduleListenerService = getManager().find(ClusterModule.NAME).getService(ModuleListenerService.class);
- moduleListenerService.addListener(namingListener);
-
- NamingHandlerRegisterService namingHandlerRegisterService = getManager().find(NamingModule.NAME).getService(NamingHandlerRegisterService.class);
- namingHandlerRegisterService.register(new AgentJettyNamingHandler(namingListener));
-
- JettyManagerService managerService = getManager().find(JettyManagerModule.NAME).getService(JettyManagerService.class);
- JettyServer jettyServer = managerService.createIfAbsent(config.getHost(), config.getPort(), config.getContextPath());
- addHandlers(jettyServer);
- }
-
- @Override public void notifyAfterCompleted() {
- }
-
- @Override public String[] requiredModules() {
- return new String[] {ClusterModule.NAME, NamingModule.NAME, JettyManagerModule.NAME};
- }
-
- private void addHandlers(JettyServer jettyServer) {
- jettyServer.addHandler(new TraceSegmentServletHandler(getManager()));
- jettyServer.addHandler(new ApplicationRegisterServletHandler(getManager()));
- jettyServer.addHandler(new InstanceDiscoveryServletHandler(getManager()));
- jettyServer.addHandler(new InstanceHeartBeatServletHandler(getManager()));
- jettyServer.addHandler(new ServiceNameDiscoveryServiceHandler(getManager()));
- jettyServer.addHandler(new NetworkAddressRegisterServletHandler(getManager()));
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistration.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistration.java
deleted file mode 100644
index 5dac3275d9a2fad1af047c3c43b6ff22cbbd5e89..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistration.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider;
-
-import org.apache.skywalking.apm.collector.cluster.ModuleRegistration;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentModuleJettyRegistration extends ModuleRegistration {
-
- private final String host;
- private final int port;
- private final String contextPath;
-
- public AgentModuleJettyRegistration(String host, int port, String contextPath) {
- this.host = host;
- this.port = port;
- this.contextPath = contextPath;
- }
-
- @Override public Value buildValue() {
- return new Value(host, port, contextPath);
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandler.java
deleted file mode 100644
index 100692d9c7778580eb27dd68d20bfd69bb6d1d10..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandler.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationRegisterServletHandler extends JettyJsonHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(ApplicationRegisterServletHandler.class);
-
- private final IApplicationIDService applicationIDService;
- private Gson gson = new Gson();
- private static final String APPLICATION_CODE = "c";
- private static final String APPLICATION_ID = "i";
-
- public ApplicationRegisterServletHandler(ModuleManager moduleManager) {
- this.applicationIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IApplicationIDService.class);
- }
-
- @Override public String pathSpec() {
- return "/application/register";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- JsonArray responseArray = new JsonArray();
- try {
- JsonArray applicationCodes = gson.fromJson(req.getReader(), JsonArray.class);
- for (int i = 0; i < applicationCodes.size(); i++) {
- String applicationCode = applicationCodes.get(i).getAsString();
- int applicationId = applicationIDService.getOrCreateForApplicationCode(applicationCode);
- JsonObject mapping = new JsonObject();
- mapping.addProperty(APPLICATION_CODE, applicationCode);
- mapping.addProperty(APPLICATION_ID, applicationId);
- responseArray.add(mapping);
- }
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- return responseArray;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandler.java
deleted file mode 100644
index d0a1a083b2a38033ebb3038ca34eb09a15c79375..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandler.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.AgentOsInfo;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceDiscoveryServletHandler extends JettyJsonHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(InstanceDiscoveryServletHandler.class);
-
- private final IInstanceIDService instanceIDService;
- private final Gson gson = new Gson();
-
- private static final String APPLICATION_ID = "ai";
- private static final String AGENT_UUID = "au";
- private static final String REGISTER_TIME = "rt";
- private static final String INSTANCE_ID = "ii";
- private static final String OS_INFO = "oi";
-
- public InstanceDiscoveryServletHandler(ModuleManager moduleManager) {
- this.instanceIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IInstanceIDService.class);
- }
-
- @Override public String pathSpec() {
- return "/instance/register";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- JsonObject responseJson = new JsonObject();
- try {
- JsonObject instance = gson.fromJson(req.getReader(), JsonObject.class);
- int applicationId = instance.get(APPLICATION_ID).getAsInt();
- String agentUUID = instance.get(AGENT_UUID).getAsString();
- long registerTime = instance.get(REGISTER_TIME).getAsLong();
- JsonObject osInfoJson = instance.get(OS_INFO).getAsJsonObject();
- AgentOsInfo osInfo = gson.fromJson(osInfoJson, AgentOsInfo.class);
-
- int instanceId = instanceIDService.getOrCreateByAgentUUID(applicationId, agentUUID, registerTime, osInfo);
- responseJson.addProperty(APPLICATION_ID, applicationId);
- responseJson.addProperty(INSTANCE_ID, instanceId);
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- return responseJson;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandler.java
deleted file mode 100644
index 32841b9b54d7a496dbb5315c009d60d85bef6d94..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandler.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule;
-import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceHeartBeatServletHandler extends JettyJsonHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(InstanceHeartBeatServletHandler.class);
-
- private final IInstanceHeartBeatService instanceHeartBeatService;
- private final Gson gson = new Gson();
-
- private static final String INSTANCE_ID = "ii";
- private static final String HEARTBEAT_TIME = "ht";
-
- public InstanceHeartBeatServletHandler(ModuleManager moduleManager) {
- this.instanceHeartBeatService = moduleManager.find(AnalysisMetricModule.NAME).getService(IInstanceHeartBeatService.class);
- }
-
- @Override public String pathSpec() {
- return "/instance/heartbeat";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException, IOException {
- JsonObject responseJson = new JsonObject();
- try {
- JsonObject heartBeat = gson.fromJson(req.getReader(), JsonObject.class);
- int instanceId = heartBeat.get(INSTANCE_ID).getAsInt();
- long heartBeatTime = heartBeat.get(HEARTBEAT_TIME).getAsLong();
-
- instanceHeartBeatService.heartBeat(instanceId, heartBeatTime);
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- return responseJson;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandler.java
deleted file mode 100644
index 1da81e2bbab817e2ef80f1464a9fc1f7364b3eaa..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandler.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.*;
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler;
-import org.slf4j.*;
-
-/**
- * @author peng-yongsheng
- */
-public class NetworkAddressRegisterServletHandler extends JettyJsonHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(NetworkAddressRegisterServletHandler.class);
-
- private final INetworkAddressIDService networkAddressIDService;
- private Gson gson = new Gson();
- private static final String NETWORK_ADDRESS = "n";
- private static final String ADDRESS_ID = "i";
-
- public NetworkAddressRegisterServletHandler(ModuleManager moduleManager) {
- this.networkAddressIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(INetworkAddressIDService.class);
- }
-
- @Override public String pathSpec() {
- return "/networkAddress/register";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) {
- throw new UnsupportedOperationException();
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) {
- JsonArray responseArray = new JsonArray();
- try {
- JsonArray networkAddresses = gson.fromJson(req.getReader(), JsonArray.class);
- for (int i = 0; i < networkAddresses.size(); i++) {
- String networkAddress = networkAddresses.get(i).getAsString();
-
- if (logger.isDebugEnabled()) {
- logger.debug("network address register, network address: {}", networkAddress);
- }
-
- int addressId = networkAddressIDService.get(networkAddress);
- JsonObject mapping = new JsonObject();
- mapping.addProperty(ADDRESS_ID, addressId);
- mapping.addProperty(NETWORK_ADDRESS, networkAddress);
- responseArray.add(mapping);
- }
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- return responseArray;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandler.java
deleted file mode 100644
index 4bc4ac7c33d717f00c54e0f5e6e49a7d881be32e..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandler.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameDiscoveryServiceHandler extends JettyJsonHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(ServiceNameDiscoveryServiceHandler.class);
-
- private final IServiceNameService serviceNameService;
- private final Gson gson = new Gson();
-
- private static final String APPLICATION_ID = "ai";
- private static final String SERVICE_NAME = "sn";
- private static final String SRC_SPAN_TYPE = "st";
- private static final String SERVICE_ID = "si";
- private static final String ELEMENT = "el";
-
- public ServiceNameDiscoveryServiceHandler(ModuleManager moduleManager) {
- this.serviceNameService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IServiceNameService.class);
- }
-
- @Override public String pathSpec() {
- return "/servicename/discovery";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- JsonArray responseArray = new JsonArray();
- try {
- JsonArray services = gson.fromJson(req.getReader(), JsonArray.class);
- for (JsonElement service : services) {
- int applicationId = service.getAsJsonObject().get(APPLICATION_ID).getAsInt();
- String serviceName = service.getAsJsonObject().get(SERVICE_NAME).getAsString();
- int srcSpanType = service.getAsJsonObject().get(SRC_SPAN_TYPE).getAsInt();
-
- int serviceId = serviceNameService.getOrCreate(applicationId, srcSpanType, serviceName);
- if (serviceId != 0) {
- JsonObject responseJson = new JsonObject();
- responseJson.addProperty(SERVICE_ID, serviceId);
- responseJson.add(ELEMENT, service);
- responseArray.add(responseJson);
- }
- }
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- return responseArray;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandler.java
deleted file mode 100644
index 83f91436b8f012e2d3ae394780f0eda685e919fa..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandler.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.JsonElement;
-import com.google.gson.stream.JsonReader;
-import java.io.*;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader.*;
-import org.apache.skywalking.apm.collector.analysis.segment.parser.define.AnalysisSegmentParserModule;
-import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParseService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler;
-import org.slf4j.*;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceSegmentServletHandler extends JettyJsonHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(TraceSegmentServletHandler.class);
-
- private final ISegmentParseService segmentParseService;
-
- public TraceSegmentServletHandler(ModuleManager moduleManager) {
- this.segmentParseService = moduleManager.find(AnalysisSegmentParserModule.NAME).getService(ISegmentParseService.class);
- }
-
- @Override public String pathSpec() {
- return "/segments";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) {
- throw new UnsupportedOperationException();
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) {
- if (logger.isDebugEnabled()) {
- logger.debug("receive stream segment");
- }
-
- try {
- BufferedReader bufferedReader = req.getReader();
- read(bufferedReader);
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
-
- return null;
- }
-
- private TraceSegmentJsonReader jsonReader = new TraceSegmentJsonReader();
-
- private void read(BufferedReader bufferedReader) throws IOException {
- JsonReader reader = new JsonReader(bufferedReader);
-
- reader.beginArray();
- while (reader.hasNext()) {
- TraceSegment traceSegment = jsonReader.read(reader);
- segmentParseService.parse(traceSegment.getUpstreamSegment(), ISegmentParseService.Source.Agent);
- }
- reader.endArray();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandler.java
deleted file mode 100644
index f9114c691262697f6a809cc863486d72c1156b65..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import java.util.Set;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentJettyNamingHandler extends JettyJsonHandler {
-
- private final AgentJettyNamingListener namingListener;
-
- public AgentJettyNamingHandler(AgentJettyNamingListener namingListener) {
- this.namingListener = namingListener;
- }
-
- @Override public String pathSpec() {
- return "/agent/jetty";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- Set servers = namingListener.getAddresses();
- JsonArray serverArray = new JsonArray();
- servers.forEach(serverArray::add);
- return serverArray;
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListener.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListener.java
deleted file mode 100644
index 863569045c38adeb787bcec35623ecfc06555b4b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming;
-
-import org.apache.skywalking.apm.collector.agent.jetty.define.AgentJettyModule;
-import org.apache.skywalking.apm.collector.agent.jetty.provider.AgentModuleJettyProvider;
-import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentJettyNamingListener extends ClusterModuleListener {
-
- public static final String PATH = "/" + AgentJettyModule.NAME + "/" + AgentModuleJettyProvider.NAME;
-
- @Override public String path() {
- return PATH;
- }
-
- @Override public void serverJoinNotify(String serverAddress) {
-
- }
-
- @Override public void serverQuitNotify(String serverAddress) {
-
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReader.java
deleted file mode 100644
index 55024913e13eabe3e6bfce117223649fd639cfbb..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReader.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.apache.skywalking.apm.network.language.agent.KeyWithStringValue;
-
-/**
- * @author peng-yongsheng
- */
-public class KeyWithStringValueJsonReader implements StreamJsonReader {
-
- private static final String KEY = "k";
- private static final String VALUE = "v";
-
- @Override public KeyWithStringValue read(JsonReader reader) throws IOException {
- KeyWithStringValue.Builder builder = KeyWithStringValue.newBuilder();
-
- reader.beginObject();
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case KEY:
- builder.setKey(reader.nextString());
- break;
- case VALUE:
- builder.setValue(reader.nextString());
- break;
- default:
- reader.skipValue();
- break;
- }
- }
- reader.endObject();
-
- return builder.build();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReader.java
deleted file mode 100644
index aeb5f9058ffbd3251242086e7a22ba0275ec9c10..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReader.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.apache.skywalking.apm.network.language.agent.LogMessage;
-
-/**
- * @author peng-yongsheng
- */
-public class LogJsonReader implements StreamJsonReader {
-
- private KeyWithStringValueJsonReader keyWithStringValueJsonReader = new KeyWithStringValueJsonReader();
-
- private static final String TIME = "ti";
- private static final String LOG_DATA = "ld";
-
- @Override public LogMessage read(JsonReader reader) throws IOException {
- LogMessage.Builder builder = LogMessage.newBuilder();
-
- reader.beginObject();
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case TIME:
- builder.setTime(reader.nextLong());
- break;
- case LOG_DATA:
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addData(keyWithStringValueJsonReader.read(reader));
- }
- reader.endArray();
- break;
- default:
- reader.skipValue();
- break;
- }
- }
- reader.endObject();
-
- return builder.build();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReader.java
deleted file mode 100644
index 2536b63682b8b0bea7b1ac3010fb3255e2847a27..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReader.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.apache.skywalking.apm.network.language.agent.TraceSegmentReference;
-
-/**
- * @author peng-yongsheng
- */
-public class ReferenceJsonReader implements StreamJsonReader {
-
- private UniqueIdJsonReader uniqueIdJsonReader = new UniqueIdJsonReader();
-
- private static final String PARENT_TRACE_SEGMENT_ID = "pts";
- private static final String PARENT_APPLICATION_INSTANCE_ID = "pii";
- private static final String PARENT_SPAN_ID = "psp";
- private static final String PARENT_SERVICE_ID = "psi";
- private static final String PARENT_SERVICE_NAME = "psn";
- private static final String NETWORK_ADDRESS_ID = "ni";
- private static final String NETWORK_ADDRESS = "nn";
- private static final String ENTRY_APPLICATION_INSTANCE_ID = "eii";
- private static final String ENTRY_SERVICE_ID = "esi";
- private static final String ENTRY_SERVICE_NAME = "esn";
- private static final String REF_TYPE_VALUE = "rv";
-
- @Override public TraceSegmentReference read(JsonReader reader) throws IOException {
- TraceSegmentReference.Builder builder = TraceSegmentReference.newBuilder();
-
- reader.beginObject();
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case PARENT_TRACE_SEGMENT_ID:
- builder.setParentTraceSegmentId(uniqueIdJsonReader.read(reader));
- break;
- case PARENT_APPLICATION_INSTANCE_ID:
- builder.setParentApplicationInstanceId(reader.nextInt());
- break;
- case PARENT_SPAN_ID:
- builder.setParentSpanId(reader.nextInt());
- break;
- case PARENT_SERVICE_ID:
- builder.setParentServiceId(reader.nextInt());
- break;
- case PARENT_SERVICE_NAME:
- builder.setParentServiceName(reader.nextString());
- break;
- case NETWORK_ADDRESS_ID:
- builder.setNetworkAddressId(reader.nextInt());
- break;
- case NETWORK_ADDRESS:
- builder.setNetworkAddress(reader.nextString());
- break;
- case ENTRY_APPLICATION_INSTANCE_ID:
- builder.setEntryApplicationInstanceId(reader.nextInt());
- break;
- case ENTRY_SERVICE_ID:
- builder.setEntryServiceId(reader.nextInt());
- break;
- case ENTRY_SERVICE_NAME:
- builder.setEntryServiceName(reader.nextString());
- break;
- case REF_TYPE_VALUE:
- builder.setRefTypeValue(reader.nextInt());
- break;
- default:
- reader.skipValue();
- break;
- }
- }
- reader.endObject();
-
- return builder.build();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReader.java
deleted file mode 100644
index 77f32f6b008b4674e9b2362908c9a113b1e3b4a6..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReader.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentJsonReader implements StreamJsonReader {
-
- private static final Logger logger = LoggerFactory.getLogger(SegmentJsonReader.class);
-
- private UniqueIdJsonReader uniqueIdJsonReader = new UniqueIdJsonReader();
- private SpanJsonReader spanJsonReader = new SpanJsonReader();
-
- private static final String TRACE_SEGMENT_ID = "ts";
- private static final String APPLICATION_ID = "ai";
- private static final String APPLICATION_INSTANCE_ID = "ii";
- private static final String SPANS = "ss";
-
- @Override public TraceSegmentObject.Builder read(JsonReader reader) throws IOException {
- TraceSegmentObject.Builder builder = TraceSegmentObject.newBuilder();
-
- reader.beginObject();
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case TRACE_SEGMENT_ID:
- builder.setTraceSegmentId(uniqueIdJsonReader.read(reader));
- if (logger.isDebugEnabled()) {
- StringBuilder segmentId = new StringBuilder();
- builder.getTraceSegmentId().getIdPartsList().forEach(idPart -> segmentId.append(idPart));
- logger.debug("segment id: {}", segmentId);
- }
- break;
- case APPLICATION_ID:
- builder.setApplicationId(reader.nextInt());
- break;
- case APPLICATION_INSTANCE_ID:
- builder.setApplicationInstanceId(reader.nextInt());
- break;
- case SPANS:
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addSpans(spanJsonReader.read(reader));
- }
- reader.endArray();
- break;
- default:
- reader.skipValue();
- break;
- }
- }
- reader.endObject();
-
- return builder;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReader.java
deleted file mode 100644
index 174ac8ec4d8b2ec249b2957fcd8bbddfb6dbd121..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReader.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.apache.skywalking.apm.network.language.agent.SpanObject;
-
-/**
- * @author peng-yongsheng
- */
-public class SpanJsonReader implements StreamJsonReader {
-
- private KeyWithStringValueJsonReader keyWithStringValueJsonReader = new KeyWithStringValueJsonReader();
- private LogJsonReader logJsonReader = new LogJsonReader();
- private ReferenceJsonReader referenceJsonReader = new ReferenceJsonReader();
-
- private static final String SPAN_ID = "si";
- private static final String SPAN_TYPE_VALUE = "tv";
- private static final String SPAN_LAYER_VALUE = "lv";
- private static final String PARENT_SPAN_ID = "ps";
- private static final String START_TIME = "st";
- private static final String END_TIME = "et";
- private static final String COMPONENT_ID = "ci";
- private static final String COMPONENT_NAME = "cn";
- private static final String OPERATION_NAME_ID = "oi";
- private static final String OPERATION_NAME = "on";
- private static final String PEER_ID = "pi";
- private static final String PEER = "pn";
- private static final String IS_ERROR = "ie";
- private static final String TRACE_SEGMENT_REFERENCE = "rs";
- private static final String TAGS = "to";
- private static final String LOGS = "lo";
-
- @Override public SpanObject read(JsonReader reader) throws IOException {
- SpanObject.Builder builder = SpanObject.newBuilder();
-
- reader.beginObject();
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case SPAN_ID:
- builder.setSpanId(reader.nextInt());
- break;
- case SPAN_TYPE_VALUE:
- builder.setSpanTypeValue(reader.nextInt());
- break;
- case SPAN_LAYER_VALUE:
- builder.setSpanLayerValue(reader.nextInt());
- break;
- case PARENT_SPAN_ID:
- builder.setParentSpanId(reader.nextInt());
- break;
- case START_TIME:
- builder.setStartTime(reader.nextLong());
- break;
- case END_TIME:
- builder.setEndTime(reader.nextLong());
- break;
- case COMPONENT_ID:
- builder.setComponentId(reader.nextInt());
- break;
- case COMPONENT_NAME:
- builder.setComponent(reader.nextString());
- break;
- case OPERATION_NAME_ID:
- builder.setOperationNameId(reader.nextInt());
- break;
- case OPERATION_NAME:
- builder.setOperationName(reader.nextString());
- break;
- case PEER_ID:
- builder.setPeerId(reader.nextInt());
- break;
- case PEER:
- builder.setPeer(reader.nextString());
- break;
- case IS_ERROR:
- builder.setIsError(reader.nextBoolean());
- break;
- case TRACE_SEGMENT_REFERENCE:
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addRefs(referenceJsonReader.read(reader));
- }
- reader.endArray();
- break;
- case TAGS:
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addTags(keyWithStringValueJsonReader.read(reader));
- }
- reader.endArray();
- break;
- case LOGS:
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addLogs(logJsonReader.read(reader));
- }
- reader.endArray();
- break;
- default:
- reader.skipValue();
- break;
- }
- }
- reader.endObject();
-
- return builder.build();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/StreamJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/StreamJsonReader.java
deleted file mode 100644
index 0b757c4ce7e71f4ffd36152b99ed71ec436b7d53..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/StreamJsonReader.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-
-/**
- * @author peng-yongsheng
- */
-public interface StreamJsonReader {
- T read(JsonReader reader) throws IOException;
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegment.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegment.java
deleted file mode 100644
index 154645b9ed41247a684bf44c5c52430b18f39e4b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegment.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject;
-import org.apache.skywalking.apm.network.language.agent.UniqueId;
-import org.apache.skywalking.apm.network.language.agent.UpstreamSegment;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceSegment {
-
- private UpstreamSegment.Builder builder;
-
- public TraceSegment() {
- builder = UpstreamSegment.newBuilder();
- }
-
- public void addGlobalTraceId(UniqueId.Builder globalTraceId) {
- builder.addGlobalTraceIds(globalTraceId);
- }
-
- public void setTraceSegmentBuilder(TraceSegmentObject.Builder traceSegmentBuilder) {
- builder.setSegment(traceSegmentBuilder.build().toByteString());
- }
-
- public UpstreamSegment getUpstreamSegment() {
- return builder.build();
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReader.java
deleted file mode 100644
index c2a64c14255d14bb3fefc4dae0aa411b1e244838..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReader.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceSegmentJsonReader implements StreamJsonReader {
-
- private static final Logger logger = LoggerFactory.getLogger(TraceSegmentJsonReader.class);
-
- private UniqueIdJsonReader uniqueIdJsonReader = new UniqueIdJsonReader();
- private SegmentJsonReader segmentJsonReader = new SegmentJsonReader();
-
- private static final String GLOBAL_TRACE_IDS = "gt";
- private static final String SEGMENT = "sg";
-
- @Override public TraceSegment read(JsonReader reader) throws IOException {
- TraceSegment traceSegment = new TraceSegment();
-
- reader.beginObject();
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case GLOBAL_TRACE_IDS:
- reader.beginArray();
- while (reader.hasNext()) {
- traceSegment.addGlobalTraceId(uniqueIdJsonReader.read(reader));
- }
- reader.endArray();
-
- break;
- case SEGMENT:
- traceSegment.setTraceSegmentBuilder(segmentJsonReader.read(reader));
- break;
- default:
- reader.skipValue();
- break;
- }
- }
- reader.endObject();
-
- return traceSegment;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/UniqueIdJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/UniqueIdJsonReader.java
deleted file mode 100644
index c2d48abbbeac3ff212389a9016c3d86079ab7e77..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/UniqueIdJsonReader.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.apache.skywalking.apm.network.language.agent.UniqueId;
-
-/**
- * @author peng-yongsheng
- */
-public class UniqueIdJsonReader implements StreamJsonReader {
-
- @Override public UniqueId.Builder read(JsonReader reader) throws IOException {
- UniqueId.Builder builder = UniqueId.newBuilder();
-
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addIdParts(reader.nextLong());
- }
- reader.endArray();
- return builder;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider
deleted file mode 100644
index d481e10a695234ddb60e6227b542f13a35e18b9d..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-#
-
-org.apache.skywalking.apm.collector.agent.jetty.provider.AgentModuleJettyProvider
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/DelegatingServletInputStream.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/DelegatingServletInputStream.java
deleted file mode 100644
index c88b1613f2fe999c3d7e148257f0135407156772..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/DelegatingServletInputStream.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector;
-
-import org.junit.Assert;
-
-import javax.servlet.ReadListener;
-import javax.servlet.ServletInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * @author lican
- */
-public class DelegatingServletInputStream extends ServletInputStream {
-
- private final InputStream sourceStream;
-
-
- /**
- * Create a DelegatingServletInputStream for the given source stream.
- * @param sourceStream the source stream (never null)
- */
- public DelegatingServletInputStream(InputStream sourceStream) {
- Assert.assertNotNull("Source InputStream must not be null",sourceStream);
- this.sourceStream = sourceStream;
- }
-
- /**
- * Return the underlying source stream (never null).
- */
- public final InputStream getSourceStream() {
- return this.sourceStream;
- }
-
-
- public int read() throws IOException {
- return this.sourceStream.read();
- }
-
- public void close() throws IOException {
- super.close();
- this.sourceStream.close();
- }
-
- @Override
- public boolean isFinished() {
- return false;
- }
-
- @Override
- public boolean isReady() {
- return false;
- }
-
- @Override
- public void setReadListener(ReadListener readListener) {
-
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProviderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProviderTest.java
deleted file mode 100644
index f09acca70f973f32ef11bc6122f41d918a62b843..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProviderTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider;
-
-import org.apache.skywalking.apm.collector.agent.jetty.define.AgentJettyModule;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.internal.util.reflection.Whitebox;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.anyString;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class AgentModuleJettyProviderTest {
-
-
- @Mock
- private ModuleManager moduleManager;
-
- @Mock
- private AgentModuleJettyConfig config;
-
- private AgentModuleJettyProvider provider;
-
- @Before
- public void setUp() throws Exception {
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- provider = new AgentModuleJettyProvider();
- Whitebox.setInternalState(provider, "manager", moduleManager);
- Whitebox.setInternalState(provider, "config", config);
-
- }
-
- @Test
- public void name() {
- assertEquals(provider.name(), "jetty");
- }
-
- @Test
- public void module() {
- assertEquals(provider.module(), AgentJettyModule.class);
- }
-
- @Test
- public void createConfigBeanIfAbsent() {
- assertEquals(provider.createConfigBeanIfAbsent(), config);
- }
-
- @Test
- public void prepare() {
- provider.prepare();
- }
-
- @Test
- public void start() {
- provider.start();
- }
-
- @Test
- public void notifyAfterCompleted() {
- provider.notifyAfterCompleted();
- }
-
- @Test
- public void requiredModules() {
- assertTrue(provider.requiredModules().length > 0);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistrationTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistrationTest.java
deleted file mode 100644
index 1524eca9cebfce6d7788d67dcb424346d5e8e215..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistrationTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider;
-
-import org.apache.skywalking.apm.collector.cluster.ModuleRegistration;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.junit.Assert.*;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class AgentModuleJettyRegistrationTest {
-
- private AgentModuleJettyRegistration registration;
-
- @Before
- public void setUp() throws Exception {
- registration = new AgentModuleJettyRegistration("127.0.0.1", 8080, "/");
- }
-
- @Test
- public void buildValue() {
- ModuleRegistration.Value value = registration.buildValue();
- Assert.assertEquals(value.getHostPort(), "127.0.0.1:8080");
- assertEquals(value.getContextPath(), "/");
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ApplicationRegisterPost.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ApplicationRegisterPost.java
deleted file mode 100644
index fa31599f08e3450cf83d574ad60a3cb26d1b91a1..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ApplicationRegisterPost.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider;
-
-import com.google.gson.JsonElement;
-import java.io.IOException;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationRegisterPost {
-
- public void send(String jsonFile) throws IOException {
- JsonElement application = JsonFileReader.INSTANCE.read(jsonFile);
- HttpClientTools.INSTANCE.post("http://localhost:12800/application/register", application.toString());
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/HttpClientTools.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/HttpClientTools.java
deleted file mode 100644
index 5d96d57ee42b54e4d9ca4214fcf8710e668283b7..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/HttpClientTools.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.List;
-import org.apache.http.Consts;
-import org.apache.http.HttpEntity;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public enum HttpClientTools {
- INSTANCE;
-
- private static final Logger logger = LoggerFactory.getLogger(HttpClientTools.class);
-
- public String get(String url, List params) throws IOException {
- CloseableHttpClient httpClient = HttpClients.createDefault();
- try {
- HttpGet httpget = new HttpGet(url);
- String paramStr = EntityUtils.toString(new UrlEncodedFormEntity(params));
- httpget.setURI(new URI(httpget.getURI().toString() + "?" + paramStr));
- logger.debug("executing get request {}", httpget.getURI());
-
- try (CloseableHttpResponse response = httpClient.execute(httpget)) {
- HttpEntity entity = response.getEntity();
- if (entity != null) {
- return EntityUtils.toString(entity);
- }
- }
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- } finally {
- try {
- httpClient.close();
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- }
- return null;
- }
-
- public String post(String url, String data) throws IOException {
- CloseableHttpClient httpClient = HttpClients.createDefault();
- try {
- HttpPost httppost = new HttpPost(url);
- httppost.setEntity(new StringEntity(data, Consts.UTF_8));
- logger.debug("executing post request {}", httppost.getURI());
- try (CloseableHttpResponse response = httpClient.execute(httppost)) {
- HttpEntity entity = response.getEntity();
- if (entity != null) {
- return EntityUtils.toString(entity);
- }
- }
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- } finally {
- try {
- httpClient.close();
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- }
- }
- return null;
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/InstanceRegisterPost.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/InstanceRegisterPost.java
deleted file mode 100644
index 97cfb127814ec717b6764906487ed0ca6371fabb..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/InstanceRegisterPost.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider;
-
-import com.google.gson.JsonElement;
-import java.io.IOException;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceRegisterPost {
-
- public void send(String jsonFile) throws IOException {
- JsonElement instance = JsonFileReader.INSTANCE.read(jsonFile);
- HttpClientTools.INSTANCE.post("http://localhost:12800/instance/register", instance.toString());
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/JsonFileReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/JsonFileReader.java
deleted file mode 100644
index cf48637b89a89b687db6176eb0ac080b7fa437c0..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/JsonFileReader.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public enum JsonFileReader {
- INSTANCE;
-
- private final Logger logger = LoggerFactory.getLogger(JsonFileReader.class);
-
- public JsonElement read(String fileName) throws FileNotFoundException {
- String path = this.getClass().getClassLoader().getResource(fileName).getFile();
- logger.debug("path: {}", path);
- JsonParser jsonParser = new JsonParser();
- return jsonParser.parse(new FileReader(path));
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/SegmentPost.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/SegmentPost.java
deleted file mode 100644
index 6f6a108be597af4d85022adb2db83e304073e46b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/SegmentPost.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider;
-
-import com.google.gson.JsonElement;
-import java.io.IOException;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentPost {
-
- public static void main(String[] args) throws IOException {
- ApplicationRegisterPost applicationRegisterPost = new ApplicationRegisterPost();
- applicationRegisterPost.send("json/application-register-consumer.json");
- applicationRegisterPost.send("json/application-register-provider.json");
-
- InstanceRegisterPost instanceRegisterPost = new InstanceRegisterPost();
- instanceRegisterPost.send("json/instance-register-consumer.json");
- instanceRegisterPost.send("json/instance-register-provider.json");
-
- ServiceNameRegisterPost serviceNameRegisterPost = new ServiceNameRegisterPost();
- serviceNameRegisterPost.send("json/servicename-register-consumer.json");
- serviceNameRegisterPost.send("json/servicename-register-provider.json");
-
- JsonElement provider = JsonFileReader.INSTANCE.read("json/dubbox-provider.json");
- JsonElement consumer = JsonFileReader.INSTANCE.read("json/dubbox-consumer.json");
-
- for (int i = 0; i < 1; i++) {
- HttpClientTools.INSTANCE.post("http://localhost:12800/segments", provider.toString());
- HttpClientTools.INSTANCE.post("http://localhost:12800/segments", consumer.toString());
- }
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ServiceNameRegisterPost.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ServiceNameRegisterPost.java
deleted file mode 100644
index af40d62be4e7b460f966b8733c7668857659f3de..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ServiceNameRegisterPost.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider;
-
-import com.google.gson.JsonElement;
-import java.io.IOException;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameRegisterPost {
-
- public void send(String jsonFile) throws IOException {
- JsonElement instance = JsonFileReader.INSTANCE.read(jsonFile);
- HttpClientTools.INSTANCE.post("http://localhost:12800/servicename/discovery", instance.toString());
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandlerTest.java
deleted file mode 100644
index 423e01a8f1979be27f5fed67dbd3f322c7aa9095..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandlerTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.collector.DelegatingServletInputStream;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import javax.servlet.http.HttpServletRequest;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.anyString;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class ApplicationRegisterServletHandlerTest {
-
- private ApplicationRegisterServletHandler applicationRegisterServletHandler;
-
- @Mock
- private ModuleManager moduleManager;
- @Mock
- private HttpServletRequest request;
-
- private Gson gson = new Gson();
-
- @Before
- public void setUp() throws Exception {
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- applicationRegisterServletHandler = new ApplicationRegisterServletHandler(moduleManager);
- }
-
- @Test
- public void pathSpec() {
- assertEquals(applicationRegisterServletHandler.pathSpec(), "/application/register");
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void doGet() throws ArgumentsParseException {
- applicationRegisterServletHandler.doGet(request);
- }
-
- @Test
- public void doPost() throws ArgumentsParseException, IOException {
- JsonArray array = new JsonArray();
- array.add("test_code");
- String s = gson.toJson(array);
- Mockito.when(request.getReader()).then(invocation -> {
- DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes()));
- return new BufferedReader(new InputStreamReader(delegatingServletInputStream));
- });
- JsonElement jsonElement = applicationRegisterServletHandler.doPost(request);
- JsonObject jsonObject = (JsonObject) ((JsonArray) jsonElement).get(0);
- assertEquals(jsonObject.get("c").getAsString(), "test_code");
- assertEquals(jsonObject.get("i").getAsInt(), 0);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandlerTest.java
deleted file mode 100644
index f23d13305da469b4ee42f54bdb12ba212ea148c8..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandlerTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.collector.DelegatingServletInputStream;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import javax.servlet.http.HttpServletRequest;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.anyString;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class InstanceDiscoveryServletHandlerTest {
-
- @Mock
- private ModuleManager moduleManager;
- @Mock
- private HttpServletRequest request;
-
- private Gson gson = new Gson();
-
- private InstanceDiscoveryServletHandler instanceDiscoveryServletHandler;
-
- @Before
- public void setUp() throws Exception {
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- instanceDiscoveryServletHandler = new InstanceDiscoveryServletHandler(moduleManager);
-
- }
-
- @Test
- public void pathSpec() {
- assertEquals(instanceDiscoveryServletHandler.pathSpec(), "/instance/register");
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void doGet() throws ArgumentsParseException {
- instanceDiscoveryServletHandler.doGet(request);
- }
-
- @Test
- public void doPost() throws ArgumentsParseException, IOException {
- JsonObject jsonObject = new JsonObject();
- jsonObject.addProperty("ai", 1);
- jsonObject.addProperty("au", "123");
- jsonObject.addProperty("rt", System.currentTimeMillis());
- JsonObject osInfo = new JsonObject();
- osInfo.addProperty("osName", "test");
- jsonObject.add("oi", osInfo);
- String s = gson.toJson(jsonObject);
- Mockito.when(request.getReader()).then(invocation -> {
- DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes()));
- return new BufferedReader(new InputStreamReader(delegatingServletInputStream));
- });
- JsonElement jsonElement = instanceDiscoveryServletHandler.doPost(request);
- int ii = ((JsonObject) jsonElement).get("ii").getAsInt();
- assertEquals(ii, 0);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandlerTest.java
deleted file mode 100644
index 028b9654cdf436c661866a670e86feadb8feb0ef..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandlerTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.collector.DelegatingServletInputStream;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import javax.servlet.http.HttpServletRequest;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.anyString;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class InstanceHeartBeatServletHandlerTest {
-
- @Mock
- private ModuleManager moduleManager;
- @Mock
- private HttpServletRequest request;
-
- private Gson gson = new Gson();
-
- private InstanceHeartBeatServletHandler heartBeatServletHandler;
-
- @Before
- public void setUp() throws Exception {
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- heartBeatServletHandler = new InstanceHeartBeatServletHandler(moduleManager);
-
- }
-
- @Test
- public void pathSpec() {
- assertEquals(heartBeatServletHandler.pathSpec(), "/instance/heartbeat");
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void doGet() throws ArgumentsParseException {
- heartBeatServletHandler.doGet(request);
- }
-
- @Test
- public void doPost() throws IOException, ArgumentsParseException {
- JsonObject jsonObject = new JsonObject();
- jsonObject.addProperty("ii", 1);
- jsonObject.addProperty("ht", System.currentTimeMillis());
- String s = gson.toJson(jsonObject);
- Mockito.when(request.getReader()).then(invocation -> {
- DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes()));
- return new BufferedReader(new InputStreamReader(delegatingServletInputStream));
- });
- JsonElement jsonElement = heartBeatServletHandler.doPost(request);
- assertTrue(jsonElement.isJsonObject());
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandlerTest.java
deleted file mode 100644
index 5d544a80e1a2ac4c978a9b758c650dfe9e20f878..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandlerTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import org.apache.skywalking.apm.collector.DelegatingServletInputStream;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import javax.servlet.http.HttpServletRequest;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.anyString;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class NetworkAddressRegisterServletHandlerTest {
-
- private NetworkAddressRegisterServletHandler handler;
-
- @Mock
- private ModuleManager moduleManager;
- @Mock
- private HttpServletRequest request;
-
- private Gson gson = new Gson();
-
- @Before
- public void setUp() throws Exception {
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- handler = new NetworkAddressRegisterServletHandler(moduleManager);
- }
-
- @Test
- public void pathSpec() {
- assertEquals(handler.pathSpec(), "/networkAddress/register");
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void doGet() throws ArgumentsParseException {
- handler.doGet(request);
- }
-
- @Test
- public void doPost() throws ArgumentsParseException, IOException {
- JsonArray array = new JsonArray();
- array.add("127.0.0.1:6379");
- array.add("127.0.0.2:6379");
- String s = gson.toJson(array);
- Mockito.when(request.getReader()).then(invocation -> {
- DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes()));
- return new BufferedReader(new InputStreamReader(delegatingServletInputStream));
- });
- JsonElement jsonElement = handler.doPost(request);
- Assert.assertTrue(jsonElement.isJsonArray());
- JsonArray js = (JsonArray) jsonElement;
- assertTrue(js.size() > 0);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java
deleted file mode 100644
index 226f79d5e58df0bdb003c3719ad0f1e68b951caf..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.collector.DelegatingServletInputStream;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.internal.util.reflection.Whitebox;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import javax.servlet.http.HttpServletRequest;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyString;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class ServiceNameDiscoveryServiceHandlerTest {
-
- @Mock
- private ModuleManager moduleManager;
- @Mock
- private HttpServletRequest request;
-
- private ServiceNameDiscoveryServiceHandler handler;
-
- private Gson gson = new Gson();
-
- @Mock
- private IServiceNameService serviceNameService;
-
- @Before
- public void setUp() throws Exception {
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
- handler = new ServiceNameDiscoveryServiceHandler(moduleManager);
- Whitebox.setInternalState(handler, "serviceNameService", serviceNameService);
- }
-
- @Test
- public void pathSpec() {
- assertEquals(handler.pathSpec(), "/servicename/discovery");
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void doGet() throws ArgumentsParseException {
- handler.doGet(request);
- }
-
- @Test
- public void doPost() throws IOException, ArgumentsParseException {
- JsonObject json = new JsonObject();
- json.addProperty("ai", 1);
- json.addProperty("sn", "test");
- json.addProperty("st", 5);
-
- JsonArray array = new JsonArray();
- array.add(json);
-
- String s = gson.toJson(array);
-
- when(serviceNameService.getOrCreate(anyInt(), anyInt(), anyString())).thenReturn(2);
-
- Mockito.when(request.getReader()).then(invocation -> {
- DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes()));
- return new BufferedReader(new InputStreamReader(delegatingServletInputStream));
- });
- JsonElement jsonElement = handler.doPost(request);
- int serviceId = jsonElement.getAsJsonArray().get(0).getAsJsonObject().get("si").getAsInt();
- assertEquals(serviceId, 2);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandlerTest.java
deleted file mode 100644
index d3ff32016fa97dfb8bf5dde343f6c3b74d34bade..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandlerTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.collector.DelegatingServletInputStream;
-import org.apache.skywalking.apm.collector.core.module.MockModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import javax.servlet.http.HttpServletRequest;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import static org.mockito.Matchers.anyString;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class TraceSegmentServletHandlerTest {
-
- @Mock
- private ModuleManager moduleManager;
- @Mock
- private HttpServletRequest request;
-
- private Gson gson = new Gson();
-
- private TraceSegmentServletHandler handler;
-
- @Before
- public void setUp() throws Exception {
- when(moduleManager.find(anyString())).then(invocation -> new MockModule());
-
- handler = new TraceSegmentServletHandler(moduleManager);
- }
-
- @Test
- public void pathSpec() {
- Assert.assertEquals(handler.pathSpec(), "/segments");
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void doGet() throws ArgumentsParseException {
- handler.doGet(request);
- }
-
- @Test
- public void doPost() throws IOException, ArgumentsParseException {
-
- JsonArray array = new JsonArray();
- array.add(230150);
- array.add(185809);
- array.add(24040000);
- JsonArray gtArray = new JsonArray();
- gtArray.add(array);
- JsonObject json = new JsonObject();
- json.add("gt", gtArray);
- json.add("sg", new JsonObject());
-
- JsonArray finalArr = new JsonArray();
- finalArr.add(json);
-
- String s = gson.toJson(finalArr);
-
- Mockito.when(request.getReader()).then(invocation -> {
- DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes()));
- return new BufferedReader(new InputStreamReader(delegatingServletInputStream));
- });
-
- JsonElement jsonElement = handler.doPost(request);
-
- Assert.assertNull(jsonElement);
-
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandlerTest.java
deleted file mode 100644
index bfc830a2048c405c3d678a2e191568b85954af50..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandlerTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import javax.servlet.http.HttpServletRequest;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class AgentJettyNamingHandlerTest {
-
- private AgentJettyNamingHandler agentJettyNamingHandler;
- @Mock
- private HttpServletRequest request;
-
- private String address = "127.0.0.1:8080";
-
- @Before
- public void setUp() {
- AgentJettyNamingListener agentJettyNamingListener = new AgentJettyNamingListener();
- agentJettyNamingListener.addAddress(address);
- agentJettyNamingHandler = new AgentJettyNamingHandler(agentJettyNamingListener);
-
- }
-
- @Test
- public void pathSpec() {
- assertEquals(agentJettyNamingHandler.pathSpec(), "/agent/jetty");
- }
-
- @Test
- public void doGet() throws ArgumentsParseException {
- JsonElement jsonElement = agentJettyNamingHandler.doGet(request);
- assertEquals(((JsonArray) jsonElement).get(0).getAsString(), address);
-
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void doPost() throws ArgumentsParseException {
- agentJettyNamingHandler.doPost(request);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListenerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListenerTest.java
deleted file mode 100644
index c1608defd24f532cfe7ace7a1d587f9afed094e8..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListenerTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class AgentJettyNamingListenerTest {
-
- private AgentJettyNamingListener agentJettyNamingListener;
-
- @Before
- public void setUp() throws Exception {
- agentJettyNamingListener = new AgentJettyNamingListener();
-
- }
-
- @Test
- public void path() {
- assertEquals(agentJettyNamingListener.path(), "/agent_jetty/jetty");
- }
-
- @Test
- public void serverJoinNotify() {
- agentJettyNamingListener.serverJoinNotify(null);
- }
-
- @Test
- public void serverQuitNotify() {
- agentJettyNamingListener.serverQuitNotify(null);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/BaseReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/BaseReader.java
deleted file mode 100644
index 46c7e07d0ef1b258e4fe215e78c8a5ba7d46cc9d..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/BaseReader.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.stream.JsonReader;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStreamReader;
-
-/**
- * @author lican
- */
-public class BaseReader {
-
- private Gson gson = new Gson();
-
- protected JsonReader getReader(JsonElement element) {
- return new JsonReader(new InputStreamReader(new ByteArrayInputStream(gson.toJson(element).getBytes())));
- }
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReaderTest.java
deleted file mode 100644
index 35ef275711651b538cbf579624f96d257f31254b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReaderTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.network.language.agent.KeyWithStringValue;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import java.io.IOException;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class KeyWithStringValueJsonReaderTest extends BaseReader {
-
- private KeyWithStringValueJsonReader jsonReader;
-
- @Before
- public void setUp() throws Exception {
- jsonReader = new KeyWithStringValueJsonReader();
- }
-
- @Test
- public void read() throws IOException {
- Gson gson = new Gson();
- JsonObject jsonObject = new JsonObject();
- jsonObject.addProperty("k", "hello");
- jsonObject.addProperty("v", "world");
- KeyWithStringValue read = jsonReader.read(getReader(jsonObject));
- assertEquals(read.getKey(),"hello");
- assertEquals(read.getValue(),"world");
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReaderTest.java
deleted file mode 100644
index 5b66b9e6ef1ae69def0ec8d0a8fa866b9af4b172..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReaderTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.network.language.agent.LogMessage;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import java.io.IOException;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class LogJsonReaderTest extends BaseReader {
-
- private LogJsonReader logJsonReader;
-
- @Before
- public void setUp() throws Exception {
- logJsonReader = new LogJsonReader();
- }
-
- @Test
- public void read() throws IOException {
- Gson gson = new Gson();
- JsonObject jsonObject = new JsonObject();
- jsonObject.addProperty("k", "hello");
- jsonObject.addProperty("v", "world");
-
- JsonArray array = new JsonArray();
- array.add(jsonObject);
-
- long l = System.currentTimeMillis();
-
- JsonObject json = new JsonObject();
- json.addProperty("ti", l);
- json.add("ld", array);
-
- LogMessage read = logJsonReader.read(getReader(json));
-
- Assert.assertEquals(read.getTime(), l);
- }
-
-
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReaderTest.java
deleted file mode 100644
index e705f907b68295497875f8e0dfd7aeb733f9aff8..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReaderTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.network.language.agent.TraceSegmentReference;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import java.io.IOException;
-
-import static org.junit.Assert.assertTrue;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class ReferenceJsonReaderTest extends BaseReader {
-
- private ReferenceJsonReader referenceJsonReader;
-
- @Before
- public void setUp() throws Exception {
- referenceJsonReader = new ReferenceJsonReader();
- }
-
- /**
- * {
- * "pts": [230150, 185809, 24040000], //parentTraceSegmentId
- * "pii": 2, //parentApplicationInstanceId
- * "psp": 1, //parentSpanId
- * "psi": 0, //parentServiceId
- * "psn": "/dubbox-case/case/dubbox-rest", //parentServiceName
- * "ni": 0, //networkAddressId
- * "nn": "172.25.0.4:20880", //networkAddress
- * "eii": 2, //entryApplicationInstanceId
- * "esi": 0, //entryServiceId
- * "esn": "/dubbox-case/case/dubbox-rest", //entryServiceName
- * "rv": 0 //RefType
- * }
- */
- @Test
- public void read() throws IOException {
- Gson gson = new Gson();
- JsonObject jsonObject = new JsonObject();
- JsonArray ptsArray = new JsonArray();
- ptsArray.add(230150L);
- ptsArray.add(185809L);
- ptsArray.add(24040000L);
-
- jsonObject.add("pts", ptsArray);
- jsonObject.addProperty("pii", 2);
- jsonObject.addProperty("psp", 1);
- jsonObject.addProperty("psi", 0);
- jsonObject.addProperty("psn", "/dubbox-case/case/dubbox-rest");
- jsonObject.addProperty("ni", 0);
- jsonObject.addProperty("nn", "172.25.0.4:20880");
- jsonObject.addProperty("eii", 2);
- jsonObject.addProperty("esi", 0);
- jsonObject.addProperty("esn", "/dubbox-case/case/dubbox-rest");
-// jsonObject.addProperty("rn", 0);
- //add
- jsonObject.addProperty("rv", 1);
-
- TraceSegmentReference read = referenceJsonReader.read(getReader(jsonObject));
- assertTrue(read.getParentTraceSegmentId().getIdPartsList().size() == 3);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReaderTest.java
deleted file mode 100644
index 011694a659e07daa6ce2c2f4dc067d11501b2515..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReaderTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import java.io.IOException;
-
-import static org.junit.Assert.assertTrue;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class SegmentJsonReaderTest extends BaseReader {
-
- private SegmentJsonReader segmentJsonReader;
-
- @Before
- public void setUp() throws Exception {
- segmentJsonReader = new SegmentJsonReader();
- }
-
- /**
- * { //TraceSegmentObject
- * "ts": [137150, 185809, 48780000],
- * "ai": 2, //applicationId
- * "ii": 3, //applicationInstanceId
- * "ss": []//SpanObject
- */
- @Test
- public void read() throws IOException {
- JsonArray tsArray = new JsonArray();
- tsArray.add(137150);
- tsArray.add(185809);
- tsArray.add(48780000);
-
- JsonObject json = new JsonObject();
- json.add("ts", tsArray);
- json.addProperty("ai", 2);
- json.addProperty("ii", 3);
- json.add("ss", new JsonArray());
- TraceSegmentObject.Builder read = segmentJsonReader.read(getReader(json));
- TraceSegmentObject build = read.build();
- assertTrue(build.getTraceSegmentId().getIdPartsList().size() == 3);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReaderTest.java
deleted file mode 100644
index ecac2870505228dc548f979eda5c7b45a32a697c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReaderTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.network.language.agent.SpanObject;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import java.io.IOException;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class SpanJsonReaderTest extends BaseReader {
-
- private SpanJsonReader spanJsonReader;
-
- @Before
- public void setUp() throws Exception {
- spanJsonReader = new SpanJsonReader();
- }
-
- /**
- * {
- * "si": 0, //spanId
- * "tv": 0, //SpanType
- * "lv": 2, //SpanLayer
- * "ps": -1, //parentSpanId
- * "st": 1501858094726, //startTime
- * "et": 1501858096804, //endTime
- * "ci": 3, //componentId
- * "cn": "", //component
- * "oi": 0, //operationNameId
- * "on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()", //operationName
- * "pi": 0, //peerId
- * "pn": "", //peer
- * "ie": false, //isError
- * "rs": [ //TraceSegmentReference],
- * "to": [ //KeyWithStringValue ],
- * "lo": [] //log
- * }
- */
- @Test
- public void read() throws IOException {
- JsonObject json = new JsonObject();
- json.addProperty("si", 1);
- json.addProperty("tv", 0);
- json.addProperty("lv", 2);
- json.addProperty("ps", -1);
- json.addProperty("st", 1501858094726L);
- json.addProperty("et", 1501858096804L);
- json.addProperty("ci", 3);
- json.addProperty("cn", "redis");
- json.addProperty("oi", 0);
- json.addProperty("on", "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- json.addProperty("pi", 0);
- json.addProperty("pn", "127.0.0.1:6379");
- json.addProperty("ie", false);
- json.add("rs", new JsonArray());
- json.add("to", new JsonArray());
- json.add("lo", new JsonArray());
- SpanObject read = spanJsonReader.read(getReader(json));
- assertEquals(read.getSpanId(), 1);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReaderTest.java
deleted file mode 100644
index e834f23dbf6ba98952c8e0951cdd0596354bb02f..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReaderTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.network.language.agent.UniqueId;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import java.io.IOException;
-import java.util.List;
-
-import static org.junit.Assert.assertTrue;
-
-/**
- * @author lican
- */
-@RunWith(MockitoJUnitRunner.class)
-public class TraceSegmentJsonReaderTest extends BaseReader {
-
- private TraceSegmentJsonReader traceSegmentJsonReader;
-
- @Before
- public void setUp() throws Exception {
- traceSegmentJsonReader = new TraceSegmentJsonReader();
- }
-
- /**
- * {
- * "gt": [[230150, 185809, 24040000]],
- * "sg": { }//TraceSegmentObject
- */
- @Test
- public void read() throws IOException {
- JsonArray array = new JsonArray();
- array.add(230150);
- array.add(185809);
- array.add(24040000);
- JsonArray gtArray = new JsonArray();
- gtArray.add(array);
- JsonObject json = new JsonObject();
- json.add("gt", gtArray);
- json.add("sg", new JsonObject());
- TraceSegment read = traceSegmentJsonReader.read(getReader(json));
- List globalTraceIdsList = read.getUpstreamSegment().getGlobalTraceIdsList();
- assertTrue(globalTraceIdsList.size() == 1);
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java
deleted file mode 100644
index b7ca4bae3e5063388aba518f3298f549a1b89060..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module;
-
-import com.google.common.collect.Lists;
-import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService;
-import org.apache.skywalking.apm.collector.server.jetty.JettyServer;
-import org.mockito.Mockito;
-import org.mockito.internal.util.reflection.Whitebox;
-import org.powermock.api.mockito.PowerMockito;
-
-import java.util.LinkedList;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.when;
-
-/**
- * @author lican
- */
-public class MockModule extends ModuleDefine {
-
- public MockModule() throws ServiceNotProvidedException {
- ModuleProvider moduleProvider = Mockito.mock(ModuleProvider.class);
- LinkedList linkedList = Lists.newLinkedList();
- linkedList.add(moduleProvider);
- Whitebox.setInternalState(this, "loadedProviders", linkedList);
- when(moduleProvider.getService(any())).then(invocation -> {
- Class argumentAt = invocation.getArgumentAt(0, Class.class);
- Object mock = Mockito.mock(argumentAt);
- if (mock instanceof JettyManagerService) {
- PowerMockito.when(((JettyManagerService) mock).createIfAbsent(anyString(), anyInt(), anyString())).then(invocation1 -> {
- JettyServer jettyServer = new JettyServer("127.0.0.1", 10806, "/");
- jettyServer.initialize();
- return jettyServer;
- });
-
- }
- return mock;
- });
- }
-
- @Override
- public String name() {
- return null;
- }
-
- @Override
- public Class[] services() {
- return new Class[0];
- }
-
-
-}
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-consumer.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-consumer.json
deleted file mode 100644
index b7f2436357dc70996fcf365ebb2c41e21ad5165b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-consumer.json
+++ /dev/null
@@ -1,3 +0,0 @@
-[
- "dubbox-consumer"
-]
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-provider.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-provider.json
deleted file mode 100644
index 08a2c156bcd2c6d35764ffe02b30b1a47a9929d6..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-provider.json
+++ /dev/null
@@ -1,3 +0,0 @@
-[
- "dubbox-provider"
-]
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-consumer.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-consumer.json
deleted file mode 100644
index 06bb8fe87f7c4c9166e8a128574677d54eae1c48..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-consumer.json
+++ /dev/null
@@ -1,61 +0,0 @@
-[
- {
- "gt": [[230150, 185809, 24040000]], //trace_id 链路编码
- "sg": {
- "ts": [230150, 185809, 24040000], //segment_id 一个应用中的一个实例在链路中产生的编号
- "ai": -1, //应用ID,应用启动注册时产生
- "ii": 2, //实例ID,应用启动注册时产生
- "rs": [], //链路的上下文信息,头节点,所以为空
- "ss": [ //一个埋点(手动埋点或者自动埋点)
- {
- "si": 1, //埋点编号
- "tv": 1, //埋点类型(手动、入口、出口)
- "lv": 2, //层(RPCFramework,Database,Http)
- "ps": 0, //上级埋点编号
- "st": 1501858094526, //开始时间
- "et": 1501858097004, //结束时间
- "ci": 3, //组件编号(Tomcat、Mysql、Dubbo...)
- "cn": "", //组件名称
- "oi": 0, //埋点的服务ID
- "on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()", //埋点的服务名
- "pi": 0, //地址注册的ID,调用抓取后注册
- "pn": "172.25.0.4:20880", //地址
- "ie": false, //是否发生错误,是否有Exception
- "to": [ //与链路分析关系较小的TAG,SQL也在其中
- {
- "k": "url",
- "v": "rest://172.25.0.4:20880/org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"
- }
- ],
- "lo": [] //日志,与链路分析完全无关,只作为展示使用,手动埋点时可以任意追加,kv的形式,例如收集一些业务相关的信息
- },
- {
- "si": 0,
- "tv": 0,
- "lv": 3,
- "ps": -1,
- "st": 1501858092409,
- "et": 1501858097033,
- "ci": 1,
- "cn": "",
- "oi": 0,
- "on": "/dubbox-case/case/dubbox-rest",
- "pi": 0,
- "pn": "",
- "ie": false,
- "to": [
- {
- "k": "url",
- "v": "http://localhost:18080/dubbox-case/case/dubbox-rest"
- },
- {
- "k": "http.method",
- "v": "GET"
- }
- ],
- "lo": []
- }
- ]
- }
- }
-]
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json
deleted file mode 100644
index 856cfc03cae760de5821a2de4a67ada5a130f7c0..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json
+++ /dev/null
@@ -1,70 +0,0 @@
-[
- {
- "gt": [[230150, 185809, 24040000]], //trace_id 链路编码,与调用方相同
- "sg": {
- "ts": [137150, 185809, 48780000], //segment_id,新产生
- "ai": 2,
- "ii": 3,
- "ss": [
- {
- "si": 0,
- "tv": 0,
- "lv": 2,
- "ps": -1,
- "st": 1501858094726,
- "et": 1501858096804,
- "ci": 3,
- "cn": "",
- "oi": 0,
- "on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()",
- "pi": 0,
- "pn": "",
- "ie": false,
- "rs": [
- {
- "pts": [230150, 185809, 24040000], //上级的segment_id 一个应用中的一个实例在链路中产生的编号
- "pii": 2, //上级的实例编号
- "psp": 1, //上级的埋点编号span_id
- "psi": 0, //上级的服务编号(org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()注册后的ID)
- "psn": "/dubbox-case/case/dubbox-rest", //上级的服务名
- "ni": 0, //上级调用时使用的地址注册后的ID
- "nn": "172.25.0.4:20880", //上级的地址
- "eii": 2, //入口的实例编号
- "esi": 0, //入口的服务编号
- "esn": "/dubbox-case/case/dubbox-rest", //入口的服务名词
- "rn": 0 //调用方式(CrossProcess,CrossThread)
- }
- ],
- "to": [
- {
- "k": "url",
- "v": "rest://172.25.0.4:20880/org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"
- },
- {
- "k": "http.method",
- "v": "GET"
- }
- ],
- "lo": []
- },
- {
- "si": 1,
- "tv": 1,
- "lv": 1,
- "ps": 0,
- "st": 1501858094726,
- "et": 1501858095804,
- "ci": 9,
- "cn": "",
- "oi": 0,
- "on": "mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]",
- "pi": 0,
- "pn": "localhost:27017",
- "ie": false,
- "to": [],
- "lo": []
- }
- ]
- }
- }
-]
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-consumer.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-consumer.json
deleted file mode 100644
index e2cb6e068d662afb6d4fa58033673edc6333eb5c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-consumer.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "ai": -1,
- "au": "dubbox-consumer",
- "rt": 1501858094526,
- "oi": {
- "osName": "MacOS XX",
- "hostName": "pengys",
- "processId": "1001",
- "ipv4s": [
- "10.0.0.3",
- "10.0.0.4"
- ]
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-provider.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-provider.json
deleted file mode 100644
index 304de7c4f878154d746d23f89229f8a8b2892a79..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-provider.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "ai": 2,
- "au": "dubbox-provider",
- "rt": 1501858094526,
- "oi": {
- "osName": "MacOS X",
- "hostName": "peng-yongsheng",
- "processId": "1000",
- "ipv4s": [
- "10.0.0.1",
- "10.0.0.2"
- ]
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-consumer.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-consumer.json
deleted file mode 100644
index 9cc919204c1c1647e90512eb4c7803aeb7eb8826..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-consumer.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "ai": -1,
- "sn": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"
- }
-]
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-provider.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-provider.json
deleted file mode 100644
index 0e9a961532e672304bf6ce352865cceb3fa16210..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-provider.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "ai": 2,
- "sn": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"
- }
-]
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/pom.xml b/apm-collector/apm-collector-agent/agent-jetty/pom.xml
deleted file mode 100644
index 283050bf7c74ed8464971a939dfff83892761535..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/agent-jetty/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
- apm-collector-agent
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- agent-jetty
- pom
-
- agent-jetty-define
- agent-jetty-provider
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/pom.xml b/apm-collector/apm-collector-agent/pom.xml
deleted file mode 100644
index 63be8dedb105ede7dd38ae3d198880af0ca794db..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-agent/pom.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
- apm-collector
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- apm-collector-agent
- pom
-
- agent-grpc
- agent-jetty
-
-
-
-
- org.apache.skywalking
- apm-collector-core
- ${project.version}
-
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/pom.xml
deleted file mode 100644
index d0770fd11c8caa5dec227bef5ab10590cb1f21d7..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/pom.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
- analysis-alarm
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- alarm-define
- jar
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/AnalysisAlarmModule.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/AnalysisAlarmModule.java
deleted file mode 100644
index 5b123a5f351413da225a797a065bf072d3597032..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/AnalysisAlarmModule.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.define;
-
-import org.apache.skywalking.apm.collector.core.module.ModuleDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class AnalysisAlarmModule extends ModuleDefine {
-
- public static final String NAME = "analysis_alarm";
-
- @Override public String name() {
- return NAME;
- }
-
- @Override public Class[] services() {
- return new Class[0];
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java
deleted file mode 100644
index 91cafc79ab64d20b2c68309e8c0d47282f1f3336..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.define.graph;
-
-/**
- * @author peng-yongsheng
- */
-public class AlarmGraphIdDefine {
- public static final int SERVICE_METRIC_ALARM_GRAPH_ID = 500;
- public static final int INSTANCE_METRIC_ALARM_GRAPH_ID = 501;
- public static final int APPLICATION_METRIC_ALARM_GRAPH_ID = 502;
- public static final int SERVICE_REFERENCE_METRIC_ALARM_GRAPH_ID = 503;
- public static final int INSTANCE_REFERENCE_METRIC_ALARM_GRAPH_ID = 504;
- public static final int APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_ID = 505;
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java
deleted file mode 100644
index d36427468c5c5cbffcd877876bbc1b02263f5bfc..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.define.graph;
-
-/**
- * @author peng-yongsheng
- */
-public class AlarmWorkerIdDefine {
- public static final int SERVICE_METRIC_ALARM_ASSERT_WORKER_ID = 5000;
- public static final int SERVICE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5001;
- public static final int SERVICE_METRIC_ALARM_REMOTE_WORKER_ID = 5002;
- public static final int SERVICE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5003;
- public static final int SERVICE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 5004;
- public static final int SERVICE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5005;
-
- public static final int INSTANCE_METRIC_ALARM_ASSERT_WORKER_ID = 5010;
- public static final int INSTANCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5011;
- public static final int INSTANCE_METRIC_ALARM_REMOTE_WORKER_ID = 5012;
- public static final int INSTANCE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5013;
- public static final int INSTANCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 5014;
- public static final int INSTANCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5015;
-
- public static final int APPLICATION_METRIC_ALARM_ASSERT_WORKER_ID = 5020;
- public static final int APPLICATION_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5021;
- public static final int APPLICATION_METRIC_ALARM_REMOTE_WORKER_ID = 5022;
- public static final int APPLICATION_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5023;
- public static final int APPLICATION_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5024;
-
- public static final int SERVICE_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID = 5030;
- public static final int SERVICE_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5031;
- public static final int SERVICE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID = 5032;
- public static final int SERVICE_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5033;
- public static final int SERVICE_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 5034;
- public static final int SERVICE_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5035;
-
- public static final int INSTANCE_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID = 5040;
- public static final int INSTANCE_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5041;
- public static final int INSTANCE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID = 5042;
- public static final int INSTANCE_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5043;
- public static final int INSTANCE_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 5044;
- public static final int INSTANCE_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5045;
-
- public static final int APPLICATION_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID = 5050;
- public static final int APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5051;
- public static final int APPLICATION_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID = 5052;
- public static final int APPLICATION_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5053;
- public static final int APPLICATION_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 5054;
- public static final int APPLICATION_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5055;
-
- public static final int APPLICATION_METRIC_ALARM_LIST_MINUTE_PERSISTENCE_WORKER_ID = 5051;
- public static final int APPLICATION_METRIC_ALARM_LIST_HOUR_PERSISTENCE_WORKER_ID = 5052;
- public static final int APPLICATION_METRIC_ALARM_LIST_DAY_PERSISTENCE_WORKER_ID = 5053;
- public static final int APPLICATION_METRIC_ALARM_LIST_MONTH_PERSISTENCE_WORKER_ID = 5054;
- public static final int APPLICATION_METRIC_ALARM_LIST_HOUR_TRANSFORM_NODE_ID = 5055;
- public static final int APPLICATION_METRIC_ALARM_LIST_DAY_TRANSFORM_NODE_ID = 5056;
- public static final int APPLICATION_METRIC_ALARM_LIST_MONTH_TRANSFORM_NODE_ID = 5057;
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
deleted file mode 100644
index 5c95ca418110e6c953f000c9e16e2d3ce64de30e..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-#
-
-org.apache.skywalking.apm.collector.analysis.alarm.define.AnalysisAlarmModule
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/pom.xml
deleted file mode 100644
index 445f10be5d9e0ef3157df32f4ed4cce7bb5546ed..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
- analysis-alarm
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- alarm-provider
- jar
-
-
-
- org.apache.skywalking
- alarm-define
- ${project.version}
-
-
- org.apache.skywalking
- metric-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-configuration-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-storage-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-cache-define
- ${project.version}
-
-
- org.apache.skywalking
- analysis-worker-model
- ${project.version}
-
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleConfig.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleConfig.java
deleted file mode 100644
index 7df976a1253d26f7753e69c4ba7d4177490656d4..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleConfig.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider;
-
-import org.apache.skywalking.apm.collector.core.module.ModuleConfig;
-
-/**
- * @author peng-yongsheng
- */
-class AnalysisAlarmModuleConfig extends ModuleConfig {
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java
deleted file mode 100644
index f6725e97b1641deb3f971d084a0ec4cd555ef450..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.AnalysisAlarmModule;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application.*;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance.*;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service.*;
-import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.analysis.worker.timer.PersistenceTimer;
-import org.apache.skywalking.apm.collector.configuration.ConfigurationModule;
-import org.apache.skywalking.apm.collector.core.module.*;
-import org.apache.skywalking.apm.collector.remote.RemoteModule;
-import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.table.alarm.*;
-
-/**
- * @author peng-yongsheng
- */
-public class AnalysisAlarmModuleProvider extends ModuleProvider {
-
- private final AnalysisAlarmModuleConfig config;
-
- public AnalysisAlarmModuleProvider() {
- super();
- this.config = new AnalysisAlarmModuleConfig();
- }
-
- @Override public String name() {
- return "default";
- }
-
- @Override public Class extends ModuleDefine> module() {
- return AnalysisAlarmModule.class;
- }
-
- @Override public ModuleConfig createConfigBeanIfAbsent() {
- return config;
- }
-
- @Override public void prepare() {
- }
-
- @Override public void start() {
- WorkerCreateListener workerCreateListener = new WorkerCreateListener();
-
- new ServiceMetricAlarmGraph(getManager(), workerCreateListener).create();
- new InstanceMetricAlarmGraph(getManager(), workerCreateListener).create();
- new ApplicationMetricAlarmGraph(getManager(), workerCreateListener).create();
- new ServiceReferenceMetricAlarmGraph(getManager(), workerCreateListener).create();
- new InstanceReferenceMetricAlarmGraph(getManager(), workerCreateListener).create();
- new ApplicationReferenceMetricAlarmGraph(getManager(), workerCreateListener).create();
-
- registerRemoteData();
-
- PersistenceTimer.INSTANCE.start(getManager(), workerCreateListener.getPersistenceWorkers());
- }
-
- @Override public void notifyAfterCompleted() {
- }
-
- @Override public String[] requiredModules() {
- return new String[] {RemoteModule.NAME, AnalysisMetricModule.NAME, ConfigurationModule.NAME, StorageModule.NAME};
- }
-
- private void registerRemoteData() {
- RemoteDataRegisterService remoteDataRegisterService = getManager().find(RemoteModule.NAME).getService(RemoteDataRegisterService.class);
- remoteDataRegisterService.register(ApplicationAlarm.class, new ApplicationAlarm.InstanceCreator());
- remoteDataRegisterService.register(ApplicationAlarmList.class, new ApplicationAlarmList.InstanceCreator());
- remoteDataRegisterService.register(ApplicationReferenceAlarm.class, new ApplicationReferenceAlarm.InstanceCreator());
- remoteDataRegisterService.register(ApplicationReferenceAlarmList.class, new ApplicationReferenceAlarmList.InstanceCreator());
- remoteDataRegisterService.register(InstanceAlarm.class, new InstanceAlarm.InstanceCreator());
- remoteDataRegisterService.register(InstanceAlarmList.class, new InstanceAlarmList.InstanceCreator());
- remoteDataRegisterService.register(InstanceReferenceAlarm.class, new InstanceReferenceAlarm.InstanceCreator());
- remoteDataRegisterService.register(InstanceReferenceAlarmList.class, new InstanceReferenceAlarmList.InstanceCreator());
- remoteDataRegisterService.register(ServiceAlarm.class, new ServiceAlarm.InstanceCreator());
- remoteDataRegisterService.register(ServiceAlarmList.class, new ServiceAlarmList.InstanceCreator());
- remoteDataRegisterService.register(ServiceReferenceAlarm.class, new ServiceReferenceAlarm.InstanceCreator());
- remoteDataRegisterService.register(ServiceReferenceAlarmList.class, new ServiceReferenceAlarmList.InstanceCreator());
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorker.java
deleted file mode 100644
index 13a3bfd2b092347ae4d2d471e146b28ddd5b720d..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorker.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker;
-
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException;
-import org.apache.skywalking.apm.collector.core.data.StreamData;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.NumberFormatUtils;
-import org.apache.skywalking.apm.collector.storage.table.Metric;
-import org.apache.skywalking.apm.collector.storage.table.MetricSource;
-import org.apache.skywalking.apm.collector.storage.table.alarm.Alarm;
-import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class AlarmAssertWorker extends AbstractLocalAsyncWorker {
-
- private static final Logger logger = LoggerFactory.getLogger(AlarmAssertWorker.class);
-
- public AlarmAssertWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override protected final void onWork(INPUT inputMetric) throws WorkerException {
- errorRateAlarmAssert(inputMetric);
- averageResponseTimeAlarmAssert(inputMetric);
- }
-
- protected abstract OUTPUT newAlarmObject(String id, INPUT inputMetric);
-
- protected abstract void generateAlarmContent(OUTPUT alarm, double threshold);
-
- protected abstract Double calleeErrorRateThreshold();
-
- protected abstract Double callerErrorRateThreshold();
-
- private void errorRateAlarmAssert(INPUT inputMetric) {
- Double errorRate = Double.valueOf(inputMetric.getTransactionErrorCalls()) / Double.valueOf(inputMetric.getTransactionCalls());
- errorRate = NumberFormatUtils.rateNumberFormat(errorRate);
-
- if (inputMetric.getSourceValue().equals(MetricSource.Callee.getValue())) {
- if (errorRate >= calleeErrorRateThreshold()) {
- String id = String.valueOf(MetricSource.Callee.getValue()) + Const.ID_SPLIT + AlarmType.ERROR_RATE.getValue();
- OUTPUT alarm = newAlarmObject(id, inputMetric);
- alarm.setAlarmType(AlarmType.ERROR_RATE.getValue());
- alarm.setLastTimeBucket(inputMetric.getTimeBucket());
- alarm.setSourceValue(MetricSource.Callee.getValue());
- generateAlarmContent(alarm, calleeErrorRateThreshold());
-
- onNext(alarm);
- }
- } else if (inputMetric.getSourceValue().equals(MetricSource.Caller.getValue())) {
- if (errorRate >= callerErrorRateThreshold()) {
- String id = String.valueOf(MetricSource.Caller.getValue()) + Const.ID_SPLIT + AlarmType.ERROR_RATE.getValue();
- OUTPUT alarm = newAlarmObject(id, inputMetric);
- alarm.setAlarmType(AlarmType.ERROR_RATE.getValue());
- alarm.setLastTimeBucket(inputMetric.getTimeBucket());
- alarm.setSourceValue(MetricSource.Caller.getValue());
- generateAlarmContent(alarm, callerErrorRateThreshold());
-
- onNext(alarm);
- }
- } else {
- logger.error("Please check the metric source, the value must be {} or {}, but {}", MetricSource.Caller.getValue(), MetricSource.Callee.getValue(), inputMetric.getSourceValue());
- }
- }
-
- protected abstract Double calleeAverageResponseTimeThreshold();
-
- protected abstract Double callerAverageResponseTimeThreshold();
-
- private void averageResponseTimeAlarmAssert(INPUT inputMetric) {
- Long transactionSuccessDurationSum = inputMetric.getTransactionDurationSum() - inputMetric.getTransactionErrorDurationSum();
- Long transactionSuccessCalls = inputMetric.getTransactionCalls() - inputMetric.getTransactionErrorCalls();
- Double averageResponseTime = Double.valueOf(transactionSuccessDurationSum) / Double.valueOf(transactionSuccessCalls);
-
- if (inputMetric.getSourceValue().equals(MetricSource.Callee.getValue())) {
- if (averageResponseTime >= calleeAverageResponseTimeThreshold()) {
- String id = String.valueOf(MetricSource.Callee.getValue()) + Const.ID_SPLIT + AlarmType.SLOW_RTT.getValue();
- OUTPUT alarm = newAlarmObject(id, inputMetric);
- alarm.setAlarmType(AlarmType.SLOW_RTT.getValue());
- alarm.setLastTimeBucket(inputMetric.getTimeBucket());
- alarm.setSourceValue(MetricSource.Callee.getValue());
- generateAlarmContent(alarm, calleeAverageResponseTimeThreshold());
-
- onNext(alarm);
- }
- } else if (inputMetric.getSourceValue().equals(MetricSource.Caller.getValue())) {
- if (averageResponseTime >= callerAverageResponseTimeThreshold()) {
- String id = String.valueOf(MetricSource.Caller.getValue()) + Const.ID_SPLIT + AlarmType.SLOW_RTT.getValue();
- OUTPUT alarm = newAlarmObject(id, inputMetric);
- alarm.setAlarmType(AlarmType.SLOW_RTT.getValue());
- alarm.setLastTimeBucket(inputMetric.getTimeBucket());
- alarm.setSourceValue(MetricSource.Caller.getValue());
- generateAlarmContent(alarm, callerAverageResponseTimeThreshold());
-
- onNext(alarm);
- }
- } else {
- logger.error("Please check the metric source, the value must be {} or {}, but {}", MetricSource.Caller.getValue(), MetricSource.Callee.getValue(), inputMetric.getSourceValue());
- }
- }
-}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorkerProvider.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorkerProvider.java
deleted file mode 100644
index d954181469f440f8959f0554a16dc03ae17b8e40..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorkerProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker;
-
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider;
-import org.apache.skywalking.apm.collector.core.data.StreamData;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.table.Metric;
-import org.apache.skywalking.apm.collector.storage.table.alarm.Alarm;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class AlarmAssertWorkerProvider> extends AbstractLocalAsyncWorkerProvider {
-
- public AlarmAssertWorkerProvider(ModuleManager moduleManager) {
- super(moduleManager);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmAssertWorker.java
deleted file mode 100644
index c1c92c3d765daa901747f5674b0e74ff5f6ca3ae..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmAssertWorker.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider;
-import org.apache.skywalking.apm.collector.cache.CacheModule;
-import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
-import org.apache.skywalking.apm.collector.configuration.ConfigurationModule;
-import org.apache.skywalking.apm.collector.configuration.service.IApplicationAlarmRuleConfig;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.MetricSource;
-import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric;
-import org.apache.skywalking.apm.collector.storage.table.register.Application;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmAssertWorker extends AlarmAssertWorker {
-
- private final IApplicationAlarmRuleConfig applicationAlarmRuleConfig;
- private final ApplicationCacheService applicationCacheService;
-
- public ApplicationMetricAlarmAssertWorker(ModuleManager moduleManager) {
- super(moduleManager);
- this.applicationAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IApplicationAlarmRuleConfig.class);
- this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_ASSERT_WORKER_ID;
- }
-
- @Override protected ApplicationAlarm newAlarmObject(String id, ApplicationMetric inputMetric) {
- ApplicationAlarm applicationAlarm = new ApplicationAlarm();
- applicationAlarm.setId(id + Const.ID_SPLIT + inputMetric.getApplicationId());
- applicationAlarm.setApplicationId(inputMetric.getApplicationId());
- return applicationAlarm;
- }
-
- @Override protected void generateAlarmContent(ApplicationAlarm alarm, double threshold) {
- Application application = applicationCacheService.getApplicationById(alarm.getApplicationId());
-
- String clientOrServer = "server";
- if (MetricSource.Caller.getValue() == alarm.getSourceValue()) {
- clientOrServer = "client";
- }
-
- if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("The success rate of " + application.getApplicationCode() + ", detected from " + clientOrServer + " side, is lower than " + threshold + " rate.");
- } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("Response time of " + application.getApplicationCode() + ", detected from " + clientOrServer + " side, is slower than " + threshold + " ms.");
- }
- }
-
- @Override protected Double calleeErrorRateThreshold() {
- return applicationAlarmRuleConfig.calleeErrorRateThreshold();
- }
-
- @Override protected Double callerErrorRateThreshold() {
- return applicationAlarmRuleConfig.callerErrorRateThreshold();
- }
-
- @Override protected Double calleeAverageResponseTimeThreshold() {
- return applicationAlarmRuleConfig.calleeAverageResponseTimeThreshold();
- }
-
- @Override protected Double callerAverageResponseTimeThreshold() {
- return applicationAlarmRuleConfig.callerAverageResponseTimeThreshold();
- }
-
- public static class Factory extends AlarmAssertWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationMetricAlarmAssertWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmGraph.java
deleted file mode 100644
index 4963ad049f650f2de01a47bf0d3feb3cbfc48383..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmGraph.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.Graph;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.RemoteModule;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public ApplicationMetricAlarmGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
-
- Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.APPLICATION_METRIC_ALARM_GRAPH_ID, ApplicationMetric.class);
-
- graph.addNode(new ApplicationMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener))
- .addNext(new ApplicationMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.APPLICATION_METRIC_ALARM_GRAPH_ID).create(workerCreateListener))
- .addNext(new ApplicationMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- graph.toFinder().findNode(AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_REMOTE_WORKER_ID, ApplicationAlarm.class)
- .addNext(new ApplicationMetricAlarmToListNodeProcessor())
- .addNext(new ApplicationMetricAlarmListMinutePersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- graph.toFinder().findNode(AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MINUTE_PERSISTENCE_WORKER_ID, ApplicationAlarmList.class)
- .addNext(new ApplicationMetricAlarmListHourTransformNode())
- .addNext(new ApplicationMetricAlarmListHourPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- graph.toFinder().findNode(AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MINUTE_PERSISTENCE_WORKER_ID, ApplicationAlarmList.class)
- .addNext(new ApplicationMetricAlarmListDayTransformNode())
- .addNext(new ApplicationMetricAlarmListDayPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- graph.toFinder().findNode(AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MINUTE_PERSISTENCE_WORKER_ID, ApplicationAlarmList.class)
- .addNext(new ApplicationMetricAlarmListMonthTransformNode())
- .addNext(new ApplicationMetricAlarmListMonthPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- link(graph);
- }
-
- private void link(Graph graph) {
- GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.APPLICATION_METRIC_GRAPH_ID, ApplicationMetric.class)
- .toFinder().findNode(MetricWorkerIdDefine.APPLICATION_MINUTE_METRIC_PERSISTENCE_WORKER_ID, ApplicationMetric.class)
- .addNext(new NodeProcessor() {
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID;
- }
-
- @Override public void process(ApplicationMetric instanceMetric,
- Next next) {
- graph.start(instanceMetric);
- }
- });
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListCopy.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListCopy.java
deleted file mode 100644
index 95c7fb258352631260d0734036cc1b62dcda4745..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListCopy.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmListCopy {
-
- public static ApplicationAlarmList copy(ApplicationAlarmList applicationAlarmList) {
- ApplicationAlarmList newApplicationAlarmList = new ApplicationAlarmList();
- newApplicationAlarmList.setMetricId(applicationAlarmList.getMetricId());
-
- newApplicationAlarmList.setAlarmContent(applicationAlarmList.getAlarmContent());
- newApplicationAlarmList.setAlarmType(applicationAlarmList.getAlarmType());
- newApplicationAlarmList.setSourceValue(applicationAlarmList.getSourceValue());
- newApplicationAlarmList.setApplicationId(applicationAlarmList.getApplicationId());
- newApplicationAlarmList.setTimeBucket(newApplicationAlarmList.getTimeBucket());
- return newApplicationAlarmList;
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayPersistenceWorker.java
deleted file mode 100644
index f5b4e7e550da41344e45b2d4ff443282eb399107..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListDayPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmListDayPersistenceWorker extends MergePersistenceWorker {
-
- public ApplicationMetricAlarmListDayPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_DAY_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationAlarmList> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationAlarmListDayPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationMetricAlarmListDayPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationMetricAlarmListDayPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayTransformNode.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayTransformNode.java
deleted file mode 100644
index d79065b98ea0415652b8776d0f08464d1074a25c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayTransformNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmListDayTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_DAY_TRANSFORM_NODE_ID;
- }
-
- @Override
- public void process(ApplicationAlarmList applicationAlarmList, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(applicationAlarmList.getTimeBucket());
-
- ApplicationAlarmList newApplicationAlarmList = ApplicationMetricAlarmListCopy.copy(applicationAlarmList);
- newApplicationAlarmList.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationAlarmList.getMetricId());
- newApplicationAlarmList.setTimeBucket(timeBucket);
- next.execute(newApplicationAlarmList);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourPersistenceWorker.java
deleted file mode 100644
index 54af03d3114f20c5bce25bf915118c7f2007633a..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListHourPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmListHourPersistenceWorker extends MergePersistenceWorker {
-
- public ApplicationMetricAlarmListHourPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_HOUR_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationAlarmList> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationAlarmListHourPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationMetricAlarmListHourPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationMetricAlarmListHourPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourTransformNode.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourTransformNode.java
deleted file mode 100644
index 9d860904851df0512cefcead1e0af853f041d3e4..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourTransformNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmListHourTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_HOUR_TRANSFORM_NODE_ID;
- }
-
- @Override
- public void process(ApplicationAlarmList applicationAlarmList, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(applicationAlarmList.getTimeBucket());
-
- ApplicationAlarmList newApplicationAlarmList = ApplicationMetricAlarmListCopy.copy(applicationAlarmList);
- newApplicationAlarmList.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationAlarmList.getMetricId());
- newApplicationAlarmList.setTimeBucket(timeBucket);
- next.execute(newApplicationAlarmList);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMinutePersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMinutePersistenceWorker.java
deleted file mode 100644
index 7b82af3462c6ff16356381f0087b47c869071a17..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMinutePersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMinutePersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmListMinutePersistenceWorker extends MergePersistenceWorker {
-
- public ApplicationMetricAlarmListMinutePersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MINUTE_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationAlarmList> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationAlarmListMinutePersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationMetricAlarmListMinutePersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationMetricAlarmListMinutePersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthPersistenceWorker.java
deleted file mode 100644
index 9bdacd8becc53df5cb9c95a6bfaa30f36c440f8f..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMonthPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmListMonthPersistenceWorker extends MergePersistenceWorker {
-
- public ApplicationMetricAlarmListMonthPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MONTH_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationAlarmList> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationAlarmListMonthPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationMetricAlarmListMonthPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationMetricAlarmListMonthPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthTransformNode.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthTransformNode.java
deleted file mode 100644
index 9bfb204132326982b88961274f2247a92ade9c08..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthTransformNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmListMonthTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MONTH_TRANSFORM_NODE_ID;
- }
-
- @Override
- public void process(ApplicationAlarmList applicationAlarmList, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(applicationAlarmList.getTimeBucket());
-
- ApplicationAlarmList newApplicationAlarmList = ApplicationMetricAlarmListCopy.copy(applicationAlarmList);
- newApplicationAlarmList.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationAlarmList.getMetricId());
- newApplicationAlarmList.setTimeBucket(timeBucket);
- next.execute(newApplicationAlarmList);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmPersistenceWorker.java
deleted file mode 100644
index 294971986cc72c097247a7592f934745792330ab..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmPersistenceWorker extends MergePersistenceWorker {
-
- public ApplicationMetricAlarmPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationAlarm> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationAlarmPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationMetricAlarmPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmRemoteWorker.java
deleted file mode 100644
index 8bf49284be18a3cef2ef239c3031bd3e608b96d0..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmRemoteWorker.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.remote.service.Selector;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmRemoteWorker extends AbstractRemoteWorker {
-
- public ApplicationMetricAlarmRemoteWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_REMOTE_WORKER_ID;
- }
-
- @Override public Selector selector() {
- return Selector.HashCode;
- }
-
- @Override protected void onWork(ApplicationAlarm message) throws WorkerException {
- onNext(message);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
-
- public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) {
- super(moduleManager, remoteSenderService, graphId);
- }
-
- @Override public ApplicationMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationMetricAlarmRemoteWorker(moduleManager);
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmToListNodeProcessor.java
deleted file mode 100644
index de9e4a67f8401d9399064e6e443ccc8410d7455b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmToListNodeProcessor.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMetricAlarmToListNodeProcessor implements NodeProcessor {
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID;
- }
-
- @Override public void process(ApplicationAlarm applicationAlarm, Next next) {
- String metricId = applicationAlarm.getSourceValue()
- + Const.ID_SPLIT + applicationAlarm.getAlarmType()
- + Const.ID_SPLIT + applicationAlarm.getApplicationId();
-
- String id = applicationAlarm.getLastTimeBucket() + Const.ID_SPLIT + metricId;
-
- ApplicationAlarmList applicationAlarmList = new ApplicationAlarmList();
- applicationAlarmList.setId(id);
- applicationAlarmList.setMetricId(metricId);
- applicationAlarmList.setApplicationId(applicationAlarm.getApplicationId());
- applicationAlarmList.setSourceValue(applicationAlarm.getSourceValue());
- applicationAlarmList.setAlarmType(applicationAlarm.getAlarmType());
- applicationAlarmList.setTimeBucket(applicationAlarm.getLastTimeBucket());
- applicationAlarmList.setAlarmContent(applicationAlarm.getAlarmContent());
- next.execute(applicationAlarmList);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmAssertWorker.java
deleted file mode 100644
index efdefb0084e99944a5e17312448f0379a37054ce..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmAssertWorker.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider;
-import org.apache.skywalking.apm.collector.cache.CacheModule;
-import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
-import org.apache.skywalking.apm.collector.configuration.ConfigurationModule;
-import org.apache.skywalking.apm.collector.configuration.service.IApplicationReferenceAlarmRuleConfig;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.MetricSource;
-import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric;
-import org.apache.skywalking.apm.collector.storage.table.register.Application;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationReferenceMetricAlarmAssertWorker extends AlarmAssertWorker {
-
- private final ApplicationCacheService applicationCacheService;
- private final IApplicationReferenceAlarmRuleConfig applicationReferenceAlarmRuleConfig;
-
- public ApplicationReferenceMetricAlarmAssertWorker(ModuleManager moduleManager) {
- super(moduleManager);
- this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class);
- this.applicationReferenceAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IApplicationReferenceAlarmRuleConfig.class);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID;
- }
-
- @Override protected ApplicationReferenceAlarm newAlarmObject(String id, ApplicationReferenceMetric inputMetric) {
- ApplicationReferenceAlarm applicationReferenceAlarm = new ApplicationReferenceAlarm();
- applicationReferenceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getFrontApplicationId() + Const.ID_SPLIT + inputMetric.getBehindApplicationId());
- applicationReferenceAlarm.setFrontApplicationId(inputMetric.getFrontApplicationId());
- applicationReferenceAlarm.setBehindApplicationId(inputMetric.getBehindApplicationId());
- return applicationReferenceAlarm;
- }
-
- @Override protected void generateAlarmContent(ApplicationReferenceAlarm alarm, double threshold) {
- Application application = applicationCacheService.getApplicationById(alarm.getBehindApplicationId());
-
- String clientOrServer = "server";
- if (MetricSource.Caller.getValue() == alarm.getSourceValue()) {
- clientOrServer = "client";
- }
-
- if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("The success rate of " + application.getApplicationCode() + ", detected from " + clientOrServer + " side, is lower than " + threshold + " rate.");
- } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("Response time of " + application.getApplicationCode() + ", detected from " + clientOrServer + " side, is slower than " + threshold + " ms.");
- }
- }
-
- @Override protected Double calleeErrorRateThreshold() {
- return applicationReferenceAlarmRuleConfig.calleeErrorRateThreshold();
- }
-
- @Override protected Double callerErrorRateThreshold() {
- return applicationReferenceAlarmRuleConfig.callerErrorRateThreshold();
- }
-
- @Override protected Double calleeAverageResponseTimeThreshold() {
- return applicationReferenceAlarmRuleConfig.calleeAverageResponseTimeThreshold();
- }
-
- @Override protected Double callerAverageResponseTimeThreshold() {
- return applicationReferenceAlarmRuleConfig.callerAverageResponseTimeThreshold();
- }
-
- public static class Factory extends AlarmAssertWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationReferenceMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationReferenceMetricAlarmAssertWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmGraph.java
deleted file mode 100644
index 121aed10a31a4b7de2ffb8806f4876016d4bd610..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmGraph.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.Graph;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.RemoteModule;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationReferenceMetricAlarmGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public ApplicationReferenceMetricAlarmGraph(ModuleManager moduleManager,
- WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
-
- Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_ID, ApplicationReferenceMetric.class);
-
- graph.addNode(new ApplicationReferenceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener))
- .addNext(new ApplicationReferenceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener))
- .addNext(new ApplicationReferenceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- graph.toFinder().findNode(AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID, ApplicationReferenceAlarm.class)
- .addNext(new ApplicationReferenceMetricAlarmToListNodeProcessor())
- .addNext(new ApplicationReferenceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- link(graph);
- }
-
- private void link(Graph graph) {
- GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.APPLICATION_REFERENCE_METRIC_GRAPH_ID, ApplicationReferenceMetric.class)
- .toFinder().findNode(MetricWorkerIdDefine.APPLICATION_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID, ApplicationReferenceMetric.class)
- .addNext(new NodeProcessor() {
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID;
- }
-
- @Override public void process(ApplicationReferenceMetric applicationReferenceMetric,
- Next next) {
- graph.start(applicationReferenceMetric);
- }
- });
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmListPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmListPersistenceWorker.java
deleted file mode 100644
index a13d035cab57ad3cc1a164c097b0c3d660d2781c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmListPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmListPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationReferenceMetricAlarmListPersistenceWorker extends MergePersistenceWorker {
-
- public ApplicationReferenceMetricAlarmListPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationReferenceAlarmList> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationReferenceAlarmListPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override
- public ApplicationReferenceMetricAlarmListPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationReferenceMetricAlarmListPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmPersistenceWorker.java
deleted file mode 100644
index 875878274702b553c71d2062ea7e87fadb46a603..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationReferenceMetricAlarmPersistenceWorker extends MergePersistenceWorker {
-
- public ApplicationReferenceMetricAlarmPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationReferenceAlarm> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationReferenceAlarmPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationReferenceMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationReferenceMetricAlarmPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmRemoteWorker.java
deleted file mode 100644
index f52cfc74a345ca0c57b0d66d5fb1b3eaa4712aa5..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmRemoteWorker.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.remote.service.Selector;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationReferenceMetricAlarmRemoteWorker extends AbstractRemoteWorker {
-
- public ApplicationReferenceMetricAlarmRemoteWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID;
- }
-
- @Override public Selector selector() {
- return Selector.HashCode;
- }
-
- @Override protected void onWork(ApplicationReferenceAlarm message) throws WorkerException {
- onNext(message);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
-
- public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) {
- super(moduleManager, remoteSenderService, graphId);
- }
-
- @Override public ApplicationReferenceMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationReferenceMetricAlarmRemoteWorker(moduleManager);
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmToListNodeProcessor.java
deleted file mode 100644
index de4874adb54170c73aed7f2baad2ff47538c9b1c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmToListNodeProcessor.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationReferenceMetricAlarmToListNodeProcessor implements NodeProcessor {
-
- @Override public int id() {
- return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID;
- }
-
- @Override
- public void process(ApplicationReferenceAlarm applicationReferenceAlarm, Next next) {
- String id = applicationReferenceAlarm.getLastTimeBucket() + Const.ID_SPLIT + applicationReferenceAlarm.getSourceValue()
- + Const.ID_SPLIT + applicationReferenceAlarm.getAlarmType()
- + Const.ID_SPLIT + applicationReferenceAlarm.getFrontApplicationId()
- + Const.ID_SPLIT + applicationReferenceAlarm.getBehindApplicationId();
-
- ApplicationReferenceAlarmList applicationReferenceAlarmList = new ApplicationReferenceAlarmList();
- applicationReferenceAlarmList.setId(id);
- applicationReferenceAlarmList.setFrontApplicationId(applicationReferenceAlarm.getFrontApplicationId());
- applicationReferenceAlarmList.setBehindApplicationId(applicationReferenceAlarm.getBehindApplicationId());
- applicationReferenceAlarmList.setSourceValue(applicationReferenceAlarm.getSourceValue());
- applicationReferenceAlarmList.setAlarmType(applicationReferenceAlarm.getAlarmType());
- applicationReferenceAlarmList.setTimeBucket(applicationReferenceAlarm.getLastTimeBucket());
- applicationReferenceAlarmList.setAlarmContent(applicationReferenceAlarm.getAlarmContent());
- next.execute(applicationReferenceAlarmList);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmAssertWorker.java
deleted file mode 100644
index c6cd3993218562f5b3df49fbda03f04db30bf8e1..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmAssertWorker.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider;
-import org.apache.skywalking.apm.collector.configuration.ConfigurationModule;
-import org.apache.skywalking.apm.collector.configuration.service.IInstanceAlarmRuleConfig;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO;
-import org.apache.skywalking.apm.collector.storage.table.MetricSource;
-import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric;
-import org.apache.skywalking.apm.collector.storage.table.register.Instance;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceMetricAlarmAssertWorker extends AlarmAssertWorker {
-
- private final Gson gson = new Gson();
- private final IInstanceUIDAO instanceDAO;
- private final IInstanceAlarmRuleConfig instanceAlarmRuleConfig;
-
- public InstanceMetricAlarmAssertWorker(ModuleManager moduleManager) {
- super(moduleManager);
- this.instanceDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceUIDAO.class);
- this.instanceAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IInstanceAlarmRuleConfig.class);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_ASSERT_WORKER_ID;
- }
-
- @Override protected InstanceAlarm newAlarmObject(String id, InstanceMetric inputMetric) {
- InstanceAlarm instanceAlarm = new InstanceAlarm();
- instanceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getInstanceId());
- instanceAlarm.setApplicationId(inputMetric.getApplicationId());
- instanceAlarm.setInstanceId(inputMetric.getInstanceId());
- return instanceAlarm;
- }
-
- @Override protected void generateAlarmContent(InstanceAlarm alarm, double threshold) {
- Instance instance = instanceDAO.getInstance(alarm.getInstanceId());
- JsonObject osInfo = gson.fromJson(instance.getOsInfo(), JsonObject.class);
- String serverName = Const.UNKNOWN;
- if (osInfo != null && osInfo.has("hostName")) {
- serverName = osInfo.get("hostName").getAsString();
- }
-
- String clientOrServer = "server";
- if (MetricSource.Caller.getValue() == alarm.getSourceValue()) {
- clientOrServer = "client";
- }
-
- if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("The success rate of " + serverName + ", detected from " + clientOrServer + " side, is lower than " + threshold + " rate.");
- } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("Response time of " + serverName + ", detected from " + clientOrServer + " side, is slower than " + threshold + " ms.");
- }
- }
-
- @Override protected Double calleeErrorRateThreshold() {
- return instanceAlarmRuleConfig.calleeErrorRateThreshold();
- }
-
- @Override protected Double callerErrorRateThreshold() {
- return instanceAlarmRuleConfig.callerErrorRateThreshold();
- }
-
- @Override protected Double calleeAverageResponseTimeThreshold() {
- return instanceAlarmRuleConfig.calleeAverageResponseTimeThreshold();
- }
-
- @Override protected Double callerAverageResponseTimeThreshold() {
- return instanceAlarmRuleConfig.callerAverageResponseTimeThreshold();
- }
-
- public static class Factory extends AlarmAssertWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public InstanceMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) {
- return new InstanceMetricAlarmAssertWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmGraph.java
deleted file mode 100644
index 5954314bb904af7c3e88e2d4848b3e74675d6148..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmGraph.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.Graph;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.RemoteModule;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceMetricAlarmGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public InstanceMetricAlarmGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
-
- Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.INSTANCE_METRIC_ALARM_GRAPH_ID, InstanceMetric.class);
-
- graph.addNode(new InstanceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener))
- .addNext(new InstanceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.INSTANCE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener))
- .addNext(new InstanceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- graph.toFinder().findNode(AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_REMOTE_WORKER_ID, InstanceAlarm.class)
- .addNext(new InstanceMetricAlarmToListNodeProcessor())
- .addNext(new InstanceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- link(graph);
- }
-
- private void link(Graph graph) {
- GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.INSTANCE_METRIC_GRAPH_ID, InstanceMetric.class)
- .toFinder().findNode(MetricWorkerIdDefine.INSTANCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID, InstanceMetric.class)
- .addNext(new NodeProcessor() {
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID;
- }
-
- @Override public void process(InstanceMetric instanceMetric,
- Next next) {
- graph.start(instanceMetric);
- }
- });
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmListPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmListPersistenceWorker.java
deleted file mode 100644
index 921647093147ae786c5b4371b37f111976677b6b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmListPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmListPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceMetricAlarmListPersistenceWorker extends MergePersistenceWorker {
-
- public InstanceMetricAlarmListPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, InstanceAlarmList> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IInstanceAlarmListPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public InstanceMetricAlarmListPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new InstanceMetricAlarmListPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmPersistenceWorker.java
deleted file mode 100644
index b97cad8e6bf6531b6487bfe44ee3af8a4dd708c8..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceMetricAlarmPersistenceWorker extends MergePersistenceWorker {
-
- public InstanceMetricAlarmPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, InstanceAlarm> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IInstanceAlarmPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public InstanceMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new InstanceMetricAlarmPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmRemoteWorker.java
deleted file mode 100644
index 0edad65d658cebd06cba10dbed403b0d60971da8..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmRemoteWorker.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.remote.service.Selector;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceMetricAlarmRemoteWorker extends AbstractRemoteWorker {
-
- public InstanceMetricAlarmRemoteWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_REMOTE_WORKER_ID;
- }
-
- @Override public Selector selector() {
- return Selector.HashCode;
- }
-
- @Override protected void onWork(InstanceAlarm message) throws WorkerException {
- onNext(message);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
-
- public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) {
- super(moduleManager, remoteSenderService, graphId);
- }
-
- @Override public InstanceMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) {
- return new InstanceMetricAlarmRemoteWorker(moduleManager);
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmToListNodeProcessor.java
deleted file mode 100644
index 463a64e7d89558d14d018be66e287085f518d7b8..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmToListNodeProcessor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceMetricAlarmToListNodeProcessor implements NodeProcessor {
-
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID;
- }
-
- @Override public void process(InstanceAlarm instanceAlarm, Next next) {
- String id = instanceAlarm.getLastTimeBucket() + Const.ID_SPLIT + instanceAlarm.getSourceValue()
- + Const.ID_SPLIT + instanceAlarm.getAlarmType()
- + Const.ID_SPLIT + instanceAlarm.getInstanceId();
-
- InstanceAlarmList instanceAlarmList = new InstanceAlarmList();
- instanceAlarmList.setId(id);
- instanceAlarmList.setApplicationId(instanceAlarm.getApplicationId());
- instanceAlarmList.setInstanceId(instanceAlarm.getInstanceId());
- instanceAlarmList.setSourceValue(instanceAlarm.getSourceValue());
- instanceAlarmList.setAlarmType(instanceAlarm.getAlarmType());
- instanceAlarmList.setTimeBucket(instanceAlarm.getLastTimeBucket());
- instanceAlarmList.setAlarmContent(instanceAlarm.getAlarmContent());
- next.execute(instanceAlarmList);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmAssertWorker.java
deleted file mode 100644
index 9f5ffc389c7e3ed76ba9f736e0800b112c0ac735..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmAssertWorker.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider;
-import org.apache.skywalking.apm.collector.configuration.ConfigurationModule;
-import org.apache.skywalking.apm.collector.configuration.service.IInstanceReferenceAlarmRuleConfig;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO;
-import org.apache.skywalking.apm.collector.storage.table.MetricSource;
-import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric;
-import org.apache.skywalking.apm.collector.storage.table.register.Instance;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceReferenceMetricAlarmAssertWorker extends AlarmAssertWorker {
-
- private Gson gson = new Gson();
- private final IInstanceUIDAO instanceDAO;
- private final IInstanceReferenceAlarmRuleConfig instanceReferenceAlarmRuleConfig;
-
- public InstanceReferenceMetricAlarmAssertWorker(ModuleManager moduleManager) {
- super(moduleManager);
- this.instanceDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceUIDAO.class);
- this.instanceReferenceAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IInstanceReferenceAlarmRuleConfig.class);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID;
- }
-
- @Override protected InstanceReferenceAlarm newAlarmObject(String id, InstanceReferenceMetric inputMetric) {
- InstanceReferenceAlarm instanceReferenceAlarm = new InstanceReferenceAlarm();
- instanceReferenceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getFrontInstanceId() + Const.ID_SPLIT + inputMetric.getBehindInstanceId());
- instanceReferenceAlarm.setFrontApplicationId(inputMetric.getFrontApplicationId());
- instanceReferenceAlarm.setBehindApplicationId(inputMetric.getBehindApplicationId());
- instanceReferenceAlarm.setFrontInstanceId(inputMetric.getFrontInstanceId());
- instanceReferenceAlarm.setBehindInstanceId(inputMetric.getBehindInstanceId());
- return instanceReferenceAlarm;
- }
-
- @Override protected void generateAlarmContent(InstanceReferenceAlarm alarm, double threshold) {
- Instance instance = instanceDAO.getInstance(alarm.getBehindInstanceId());
- JsonObject osInfo = gson.fromJson(instance.getOsInfo(), JsonObject.class);
- String serverName = Const.UNKNOWN;
- if (osInfo != null && osInfo.has("hostName")) {
- serverName = osInfo.get("hostName").getAsString();
- }
-
- String clientOrServer = "server";
- if (MetricSource.Caller.getValue() == alarm.getSourceValue()) {
- clientOrServer = "client";
- }
-
- if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("The success rate of " + serverName + ", detected from " + clientOrServer + " side, is lower than " + threshold + ".");
- } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("Response time of " + serverName + ", detected from " + clientOrServer + " side, is slower than " + threshold + ".");
- }
- }
-
- @Override protected Double calleeErrorRateThreshold() {
- return instanceReferenceAlarmRuleConfig.calleeErrorRateThreshold();
- }
-
- @Override protected Double callerErrorRateThreshold() {
- return instanceReferenceAlarmRuleConfig.callerErrorRateThreshold();
- }
-
- @Override protected Double calleeAverageResponseTimeThreshold() {
- return instanceReferenceAlarmRuleConfig.calleeAverageResponseTimeThreshold();
- }
-
- @Override protected Double callerAverageResponseTimeThreshold() {
- return instanceReferenceAlarmRuleConfig.callerAverageResponseTimeThreshold();
- }
-
- public static class Factory extends AlarmAssertWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public InstanceReferenceMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) {
- return new InstanceReferenceMetricAlarmAssertWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmGraph.java
deleted file mode 100644
index 7ef12e1a68f813cedb96133a2220cd5ddd14228e..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmGraph.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.Graph;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.RemoteModule;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceReferenceMetricAlarmGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public InstanceReferenceMetricAlarmGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
-
- Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_GRAPH_ID, InstanceReferenceMetric.class);
-
- graph.addNode(new InstanceReferenceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener))
- .addNext(new InstanceReferenceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener))
- .addNext(new InstanceReferenceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- graph.toFinder().findNode(AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID, InstanceReferenceAlarm.class)
- .addNext(new InstanceReferenceMetricAlarmToListNodeProcessor())
- .addNext(new InstanceReferenceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- link(graph);
- }
-
- private void link(Graph graph) {
- GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.INSTANCE_REFERENCE_METRIC_GRAPH_ID, InstanceReferenceMetric.class)
- .toFinder().findNode(MetricWorkerIdDefine.INSTANCE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID, InstanceReferenceMetric.class)
- .addNext(new NodeProcessor() {
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID;
- }
-
- @Override public void process(InstanceReferenceMetric instanceReferenceMetric,
- Next next) {
- graph.start(instanceReferenceMetric);
- }
- });
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmListPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmListPersistenceWorker.java
deleted file mode 100644
index 53f84fd5308aa6afb614e98ab444245a797e186b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmListPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmListPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceReferenceMetricAlarmListPersistenceWorker extends MergePersistenceWorker {
-
- public InstanceReferenceMetricAlarmListPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, InstanceReferenceAlarmList> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IInstanceReferenceAlarmListPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public InstanceReferenceMetricAlarmListPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new InstanceReferenceMetricAlarmListPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmPersistenceWorker.java
deleted file mode 100644
index f91b868e1e34b33e81543acaeba40832b414463d..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceReferenceMetricAlarmPersistenceWorker extends MergePersistenceWorker {
-
- public InstanceReferenceMetricAlarmPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, InstanceReferenceAlarm> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IInstanceReferenceAlarmPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public InstanceReferenceMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new InstanceReferenceMetricAlarmPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmRemoteWorker.java
deleted file mode 100644
index 24840ec79782945cb3651bc9684adabb60f1f11c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmRemoteWorker.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.remote.service.Selector;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceReferenceMetricAlarmRemoteWorker extends AbstractRemoteWorker {
-
- public InstanceReferenceMetricAlarmRemoteWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID;
- }
-
- @Override public Selector selector() {
- return Selector.HashCode;
- }
-
- @Override protected void onWork(InstanceReferenceAlarm message) throws WorkerException {
- onNext(message);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
-
- public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) {
- super(moduleManager, remoteSenderService, graphId);
- }
-
- @Override public InstanceReferenceMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) {
- return new InstanceReferenceMetricAlarmRemoteWorker(moduleManager);
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmToListNodeProcessor.java
deleted file mode 100644
index 553ddebe2f4ac77ca37086e4566f772d10406241..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmToListNodeProcessor.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceReferenceMetricAlarmToListNodeProcessor implements NodeProcessor {
-
- @Override public int id() {
- return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID;
- }
-
- @Override
- public void process(InstanceReferenceAlarm instanceReferenceAlarm, Next next) {
- String id = instanceReferenceAlarm.getLastTimeBucket() + Const.ID_SPLIT + instanceReferenceAlarm.getSourceValue()
- + Const.ID_SPLIT + instanceReferenceAlarm.getAlarmType()
- + Const.ID_SPLIT + instanceReferenceAlarm.getFrontInstanceId()
- + Const.ID_SPLIT + instanceReferenceAlarm.getBehindInstanceId();
-
- InstanceReferenceAlarmList instanceReferenceAlarmList = new InstanceReferenceAlarmList();
- instanceReferenceAlarmList.setId(id);
- instanceReferenceAlarmList.setFrontApplicationId(instanceReferenceAlarm.getFrontApplicationId());
- instanceReferenceAlarmList.setBehindApplicationId(instanceReferenceAlarm.getBehindApplicationId());
- instanceReferenceAlarmList.setFrontInstanceId(instanceReferenceAlarm.getFrontInstanceId());
- instanceReferenceAlarmList.setBehindInstanceId(instanceReferenceAlarm.getBehindInstanceId());
- instanceReferenceAlarmList.setSourceValue(instanceReferenceAlarm.getSourceValue());
- instanceReferenceAlarmList.setAlarmType(instanceReferenceAlarm.getAlarmType());
- instanceReferenceAlarmList.setTimeBucket(instanceReferenceAlarm.getLastTimeBucket());
- instanceReferenceAlarmList.setAlarmContent(instanceReferenceAlarm.getAlarmContent());
- next.execute(instanceReferenceAlarmList);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmAssertWorker.java
deleted file mode 100644
index e5680d9647c3e7f74b4ebc384b2b0c6dc87ead84..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmAssertWorker.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider;
-import org.apache.skywalking.apm.collector.cache.CacheModule;
-import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService;
-import org.apache.skywalking.apm.collector.configuration.ConfigurationModule;
-import org.apache.skywalking.apm.collector.configuration.service.IServiceAlarmRuleConfig;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.MetricSource;
-import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.register.ServiceName;
-import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceMetricAlarmAssertWorker extends AlarmAssertWorker {
-
- private final ServiceNameCacheService serviceNameCacheService;
- private final IServiceAlarmRuleConfig serviceAlarmRuleConfig;
-
- public ServiceMetricAlarmAssertWorker(ModuleManager moduleManager) {
- super(moduleManager);
- this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class);
- this.serviceAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IServiceAlarmRuleConfig.class);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_ASSERT_WORKER_ID;
- }
-
- @Override protected ServiceAlarm newAlarmObject(String id, ServiceMetric inputMetric) {
- ServiceAlarm serviceAlarm = new ServiceAlarm();
- serviceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getServiceId());
- serviceAlarm.setApplicationId(inputMetric.getApplicationId());
- serviceAlarm.setInstanceId(inputMetric.getInstanceId());
- serviceAlarm.setServiceId(inputMetric.getServiceId());
- return serviceAlarm;
- }
-
- @Override protected void generateAlarmContent(ServiceAlarm alarm, double threshold) {
- ServiceName serviceName = serviceNameCacheService.get(alarm.getServiceId());
-
- String clientOrServer = "server";
- if (MetricSource.Caller.getValue() == alarm.getSourceValue()) {
- clientOrServer = "client";
- }
-
- if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("The success rate of " + serviceName.getServiceName() + ", detected from " + clientOrServer + " side, is lower than " + threshold + " rate.");
- } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("Response time of " + serviceName.getServiceName() + ", detected from " + clientOrServer + " side, is slower than " + threshold + " ms.");
- }
- }
-
- @Override protected Double calleeErrorRateThreshold() {
- return serviceAlarmRuleConfig.calleeErrorRateThreshold();
- }
-
- @Override protected Double callerErrorRateThreshold() {
- return serviceAlarmRuleConfig.callerErrorRateThreshold();
- }
-
- @Override protected Double calleeAverageResponseTimeThreshold() {
- return serviceAlarmRuleConfig.calleeAverageResponseTimeThreshold();
- }
-
- @Override protected Double callerAverageResponseTimeThreshold() {
- return serviceAlarmRuleConfig.callerAverageResponseTimeThreshold();
- }
-
- public static class Factory extends AlarmAssertWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ServiceMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) {
- return new ServiceMetricAlarmAssertWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmGraph.java
deleted file mode 100644
index 18d87ad6dcdf620476e91d068ae1a1faa0aa424b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmGraph.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.Graph;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.RemoteModule;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceMetricAlarmGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public ServiceMetricAlarmGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
-
- Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.SERVICE_METRIC_ALARM_GRAPH_ID, ServiceMetric.class);
-
- graph.addNode(new ServiceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener))
- .addNext(new ServiceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.SERVICE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener))
- .addNext(new ServiceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- graph.toFinder().findNode(AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_REMOTE_WORKER_ID, ServiceAlarm.class)
- .addNext(new ServiceMetricAlarmToListNodeProcessor())
- .addNext(new ServiceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- link(graph);
- }
-
- private void link(Graph graph) {
- GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SERVICE_METRIC_GRAPH_ID, ServiceMetric.class)
- .toFinder().findNode(MetricWorkerIdDefine.SERVICE_MINUTE_METRIC_PERSISTENCE_WORKER_ID, ServiceMetric.class)
- .addNext(new NodeProcessor() {
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID;
- }
-
- @Override public void process(ServiceMetric serviceMetric,
- Next next) {
- graph.start(serviceMetric);
- }
- });
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmListPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmListPersistenceWorker.java
deleted file mode 100644
index 4d1339678ba56012b7de58b375ff3864da4bb70a..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmListPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmListPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceMetricAlarmListPersistenceWorker extends MergePersistenceWorker {
-
- public ServiceMetricAlarmListPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ServiceAlarmList> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IServiceAlarmListPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ServiceMetricAlarmListPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ServiceMetricAlarmListPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmPersistenceWorker.java
deleted file mode 100644
index ea83f68cce33cec4be83a4b3cb9efa8c327fc014..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceMetricAlarmPersistenceWorker extends MergePersistenceWorker {
-
- public ServiceMetricAlarmPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ServiceAlarm> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IServiceAlarmPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ServiceMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ServiceMetricAlarmPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmRemoteWorker.java
deleted file mode 100644
index 538dd7553f20832f7b666384a74f4613cd70158b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmRemoteWorker.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.remote.service.Selector;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceMetricAlarmRemoteWorker extends AbstractRemoteWorker {
-
- public ServiceMetricAlarmRemoteWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_REMOTE_WORKER_ID;
- }
-
- @Override public Selector selector() {
- return Selector.HashCode;
- }
-
- @Override protected void onWork(ServiceAlarm message) throws WorkerException {
- onNext(message);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
-
- public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) {
- super(moduleManager, remoteSenderService, graphId);
- }
-
- @Override public ServiceMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) {
- return new ServiceMetricAlarmRemoteWorker(moduleManager);
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmToListNodeProcessor.java
deleted file mode 100644
index ab0d6a8022e3f95cf24322966cb4501c2b20d45e..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmToListNodeProcessor.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceMetricAlarmToListNodeProcessor implements NodeProcessor {
-
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID;
- }
-
- @Override public void process(ServiceAlarm serviceAlarm, Next next) {
- String id = serviceAlarm.getLastTimeBucket() + Const.ID_SPLIT + serviceAlarm.getSourceValue()
- + Const.ID_SPLIT + serviceAlarm.getAlarmType()
- + Const.ID_SPLIT + serviceAlarm.getServiceId();
-
- ServiceAlarmList serviceAlarmList = new ServiceAlarmList();
- serviceAlarmList.setId(id);
- serviceAlarmList.setApplicationId(serviceAlarm.getApplicationId());
- serviceAlarmList.setInstanceId(serviceAlarm.getInstanceId());
- serviceAlarmList.setServiceId(serviceAlarm.getServiceId());
- serviceAlarmList.setSourceValue(serviceAlarm.getSourceValue());
- serviceAlarmList.setAlarmType(serviceAlarm.getAlarmType());
- serviceAlarmList.setTimeBucket(serviceAlarm.getLastTimeBucket());
- serviceAlarmList.setAlarmContent(serviceAlarm.getAlarmContent());
- next.execute(serviceAlarmList);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmAssertWorker.java
deleted file mode 100644
index a454b6a530ffd94a5ebba67d053083c70adde390..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmAssertWorker.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker;
-import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider;
-import org.apache.skywalking.apm.collector.cache.CacheModule;
-import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService;
-import org.apache.skywalking.apm.collector.configuration.ConfigurationModule;
-import org.apache.skywalking.apm.collector.configuration.service.IServiceReferenceAlarmRuleConfig;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.MetricSource;
-import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.register.ServiceName;
-import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceMetricAlarmAssertWorker extends AlarmAssertWorker {
-
- private final ServiceNameCacheService serviceNameCacheService;
- private final IServiceReferenceAlarmRuleConfig serviceReferenceAlarmRuleConfig;
-
- ServiceReferenceMetricAlarmAssertWorker(ModuleManager moduleManager) {
- super(moduleManager);
- this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class);
- this.serviceReferenceAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IServiceReferenceAlarmRuleConfig.class);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID;
- }
-
- @Override protected ServiceReferenceAlarm newAlarmObject(String id, ServiceReferenceMetric inputMetric) {
- ServiceReferenceAlarm serviceReferenceAlarm = new ServiceReferenceAlarm();
- serviceReferenceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getFrontServiceId() + Const.ID_SPLIT + inputMetric.getBehindServiceId());
- serviceReferenceAlarm.setFrontApplicationId(inputMetric.getFrontApplicationId());
- serviceReferenceAlarm.setBehindApplicationId(inputMetric.getBehindApplicationId());
- serviceReferenceAlarm.setFrontInstanceId(inputMetric.getFrontInstanceId());
- serviceReferenceAlarm.setBehindInstanceId(inputMetric.getBehindInstanceId());
- serviceReferenceAlarm.setFrontServiceId(inputMetric.getFrontServiceId());
- serviceReferenceAlarm.setBehindServiceId(inputMetric.getBehindServiceId());
- return serviceReferenceAlarm;
- }
-
- @Override protected void generateAlarmContent(ServiceReferenceAlarm alarm, double threshold) {
- ServiceName serviceName = serviceNameCacheService.get(alarm.getBehindServiceId());
-
- String clientOrServer = "server";
- if (MetricSource.Caller.getValue() == alarm.getSourceValue()) {
- clientOrServer = "client";
- }
-
- if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("The success rate of " + serviceName.getServiceName() + ", detected from " + clientOrServer + " side, is lower than " + threshold + " rate.");
- } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) {
- alarm.setAlarmContent("Response time of " + serviceName.getServiceName() + ", detected from " + clientOrServer + " side, is slower than " + threshold + " ms.");
- }
- }
-
- @Override protected Double calleeErrorRateThreshold() {
- return serviceReferenceAlarmRuleConfig.calleeErrorRateThreshold();
- }
-
- @Override protected Double callerErrorRateThreshold() {
- return serviceReferenceAlarmRuleConfig.callerErrorRateThreshold();
- }
-
- @Override protected Double calleeAverageResponseTimeThreshold() {
- return serviceReferenceAlarmRuleConfig.calleeAverageResponseTimeThreshold();
- }
-
- @Override protected Double callerAverageResponseTimeThreshold() {
- return serviceReferenceAlarmRuleConfig.callerAverageResponseTimeThreshold();
- }
-
- public static class Factory extends AlarmAssertWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ServiceReferenceMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) {
- return new ServiceReferenceMetricAlarmAssertWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmGraph.java
deleted file mode 100644
index eda88d4309023505f1f69ca2a2a32b016782aa62..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmGraph.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.Graph;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.RemoteModule;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceMetricAlarmGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public ServiceReferenceMetricAlarmGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
-
- Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.SERVICE_REFERENCE_METRIC_ALARM_GRAPH_ID, ServiceReferenceMetric.class);
-
- graph.addNode(new ServiceReferenceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener))
- .addNext(new ServiceReferenceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.SERVICE_REFERENCE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener))
- .addNext(new ServiceReferenceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- graph.toFinder().findNode(AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID, ServiceReferenceAlarm.class)
- .addNext(new ServiceReferenceMetricAlarmToListNodeProcessor())
- .addNext(new ServiceReferenceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- link(graph);
- }
-
- private void link(Graph graph) {
- GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SERVICE_REFERENCE_METRIC_GRAPH_ID, ServiceReferenceMetric.class)
- .toFinder().findNode(MetricWorkerIdDefine.SERVICE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID, ServiceReferenceMetric.class)
- .addNext(new NodeProcessor() {
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID;
- }
-
- @Override public void process(ServiceReferenceMetric serviceReferenceMetric,
- Next next) {
- graph.start(serviceReferenceMetric);
- }
- });
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmListPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmListPersistenceWorker.java
deleted file mode 100644
index 0957f53bce517f7c858d9f7dd66eafc3f2c2cc76..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmListPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmListPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceMetricAlarmListPersistenceWorker extends MergePersistenceWorker {
-
- public ServiceReferenceMetricAlarmListPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ServiceReferenceAlarmList> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IServiceReferenceAlarmListPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ServiceReferenceMetricAlarmListPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ServiceReferenceMetricAlarmListPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmPersistenceWorker.java
deleted file mode 100644
index 2273485a92277b2bc9b74c4b962934f86e3eb7c9..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceMetricAlarmPersistenceWorker extends MergePersistenceWorker {
-
- public ServiceReferenceMetricAlarmPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ServiceReferenceAlarm> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IServiceReferenceAlarmPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ServiceReferenceMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ServiceReferenceMetricAlarmPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmRemoteWorker.java
deleted file mode 100644
index 7914d8b1254d0e7490b77cd751b997672c0b9502..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmRemoteWorker.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.remote.service.Selector;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceMetricAlarmRemoteWorker extends AbstractRemoteWorker {
-
- public ServiceReferenceMetricAlarmRemoteWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID;
- }
-
- @Override public Selector selector() {
- return Selector.HashCode;
- }
-
- @Override protected void onWork(ServiceReferenceAlarm message) throws WorkerException {
- onNext(message);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
-
- public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) {
- super(moduleManager, remoteSenderService, graphId);
- }
-
- @Override public ServiceReferenceMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) {
- return new ServiceReferenceMetricAlarmRemoteWorker(moduleManager);
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmToListNodeProcessor.java
deleted file mode 100644
index 2d1fb048a4d39c5996fbf67bf30e221ba4ea2060..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmToListNodeProcessor.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service;
-
-import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm;
-import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmList;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceMetricAlarmToListNodeProcessor implements NodeProcessor {
-
- @Override public int id() {
- return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID;
- }
-
- @Override public void process(ServiceReferenceAlarm serviceReferenceAlarm, Next next) {
- String id = serviceReferenceAlarm.getLastTimeBucket() + Const.ID_SPLIT + serviceReferenceAlarm.getSourceValue()
- + Const.ID_SPLIT + serviceReferenceAlarm.getAlarmType()
- + Const.ID_SPLIT + serviceReferenceAlarm.getFrontServiceId()
- + Const.ID_SPLIT + serviceReferenceAlarm.getBehindServiceId();
-
- ServiceReferenceAlarmList serviceReferenceAlarmList = new ServiceReferenceAlarmList();
- serviceReferenceAlarmList.setId(id);
- serviceReferenceAlarmList.setFrontApplicationId(serviceReferenceAlarm.getFrontApplicationId());
- serviceReferenceAlarmList.setBehindApplicationId(serviceReferenceAlarm.getBehindApplicationId());
- serviceReferenceAlarmList.setFrontInstanceId(serviceReferenceAlarm.getFrontInstanceId());
- serviceReferenceAlarmList.setBehindInstanceId(serviceReferenceAlarm.getBehindInstanceId());
- serviceReferenceAlarmList.setFrontServiceId(serviceReferenceAlarm.getFrontServiceId());
- serviceReferenceAlarmList.setBehindServiceId(serviceReferenceAlarm.getBehindServiceId());
- serviceReferenceAlarmList.setSourceValue(serviceReferenceAlarm.getSourceValue());
- serviceReferenceAlarmList.setAlarmType(serviceReferenceAlarm.getAlarmType());
- serviceReferenceAlarmList.setTimeBucket(serviceReferenceAlarm.getLastTimeBucket());
- serviceReferenceAlarmList.setAlarmContent(serviceReferenceAlarm.getAlarmContent());
- next.execute(serviceReferenceAlarmList);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider
deleted file mode 100644
index ec63fccad70f5092ddfdb65053ee9c03a7fe5950..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-#
-
-org.apache.skywalking.apm.collector.analysis.alarm.provider.AnalysisAlarmModuleProvider
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/pom.xml b/apm-collector/apm-collector-analysis/analysis-alarm/pom.xml
deleted file mode 100644
index 9f1d441975a0a324a4173dee6eab4e8188a0850c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-alarm/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
- apm-collector-analysis
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- analysis-alarm
- pom
-
- alarm-define
- alarm-provider
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/pom.xml
deleted file mode 100644
index 10fec99edb204f0962ca96165d8d68ef308a6996..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/pom.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
- analysis-baseline
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- baseline-computing-define
- jar
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/define/AnalysisBaselineComputingModule.java b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/define/AnalysisBaselineComputingModule.java
deleted file mode 100644
index 1b824b09f68f64b74842dcc12e89b72d2833d40c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/define/AnalysisBaselineComputingModule.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.baseline.computing.define;
-
-import org.apache.skywalking.apm.collector.core.module.ModuleDefine;
-
-/**
- * The AnalysisBaselineComputingModule defines the required service interfaces.
- *
- * @author wu-sheng, peng-yongsheng
- */
-public class AnalysisBaselineComputingModule extends ModuleDefine {
-
- public static final String NAME = "analysis_baseline-computing";
-
- @Override public String name() {
- return NAME;
- }
-
- @Override public Class[] services() {
- return new Class[0];
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
deleted file mode 100644
index 7b6c22e79fd5ab806e582163fcd3436beb7fa38b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-#
-
-org.apache.skywalking.apm.collector.analysis.baseline.computing.define.AnalysisBaselineComputingModule
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/pom.xml
deleted file mode 100644
index b0e43dcd7eb41c435b3727de28f8143974d22748..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/pom.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
- analysis-baseline
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- baseline-computing-provider
- jar
-
-
-
- org.apache.skywalking
- baseline-computing-define
- ${project.version}
-
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleConfig.java b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleConfig.java
deleted file mode 100644
index 1ed1bcdc5c30913daaa8640fd65c7468493aae58..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleConfig.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.baseline.computing.provider;
-
-import org.apache.skywalking.apm.collector.core.module.ModuleConfig;
-
-/**
- * @author peng-yongsheng
- */
-class AnalysisBaselineComputingModuleConfig extends ModuleConfig {
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleProvider.java b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleProvider.java
deleted file mode 100644
index d4913573e54bc4e7b6c252b500dfbc2b2fb8b756..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleProvider.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.baseline.computing.provider;
-
-import org.apache.skywalking.apm.collector.analysis.baseline.computing.define.AnalysisBaselineComputingModule;
-import org.apache.skywalking.apm.collector.core.module.*;
-import org.apache.skywalking.apm.collector.core.module.ModuleDefine;
-
-/**
- * The AnalysisBaselineComputingModuleProvider is the default implementation of {@link
- * AnalysisBaselineComputingModule}
- *
- * @author wu-sheng
- */
-public class AnalysisBaselineComputingModuleProvider extends ModuleProvider {
-
- private static final String NAME = "default";
- private final AnalysisBaselineComputingModuleConfig config;
-
- public AnalysisBaselineComputingModuleProvider() {
- super();
- this.config = new AnalysisBaselineComputingModuleConfig();
- }
-
- @Override public String name() {
- return NAME;
- }
-
- @Override public Class extends ModuleDefine> module() {
- return AnalysisBaselineComputingModule.class;
- }
-
- @Override public ModuleConfig createConfigBeanIfAbsent() {
- return config;
- }
-
- @Override public void prepare() {
- }
-
- @Override public void start() {
- }
-
- @Override public void notifyAfterCompleted() {
- }
-
- @Override public String[] requiredModules() {
- return new String[0];
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider
deleted file mode 100644
index 1dcb74f56aafa77eac768341b2e36074a1eb08d2..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-#
-
-org.apache.skywalking.apm.collector.analysis.baseline.computing.provider.AnalysisBaselineComputingModuleProvider
diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/pom.xml b/apm-collector/apm-collector-analysis/analysis-baseline/pom.xml
deleted file mode 100644
index dbf8ec888018306a273fa6e85220242d2f535fc6..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-baseline/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
- apm-collector-analysis
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- analysis-baseline
- pom
-
- baseline-computing-define
- baseline-computing-provider
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/pom.xml
deleted file mode 100644
index 4d6972f1952719f71d93cd8f9ca4e74ccfc6bba3..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/pom.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
- analysis-jvm
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- jvm-define
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/AnalysisJVMModule.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/AnalysisJVMModule.java
deleted file mode 100644
index 677e3baf0413f87b10eaf7ad785f9b3f2b188376..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/AnalysisJVMModule.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.ICpuMetricService;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IGCMetricService;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryMetricService;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryPoolMetricService;
-import org.apache.skywalking.apm.collector.core.module.ModuleDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class AnalysisJVMModule extends ModuleDefine {
-
- public static final String NAME = "analysis_jvm";
-
- @Override public String name() {
- return NAME;
- }
-
- @Override public Class[] services() {
- return new Class[] {
- ICpuMetricService.class, IGCMetricService.class,
- IMemoryMetricService.class, IMemoryPoolMetricService.class
- };
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/GraphIdDefine.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/GraphIdDefine.java
deleted file mode 100644
index 28f4695943792767c4a2e2b0cd1a1feb761de40f..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/GraphIdDefine.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.graph;
-
-/**
- * @author peng-yongsheng
- */
-public class GraphIdDefine {
- public static final int CPU_METRIC_PERSISTENCE_GRAPH_ID = 300;
- public static final int GC_METRIC_PERSISTENCE_GRAPH_ID = 301;
- public static final int MEMORY_METRIC_PERSISTENCE_GRAPH_ID = 303;
- public static final int MEMORY_POOL_METRIC_PERSISTENCE_GRAPH_ID = 304;
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/WorkerIdDefine.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/WorkerIdDefine.java
deleted file mode 100644
index e6a1f3a59f4326129431a8418739f337864bb75d..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/WorkerIdDefine.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.graph;
-
-/**
- * @author peng-yongsheng
- */
-public class WorkerIdDefine {
- public static final int CPU_METRIC_BRIDGE_NODE_ID = 3000;
- public static final int CPU_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 3002;
- public static final int CPU_HOUR_METRIC_PERSISTENCE_WORKER_ID = 3004;
- public static final int CPU_HOUR_METRIC_TRANSFORM_NODE_ID = 3005;
- public static final int CPU_DAY_METRIC_PERSISTENCE_WORKER_ID = 3006;
- public static final int CPU_DAY_METRIC_TRANSFORM_NODE_ID = 3007;
- public static final int CPU_MONTH_METRIC_PERSISTENCE_WORKER_ID = 3008;
- public static final int CPU_MONTH_METRIC_TRANSFORM_NODE_ID = 3009;
-
- public static final int GC_METRIC_BRIDGE_NODE_ID = 3100;
- public static final int GC_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 3102;
- public static final int GC_HOUR_METRIC_PERSISTENCE_WORKER_ID = 3104;
- public static final int GC_HOUR_METRIC_TRANSFORM_NODE_ID = 3105;
- public static final int GC_DAY_METRIC_PERSISTENCE_WORKER_ID = 3106;
- public static final int GC_DAY_METRIC_TRANSFORM_NODE_ID = 3107;
- public static final int GC_MONTH_METRIC_PERSISTENCE_WORKER_ID = 3108;
- public static final int GC_MONTH_METRIC_TRANSFORM_NODE_ID = 3109;
-
- public static final int MEMORY_METRIC_BRIDGE_NODE_ID = 3200;
- public static final int MEMORY_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 3202;
- public static final int MEMORY_HOUR_METRIC_PERSISTENCE_WORKER_ID = 3204;
- public static final int MEMORY_HOUR_METRIC_TRANSFORM_NODE_ID = 3205;
- public static final int MEMORY_DAY_METRIC_PERSISTENCE_WORKER_ID = 3206;
- public static final int MEMORY_DAY_METRIC_TRANSFORM_NODE_ID = 3207;
- public static final int MEMORY_MONTH_METRIC_PERSISTENCE_WORKER_ID = 3208;
- public static final int MEMORY_MONTH_METRIC_TRANSFORM_NODE_ID = 3209;
-
- public static final int MEMORY_POOL_METRIC_BRIDGE_NODE_ID = 3300;
- public static final int MEMORY_POOL_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 3302;
- public static final int MEMORY_POOL_HOUR_METRIC_PERSISTENCE_WORKER_ID = 3304;
- public static final int MEMORY_POOL_HOUR_METRIC_TRANSFORM_NODE_ID = 3305;
- public static final int MEMORY_POOL_DAY_METRIC_PERSISTENCE_WORKER_ID = 3306;
- public static final int MEMORY_POOL_DAY_METRIC_TRANSFORM_NODE_ID = 3307;
- public static final int MEMORY_POOL_MONTH_METRIC_PERSISTENCE_WORKER_ID = 3308;
- public static final int MEMORY_POOL_MONTH_METRIC_TRANSFORM_NODE_ID = 3309;
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/ICpuMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/ICpuMetricService.java
deleted file mode 100644
index 45fc3885fc21ce79339ac4b87f6a74047e58df9f..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/ICpuMetricService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.service;
-
-import org.apache.skywalking.apm.collector.core.module.Service;
-
-/**
- * @author peng-yongsheng
- */
-public interface ICpuMetricService extends Service {
- void send(int instanceId, long timeBucket, double usagePercent);
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IGCMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IGCMetricService.java
deleted file mode 100644
index a4abf193c9af9716bc2a5833b7d2adcf46897efd..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IGCMetricService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.service;
-
-import org.apache.skywalking.apm.collector.core.module.Service;
-
-/**
- * @author peng-yongsheng
- */
-public interface IGCMetricService extends Service {
- void send(int instanceId, long timeBucket, int phraseValue, long count, long duration);
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryMetricService.java
deleted file mode 100644
index 522d45ec39b075b3f70b6e0bafa751df4b878204..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryMetricService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.service;
-
-import org.apache.skywalking.apm.collector.core.module.Service;
-
-/**
- * @author peng-yongsheng
- */
-public interface IMemoryMetricService extends Service {
- void send(int instanceId, long timeBucket, boolean isHeap, long init, long max, long used, long committed);
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryPoolMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryPoolMetricService.java
deleted file mode 100644
index 81215ddec465021549e2cc930055db7205484b76..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryPoolMetricService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.service;
-
-import org.apache.skywalking.apm.collector.core.module.Service;
-
-/**
- * @author peng-yongsheng
- */
-public interface IMemoryPoolMetricService extends Service {
- void send(int instanceId, long timeBucket, int poolType, long init, long max, long used, long committed);
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
deleted file mode 100644
index dc562cb089ec3371a2b35a5af035ce485e9b677b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-#
-
-org.apache.skywalking.apm.collector.analysis.jvm.define.AnalysisJVMModule
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/pom.xml
deleted file mode 100644
index 3034c2f0d9e692f6d560df0cfaa293867fddaeec..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
- analysis-jvm
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- jvm-provider
- jar
-
-
-
- org.apache.skywalking
- jvm-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-storage-define
- ${project.version}
-
-
- org.apache.skywalking
- analysis-worker-model
- ${project.version}
-
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleConfig.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleConfig.java
deleted file mode 100644
index 4eec76e8fb77763362e017791945d0b37300b40e..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleConfig.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider;
-
-import org.apache.skywalking.apm.collector.core.module.ModuleConfig;
-
-/**
- * @author peng-yongsheng
- */
-class AnalysisJVMModuleConfig extends ModuleConfig {
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleProvider.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleProvider.java
deleted file mode 100644
index 57c5b611d782331474755d12820f9d69740433b3..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleProvider.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.AnalysisJVMModule;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.*;
-import org.apache.skywalking.apm.collector.analysis.jvm.provider.service.*;
-import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu.CpuMetricPersistenceGraph;
-import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc.GCMetricPersistenceGraph;
-import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory.MemoryMetricPersistenceGraph;
-import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool.MemoryPoolMetricPersistenceGraph;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.analysis.worker.timer.PersistenceTimer;
-import org.apache.skywalking.apm.collector.core.module.*;
-import org.apache.skywalking.apm.collector.remote.RemoteModule;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-
-/**
- * @author peng-yongsheng
- */
-public class AnalysisJVMModuleProvider extends ModuleProvider {
-
- public static final String NAME = "default";
- private final AnalysisJVMModuleConfig config;
-
- public AnalysisJVMModuleProvider() {
- super();
- this.config = new AnalysisJVMModuleConfig();
- }
-
- @Override public String name() {
- return NAME;
- }
-
- @Override public Class extends ModuleDefine> module() {
- return AnalysisJVMModule.class;
- }
-
- @Override public ModuleConfig createConfigBeanIfAbsent() {
- return config;
- }
-
- @Override public void prepare() throws ServiceNotProvidedException {
- this.registerServiceImplementation(ICpuMetricService.class, new CpuMetricService());
- this.registerServiceImplementation(IGCMetricService.class, new GCMetricService());
- this.registerServiceImplementation(IMemoryMetricService.class, new MemoryMetricService());
- this.registerServiceImplementation(IMemoryPoolMetricService.class, new MemoryPoolMetricService());
- }
-
- @Override public void start() {
- WorkerCreateListener workerCreateListener = new WorkerCreateListener();
-
- graphCreate(workerCreateListener);
-
- PersistenceTimer.INSTANCE.start(getManager(), workerCreateListener.getPersistenceWorkers());
- }
-
- @Override public void notifyAfterCompleted() {
- }
-
- @Override public String[] requiredModules() {
- return new String[] {StorageModule.NAME, RemoteModule.NAME};
- }
-
- private void graphCreate(WorkerCreateListener workerCreateListener) {
- new CpuMetricPersistenceGraph(getManager(), workerCreateListener).create();
- new GCMetricPersistenceGraph(getManager(), workerCreateListener).create();
- new MemoryMetricPersistenceGraph(getManager(), workerCreateListener).create();
- new MemoryPoolMetricPersistenceGraph(getManager(), workerCreateListener).create();
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/CpuMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/CpuMetricService.java
deleted file mode 100644
index 6e982ee1adc06123ad1e3d27d11a6040235ece9c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/CpuMetricService.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.service;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.ICpuMetricService;
-import org.apache.skywalking.apm.collector.core.graph.Graph;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static java.util.Objects.isNull;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuMetricService implements ICpuMetricService {
-
- private final Logger logger = LoggerFactory.getLogger(CpuMetricService.class);
-
- private Graph cpuMetricGraph;
-
- private Graph getCpuMetricGraph() {
- if (isNull(cpuMetricGraph)) {
- cpuMetricGraph = GraphManager.INSTANCE.findGraph(GraphIdDefine.CPU_METRIC_PERSISTENCE_GRAPH_ID, CpuMetric.class);
- }
- return cpuMetricGraph;
- }
-
- @Override public void send(int instanceId, long timeBucket, double usagePercent) {
- String metricId = String.valueOf(instanceId);
- String id = timeBucket + Const.ID_SPLIT + metricId;
-
- CpuMetric cpuMetric = new CpuMetric();
- cpuMetric.setId(id);
- cpuMetric.setMetricId(metricId);
- cpuMetric.setInstanceId(instanceId);
- cpuMetric.setUsagePercent(usagePercent);
- cpuMetric.setTimes(1L);
- cpuMetric.setTimeBucket(timeBucket);
-
- logger.debug("push to cpu metric graph, id: {}", cpuMetric.getId());
- getCpuMetricGraph().start(cpuMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/GCMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/GCMetricService.java
deleted file mode 100644
index 38c252f8630a9155dfb0f966af2768769addc396..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/GCMetricService.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.service;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IGCMetricService;
-import org.apache.skywalking.apm.collector.core.graph.Graph;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static java.util.Objects.isNull;
-
-/**
- * @author peng-yongsheng
- */
-public class GCMetricService implements IGCMetricService {
-
- private static final Logger logger = LoggerFactory.getLogger(GCMetricService.class);
-
- private Graph gcMetricGraph;
-
- private Graph getGcMetricGraph() {
- if (isNull(gcMetricGraph)) {
- gcMetricGraph = GraphManager.INSTANCE.findGraph(GraphIdDefine.GC_METRIC_PERSISTENCE_GRAPH_ID, GCMetric.class);
- }
- return gcMetricGraph;
- }
-
- @Override public void send(int instanceId, long timeBucket, int phraseValue, long count, long duration) {
- String metricId = instanceId + Const.ID_SPLIT + String.valueOf(phraseValue);
- String id = timeBucket + Const.ID_SPLIT + metricId;
-
- GCMetric gcMetric = new GCMetric();
- gcMetric.setId(id);
- gcMetric.setMetricId(metricId);
- gcMetric.setInstanceId(instanceId);
- gcMetric.setPhrase(phraseValue);
- gcMetric.setCount(count);
- gcMetric.setDuration(duration);
- gcMetric.setTimes(1L);
- gcMetric.setTimeBucket(timeBucket);
-
- if (logger.isDebugEnabled()) {
- logger.debug("push to gc metric graph, id: {}", gcMetric.getId());
- }
- getGcMetricGraph().start(gcMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryMetricService.java
deleted file mode 100644
index b0a816d6febec0949e84e53b538df0f9752c0bed..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryMetricService.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.service;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryMetricService;
-import org.apache.skywalking.apm.collector.core.graph.Graph;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static java.util.Objects.isNull;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryMetricService implements IMemoryMetricService {
-
- private final Logger logger = LoggerFactory.getLogger(MemoryMetricService.class);
-
- private Graph memoryMetricGraph;
-
- private Graph getMemoryMetricGraph() {
- if (isNull(memoryMetricGraph)) {
- this.memoryMetricGraph = GraphManager.INSTANCE.findGraph(GraphIdDefine.MEMORY_METRIC_PERSISTENCE_GRAPH_ID, MemoryMetric.class);
- }
- return memoryMetricGraph;
- }
-
- @Override
- public void send(int instanceId, long timeBucket, boolean isHeap, long init, long max, long used, long committed) {
- String metricId = instanceId + Const.ID_SPLIT + BooleanUtils.booleanToValue(isHeap);
- String id = timeBucket + Const.ID_SPLIT + metricId;
-
- MemoryMetric memoryMetric = new MemoryMetric();
- memoryMetric.setId(id);
- memoryMetric.setMetricId(metricId);
- memoryMetric.setInstanceId(instanceId);
- memoryMetric.setIsHeap(BooleanUtils.booleanToValue(isHeap));
- memoryMetric.setInit(init);
- memoryMetric.setMax(max);
- memoryMetric.setUsed(used);
- memoryMetric.setCommitted(committed);
- memoryMetric.setTimes(1L);
- memoryMetric.setTimeBucket(timeBucket);
-
- logger.debug("push to memory metric graph, id: {}", memoryMetric.getId());
- getMemoryMetricGraph().start(memoryMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryPoolMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryPoolMetricService.java
deleted file mode 100644
index 3ecca23dff0843dc39f81f7a572488e1ba8327a5..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryPoolMetricService.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.service;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryPoolMetricService;
-import org.apache.skywalking.apm.collector.core.graph.Graph;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static java.util.Objects.isNull;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolMetricService implements IMemoryPoolMetricService {
-
- private final Logger logger = LoggerFactory.getLogger(MemoryPoolMetricService.class);
-
- private Graph memoryPoolMetricGraph;
-
- private Graph getMemoryPoolMetricGraph() {
- if (isNull(memoryPoolMetricGraph)) {
- this.memoryPoolMetricGraph = GraphManager.INSTANCE.findGraph(GraphIdDefine.MEMORY_POOL_METRIC_PERSISTENCE_GRAPH_ID, MemoryPoolMetric.class);
- }
- return memoryPoolMetricGraph;
- }
-
- @Override
- public void send(int instanceId, long timeBucket, int poolType, long init, long max, long used, long committed) {
- String metricId = instanceId + Const.ID_SPLIT + String.valueOf(poolType);
- String id = timeBucket + Const.ID_SPLIT + metricId;
-
- MemoryPoolMetric memoryPoolMetric = new MemoryPoolMetric();
- memoryPoolMetric.setId(id);
- memoryPoolMetric.setMetricId(metricId);
- memoryPoolMetric.setInstanceId(instanceId);
- memoryPoolMetric.setPoolType(poolType);
- memoryPoolMetric.setInit(init);
- memoryPoolMetric.setMax(max);
- memoryPoolMetric.setUsed(used);
- memoryPoolMetric.setCommitted(committed);
- memoryPoolMetric.setTimes(1L);
- memoryPoolMetric.setTimeBucket(timeBucket);
-
- logger.debug("push to memory pool metric graph, id: {}", memoryPoolMetric.getId());
- getMemoryPoolMetricGraph().start(memoryPoolMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricPersistenceWorker.java
deleted file mode 100644
index 93adefc8dc1ed6ddca7c8ad1a083acbc5e4f75bf..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuDayMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuDayMetricPersistenceWorker extends MergePersistenceWorker {
-
- private CpuDayMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.CPU_DAY_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, CpuMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(ICpuDayMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public CpuDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new CpuDayMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricTransformNode.java
deleted file mode 100644
index 8cd0286c1b9b1b9d85f5a4ec8c5612adf3b46d33..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuDayMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.CPU_DAY_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(CpuMetric cpuMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(cpuMetric.getTimeBucket());
-
- CpuMetric newCpuMetric = CpuMetricCopy.copy(cpuMetric);
- newCpuMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + cpuMetric.getMetricId());
- newCpuMetric.setTimeBucket(timeBucket);
- next.execute(newCpuMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricPersistenceWorker.java
deleted file mode 100644
index 5c8059de84010b8ce4320b00b734b6ec4f9b3b45..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuHourMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuHourMetricPersistenceWorker extends MergePersistenceWorker {
-
- private CpuHourMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.CPU_HOUR_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, CpuMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(ICpuHourMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public CpuHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new CpuHourMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricTransformNode.java
deleted file mode 100644
index a6c648db52e77b9ae37be98cd24876d2b46726d8..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuHourMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.CPU_HOUR_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(CpuMetric cpuMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(cpuMetric.getTimeBucket());
-
- CpuMetric newCpuMetric = CpuMetricCopy.copy(cpuMetric);
- newCpuMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + cpuMetric.getMetricId());
- newCpuMetric.setTimeBucket(timeBucket);
- next.execute(newCpuMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricBridgeNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricBridgeNode.java
deleted file mode 100644
index 745b73b6f742e280472f06efcaf297f9191359f1..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricBridgeNode.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuMetricBridgeNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.CPU_METRIC_BRIDGE_NODE_ID;
- }
-
- @Override public void process(CpuMetric metric, Next next) {
- next.execute(metric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricCopy.java
deleted file mode 100644
index 067b0734415e4401bed82ea28d3b65bd7f76c5c5..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricCopy.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu;
-
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuMetricCopy {
-
- public static CpuMetric copy(CpuMetric cpuMetric) {
- CpuMetric newCpuMetric = new CpuMetric();
- newCpuMetric.setId(cpuMetric.getId());
- newCpuMetric.setMetricId(cpuMetric.getMetricId());
-
- newCpuMetric.setInstanceId(cpuMetric.getInstanceId());
- newCpuMetric.setUsagePercent(cpuMetric.getUsagePercent());
- newCpuMetric.setTimes(cpuMetric.getTimes());
-
- newCpuMetric.setTimeBucket(cpuMetric.getTimeBucket());
- return newCpuMetric;
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricPersistenceGraph.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricPersistenceGraph.java
deleted file mode 100644
index 817be24e789c6a49e70b0e9eaf67415cc6e20bad..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricPersistenceGraph.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Node;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuMetricPersistenceGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public CpuMetricPersistenceGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- Node bridgeNode = GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.CPU_METRIC_PERSISTENCE_GRAPH_ID, CpuMetric.class)
- .addNode(new CpuMetricBridgeNode());
-
- bridgeNode.addNext(new CpuMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new CpuHourMetricTransformNode())
- .addNext(new CpuHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new CpuDayMetricTransformNode())
- .addNext(new CpuDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new CpuMonthMetricTransformNode())
- .addNext(new CpuMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMinuteMetricPersistenceWorker.java
deleted file mode 100644
index cb2c0cc2fde3715121ebd5339076f97edd6d3187..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMinuteMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMinuteMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuMinuteMetricPersistenceWorker extends MergePersistenceWorker {
-
- private CpuMinuteMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.CPU_MINUTE_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, CpuMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(ICpuMinuteMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public CpuMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new CpuMinuteMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricPersistenceWorker.java
deleted file mode 100644
index 62f497cbac07dd719d7d318e88665b06aafad079..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMonthMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuMonthMetricPersistenceWorker extends MergePersistenceWorker {
-
- private CpuMonthMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.CPU_MONTH_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, CpuMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(ICpuMonthMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public CpuMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new CpuMonthMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricTransformNode.java
deleted file mode 100644
index c58da7e57ad16f7befd3fab2e88b5bd873957ae7..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuMonthMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.CPU_MONTH_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(CpuMetric cpuMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(cpuMetric.getTimeBucket());
-
- CpuMetric newCpuMetric = CpuMetricCopy.copy(cpuMetric);
- newCpuMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + cpuMetric.getMetricId());
- newCpuMetric.setTimeBucket(timeBucket);
- next.execute(newCpuMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricPersistenceWorker.java
deleted file mode 100644
index be441fa32ab93a834a935d40cb4193b7a3e922e3..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricPersistenceWorker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.*;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.gc.IGCDayMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class GCDayMetricPersistenceWorker extends MergePersistenceWorker {
-
- private GCDayMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.GC_DAY_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, GCMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IGCDayMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public GCDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new GCDayMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricTransformNode.java
deleted file mode 100644
index d1e143498d0de8a804621c0cfb23b93bf730ce0d..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class GCDayMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.GC_DAY_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(GCMetric gcMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(gcMetric.getTimeBucket());
-
- GCMetric newGCMetric = GCMetricCopy.copy(gcMetric);
- newGCMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId());
- newGCMetric.setTimeBucket(timeBucket);
- next.execute(newGCMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricPersistenceWorker.java
deleted file mode 100644
index 5ccfee3d04cf4a8523696e174fa7d8a80e6c8e54..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.gc.IGCHourMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class GCHourMetricPersistenceWorker extends MergePersistenceWorker {
-
- private GCHourMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.GC_HOUR_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, GCMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IGCHourMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public GCHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new GCHourMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricTransformNode.java
deleted file mode 100644
index 08abe1900f7b13e8463bd03212ef3c890a248a3a..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class GCHourMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.GC_HOUR_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(GCMetric gcMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(gcMetric.getTimeBucket());
-
- GCMetric newGCMetric = GCMetricCopy.copy(gcMetric);
- newGCMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId());
- newGCMetric.setTimeBucket(timeBucket);
- next.execute(newGCMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricBridgeNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricBridgeNode.java
deleted file mode 100644
index 97e23e77217083d6205023651aa96482ff9f0552..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricBridgeNode.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class GCMetricBridgeNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.GC_METRIC_BRIDGE_NODE_ID;
- }
-
- @Override public void process(GCMetric metric, Next next) {
- next.execute(metric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricCopy.java
deleted file mode 100644
index 9c0b534474b5708b74c89517c562f6e37a4e7033..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricCopy.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc;
-
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class GCMetricCopy {
-
- public static GCMetric copy(GCMetric gcMetric) {
- GCMetric newGCMetric = new GCMetric();
- newGCMetric.setId(gcMetric.getId());
- newGCMetric.setMetricId(gcMetric.getMetricId());
-
- newGCMetric.setInstanceId(gcMetric.getInstanceId());
- newGCMetric.setPhrase(gcMetric.getPhrase());
-
- newGCMetric.setCount(gcMetric.getCount());
- newGCMetric.setDuration(gcMetric.getDuration());
- newGCMetric.setTimes(gcMetric.getTimes());
-
- newGCMetric.setTimeBucket(gcMetric.getTimeBucket());
- return newGCMetric;
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricPersistenceGraph.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricPersistenceGraph.java
deleted file mode 100644
index 507f1bbcc5ee4cef655dc9ef1086a8ae13aceb1d..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricPersistenceGraph.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Node;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class GCMetricPersistenceGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public GCMetricPersistenceGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- Node bridgeNode = GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.GC_METRIC_PERSISTENCE_GRAPH_ID, GCMetric.class)
- .addNode(new GCMetricBridgeNode());
-
- bridgeNode.addNext(new GCMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new GCHourMetricTransformNode())
- .addNext(new GCHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new GCDayMetricTransformNode())
- .addNext(new GCDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new GCMonthMetricTransformNode())
- .addNext(new GCMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMinuteMetricPersistenceWorker.java
deleted file mode 100644
index 260d610474d08944baf1819476800a42a5d65a3c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMinuteMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMinuteMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class GCMinuteMetricPersistenceWorker extends MergePersistenceWorker {
-
- private GCMinuteMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.GC_MINUTE_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, GCMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IGCMinuteMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public GCMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new GCMinuteMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricPersistenceWorker.java
deleted file mode 100644
index 7887797a050e944fd8561d8039d0dba0e07dd41d..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMonthMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class GCMonthMetricPersistenceWorker extends MergePersistenceWorker {
-
- private GCMonthMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.GC_MONTH_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, GCMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IGCMonthMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public GCMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new GCMonthMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricTransformNode.java
deleted file mode 100644
index 644b16c882f16087950d4faba0ba60949c659e14..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class GCMonthMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.GC_MONTH_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(GCMetric gcMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(gcMetric.getTimeBucket());
-
- GCMetric newGCMetric = GCMetricCopy.copy(gcMetric);
- newGCMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId());
- newGCMetric.setTimeBucket(timeBucket);
- next.execute(newGCMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricPersistenceWorker.java
deleted file mode 100644
index 12031510a1a893fba7acf4f4170bc8519da377b3..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryDayMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryDayMetricPersistenceWorker extends MergePersistenceWorker {
-
- public MemoryDayMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_DAY_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, MemoryMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IMemoryDayMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public MemoryDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new MemoryDayMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricTransformNode.java
deleted file mode 100644
index 092998d0849e8fd3941f576768c9065eb1091a8d..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryDayMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_DAY_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(MemoryMetric memoryMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(memoryMetric.getTimeBucket());
-
- MemoryMetric newMemoryMetric = MemoryMetricCopy.copy(memoryMetric);
- newMemoryMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryMetric.getMetricId());
- newMemoryMetric.setTimeBucket(timeBucket);
- next.execute(newMemoryMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricPersistenceWorker.java
deleted file mode 100644
index 3de68c7e285ccc28fd70c15f077643cb8ee5bfb1..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryHourMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryHourMetricPersistenceWorker extends MergePersistenceWorker {
-
- public MemoryHourMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_HOUR_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, MemoryMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IMemoryHourMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public MemoryHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new MemoryHourMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricTransformNode.java
deleted file mode 100644
index dbe15da56db49981fc2dc36b1e07ea8c52459816..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryHourMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_HOUR_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(MemoryMetric memoryMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(memoryMetric.getTimeBucket());
-
- MemoryMetric newMemoryMetric = MemoryMetricCopy.copy(memoryMetric);
- newMemoryMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryMetric.getMetricId());
- newMemoryMetric.setTimeBucket(timeBucket);
- next.execute(newMemoryMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricBridgeNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricBridgeNode.java
deleted file mode 100644
index 2137690f4afe7f5ec5d0ad8c86869b08b1aec865..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricBridgeNode.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryMetricBridgeNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_METRIC_BRIDGE_NODE_ID;
- }
-
- @Override public void process(MemoryMetric metric, Next next) {
- next.execute(metric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricCopy.java
deleted file mode 100644
index 55b9b134edbbcbf9f1c59a745710ef5cfe1a80d7..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricCopy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory;
-
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryMetricCopy {
-
- public static MemoryMetric copy(MemoryMetric memoryMetric) {
- MemoryMetric newMemoryMetric = new MemoryMetric();
- newMemoryMetric.setId(memoryMetric.getId());
- newMemoryMetric.setMetricId(memoryMetric.getMetricId());
-
- newMemoryMetric.setInstanceId(memoryMetric.getInstanceId());
- newMemoryMetric.setIsHeap(memoryMetric.getIsHeap());
-
- newMemoryMetric.setInit(memoryMetric.getInit());
- newMemoryMetric.setMax(memoryMetric.getMax());
- newMemoryMetric.setUsed(memoryMetric.getUsed());
- newMemoryMetric.setCommitted(memoryMetric.getCommitted());
- newMemoryMetric.setTimes(memoryMetric.getTimes());
-
- newMemoryMetric.setTimeBucket(memoryMetric.getTimeBucket());
- return newMemoryMetric;
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricPersistenceGraph.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricPersistenceGraph.java
deleted file mode 100644
index 67263c93c296b241e2c2bb351933bb757a0fc5c1..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricPersistenceGraph.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Node;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryMetricPersistenceGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public MemoryMetricPersistenceGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- Node bridgeNode = GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.MEMORY_METRIC_PERSISTENCE_GRAPH_ID, MemoryMetric.class)
- .addNode(new MemoryMetricBridgeNode());
-
- bridgeNode.addNext(new MemoryMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new MemoryHourMetricTransformNode())
- .addNext(new MemoryHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new MemoryDayMetricTransformNode())
- .addNext(new MemoryDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new MemoryMonthMetricTransformNode())
- .addNext(new MemoryMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMinuteMetricPersistenceWorker.java
deleted file mode 100644
index 09c6b0a8ba1ffa463a62da073fc932f20ae1ae7f..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMinuteMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMinuteMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryMinuteMetricPersistenceWorker extends MergePersistenceWorker {
-
- public MemoryMinuteMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_MINUTE_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, MemoryMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IMemoryMinuteMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public MemoryMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new MemoryMinuteMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricPersistenceWorker.java
deleted file mode 100644
index ea74d191867c77f5c62c7995de068bc5720e4cec..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMonthMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryMonthMetricPersistenceWorker extends MergePersistenceWorker {
-
- public MemoryMonthMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_MONTH_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, MemoryMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IMemoryMonthMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public MemoryMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new MemoryMonthMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricTransformNode.java
deleted file mode 100644
index f13a165f962e805e1c3fe6c922bed173915cfb08..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryMonthMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_MONTH_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(MemoryMetric memoryMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(memoryMetric.getTimeBucket());
-
- MemoryMetric newMemoryMetric = MemoryMetricCopy.copy(memoryMetric);
- newMemoryMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryMetric.getMetricId());
- newMemoryMetric.setTimeBucket(timeBucket);
- next.execute(newMemoryMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricPersistenceWorker.java
deleted file mode 100644
index 3b0b8a6060d86c902ec857b51088afe178232a3c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolDayMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolDayMetricPersistenceWorker extends MergePersistenceWorker {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_POOL_DAY_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- public MemoryPoolDayMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, MemoryPoolMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolDayMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public MemoryPoolDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new MemoryPoolDayMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricTransformNode.java
deleted file mode 100644
index a303dedd290155970e186a1f6f5ac0753a60ea7b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolDayMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_POOL_DAY_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(MemoryPoolMetric memoryPoolMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(memoryPoolMetric.getTimeBucket());
-
- MemoryPoolMetric newMemoryPoolMetric = MemoryPoolMetricCopy.copy(memoryPoolMetric);
- newMemoryPoolMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryPoolMetric.getMetricId());
- newMemoryPoolMetric.setTimeBucket(timeBucket);
- next.execute(newMemoryPoolMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricPersistenceWorker.java
deleted file mode 100644
index 7ef3cb50b981d8ae471e7bd4fb1187e5c5c5793a..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolHourMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolHourMetricPersistenceWorker extends MergePersistenceWorker {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_POOL_HOUR_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- public MemoryPoolHourMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, MemoryPoolMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolHourMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public MemoryPoolHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new MemoryPoolHourMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricTransformNode.java
deleted file mode 100644
index 7ac28df1a777956fff9c01b0f091b6a28db923e3..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolHourMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_POOL_HOUR_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(MemoryPoolMetric memoryPoolMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(memoryPoolMetric.getTimeBucket());
-
- MemoryPoolMetric newMemoryPoolMetric = MemoryPoolMetricCopy.copy(memoryPoolMetric);
- newMemoryPoolMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryPoolMetric.getMetricId());
- newMemoryPoolMetric.setTimeBucket(timeBucket);
- next.execute(newMemoryPoolMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricBridgeNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricBridgeNode.java
deleted file mode 100644
index 3220ea87665c94b039ab1b1e6785ad450ede99a4..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricBridgeNode.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolMetricBridgeNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_POOL_METRIC_BRIDGE_NODE_ID;
- }
-
- @Override public void process(MemoryPoolMetric metric, Next next) {
- next.execute(metric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricCopy.java
deleted file mode 100644
index 4b805f52f1ecbf72190304d9b8d40da9eecf2d15..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricCopy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
-
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolMetricCopy {
-
- public static MemoryPoolMetric copy(MemoryPoolMetric memoryPoolMetric) {
- MemoryPoolMetric newMemoryPoolMetric = new MemoryPoolMetric();
- newMemoryPoolMetric.setId(memoryPoolMetric.getId());
- newMemoryPoolMetric.setMetricId(memoryPoolMetric.getMetricId());
-
- newMemoryPoolMetric.setInstanceId(memoryPoolMetric.getInstanceId());
-
- newMemoryPoolMetric.setInit(memoryPoolMetric.getInit());
- newMemoryPoolMetric.setMax(memoryPoolMetric.getMax());
- newMemoryPoolMetric.setUsed(memoryPoolMetric.getUsed());
- newMemoryPoolMetric.setCommitted(memoryPoolMetric.getCommitted());
- newMemoryPoolMetric.setPoolType(memoryPoolMetric.getPoolType());
- newMemoryPoolMetric.setTimes(memoryPoolMetric.getTimes());
-
- newMemoryPoolMetric.setTimeBucket(memoryPoolMetric.getTimeBucket());
- return newMemoryPoolMetric;
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricPersistenceGraph.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricPersistenceGraph.java
deleted file mode 100644
index 199e1d725019521768b961ba1d04b34a7eda6c2b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricPersistenceGraph.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Node;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolMetricPersistenceGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public MemoryPoolMetricPersistenceGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- Node bridgeNode = GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.MEMORY_POOL_METRIC_PERSISTENCE_GRAPH_ID, MemoryPoolMetric.class)
- .addNode(new MemoryPoolMetricBridgeNode());
-
- bridgeNode.addNext(new MemoryPoolMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new MemoryPoolHourMetricTransformNode())
- .addNext(new MemoryPoolHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new MemoryPoolDayMetricTransformNode())
- .addNext(new MemoryPoolDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- bridgeNode.addNext(new MemoryPoolMonthMetricTransformNode())
- .addNext(new MemoryPoolMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMinuteMetricPersistenceWorker.java
deleted file mode 100644
index d2fab7f4c9710b09aceb82319458815d7f6ac544..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMinuteMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMinuteMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolMinuteMetricPersistenceWorker extends MergePersistenceWorker {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_POOL_MINUTE_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- public MemoryPoolMinuteMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, MemoryPoolMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolMinuteMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public MemoryPoolMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new MemoryPoolMinuteMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricPersistenceWorker.java
deleted file mode 100644
index a0e5ba6210b687eabc23b757fb46d677d0b8cd84..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricPersistenceWorker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMonthMetricPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolMonthMetricPersistenceWorker extends MergePersistenceWorker {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_POOL_MONTH_METRIC_PERSISTENCE_WORKER_ID;
- }
-
- public MemoryPoolMonthMetricPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, MemoryPoolMetric> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolMonthMetricPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public MemoryPoolMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new MemoryPoolMonthMetricPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricTransformNode.java
deleted file mode 100644
index 6630a4088ddff136adb8dbe7c1100ff598005983..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricTransformNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
-
-import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolMonthMetricTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return WorkerIdDefine.MEMORY_POOL_MONTH_METRIC_TRANSFORM_NODE_ID;
- }
-
- @Override public void process(MemoryPoolMetric memoryPoolMetric, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(memoryPoolMetric.getTimeBucket());
-
- MemoryPoolMetric newMemoryPoolMetric = MemoryPoolMetricCopy.copy(memoryPoolMetric);
- newMemoryPoolMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryPoolMetric.getMetricId());
- newMemoryPoolMetric.setTimeBucket(timeBucket);
- next.execute(newMemoryPoolMetric);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider
deleted file mode 100644
index 3f6d9af35061bdd6787cab54b54654e2f7107864..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-#
-
-org.apache.skywalking.apm.collector.analysis.jvm.provider.AnalysisJVMModuleProvider
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/pom.xml b/apm-collector/apm-collector-analysis/analysis-jvm/pom.xml
deleted file mode 100644
index a7c4fe4cb640023b1acbad2bc1fcae24ee41f34d..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-jvm/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
- apm-collector-analysis
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- analysis-jvm
- pom
-
- jvm-define
- jvm-provider
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/pom.xml
deleted file mode 100644
index f05dc34dd93c5b2dad51df68f6cb85eb57fe2646..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/pom.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
- analysis-metric
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- metric-define
- jar
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/AnalysisMetricModule.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/AnalysisMetricModule.java
deleted file mode 100644
index 21c47af644a917343ac39ccfaf1c591dd50a0024..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/AnalysisMetricModule.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.define;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService;
-import org.apache.skywalking.apm.collector.core.module.ModuleDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class AnalysisMetricModule extends ModuleDefine {
-
- public static final String NAME = "analysis_metric";
-
- @Override public String name() {
- return NAME;
- }
-
- @Override public Class[] services() {
- return new Class[] {IInstanceHeartBeatService.class};
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricGraphIdDefine.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricGraphIdDefine.java
deleted file mode 100644
index 4f97d316a7d575aa3b69b6e36e84f5efcda25ed2..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricGraphIdDefine.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.define.graph;
-
-/**
- * @author peng-yongsheng
- */
-public class MetricGraphIdDefine {
- public static final int SERVICE_REFERENCE_METRIC_GRAPH_ID = 400;
- public static final int INSTANCE_REFERENCE_METRIC_GRAPH_ID = 401;
- public static final int APPLICATION_REFERENCE_METRIC_GRAPH_ID = 402;
-
- public static final int SERVICE_METRIC_GRAPH_ID = 403;
- public static final int INSTANCE_METRIC_GRAPH_ID = 404;
- public static final int APPLICATION_METRIC_GRAPH_ID = 405;
-
- public static final int APPLICATION_COMPONENT_GRAPH_ID = 406;
- public static final int APPLICATION_MAPPING_GRAPH_ID = 407;
- public static final int RESPONSE_TIME_DISTRIBUTION_GRAPH_ID = 408;
- public static final int GLOBAL_TRACE_GRAPH_ID = 409;
- public static final int SEGMENT_DURATION_GRAPH_ID = 410;
- public static final int INSTANCE_MAPPING_GRAPH_ID = 411;
-
- public static final int INSTANCE_HEART_BEAT_PERSISTENCE_GRAPH_ID = 412;
- public static final int SERVICE_HEART_BEAT_PERSISTENCE_GRAPH_ID = 413;
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricWorkerIdDefine.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricWorkerIdDefine.java
deleted file mode 100644
index 581c9a9479460f1a3fe490ae251ef139d1a9fa6b..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricWorkerIdDefine.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.define.graph;
-
-/**
- * @author peng-yongsheng
- */
-public class MetricWorkerIdDefine {
- public static final int SERVICE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4010;
- public static final int SERVICE_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4011;
- public static final int SERVICE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4012;
- public static final int SERVICE_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4013;
- public static final int SERVICE_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4014;
- public static final int SERVICE_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4015;
- public static final int SERVICE_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4016;
- public static final int SERVICE_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4017;
- public static final int SERVICE_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4018;
-
- public static final int INSTANCE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4020;
- public static final int INSTANCE_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4021;
- public static final int INSTANCE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4022;
- public static final int INSTANCE_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4023;
- public static final int INSTANCE_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4024;
- public static final int INSTANCE_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4025;
- public static final int INSTANCE_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4026;
- public static final int INSTANCE_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4027;
- public static final int INSTANCE_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4028;
-
- public static final int APPLICATION_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4030;
- public static final int APPLICATION_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4031;
- public static final int APPLICATION_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4032;
- public static final int APPLICATION_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4033;
- public static final int APPLICATION_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4034;
- public static final int APPLICATION_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4035;
- public static final int APPLICATION_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4036;
- public static final int APPLICATION_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4037;
- public static final int APPLICATION_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4038;
-
- public static final int SERVICE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4040;
- public static final int SERVICE_MINUTE_METRIC_REMOTE_WORKER_ID = 4041;
- public static final int SERVICE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4042;
- public static final int SERVICE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4043;
- public static final int SERVICE_HOUR_METRIC_TRANSFORM_NODE_ID = 4044;
- public static final int SERVICE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4045;
- public static final int SERVICE_DAY_METRIC_TRANSFORM_NODE_ID = 4046;
- public static final int SERVICE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4047;
- public static final int SERVICE_MONTH_METRIC_TRANSFORM_NODE_ID = 4048;
-
- public static final int INSTANCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4050;
- public static final int INSTANCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4051;
- public static final int INSTANCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4052;
- public static final int INSTANCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4053;
- public static final int INSTANCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4054;
- public static final int INSTANCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4055;
- public static final int INSTANCE_DAY_METRIC_TRANSFORM_NODE_ID = 4056;
- public static final int INSTANCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4057;
- public static final int INSTANCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4058;
-
- public static final int APPLICATION_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4060;
- public static final int APPLICATION_MINUTE_METRIC_REMOTE_WORKER_ID = 4061;
- public static final int APPLICATION_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4062;
- public static final int APPLICATION_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4063;
- public static final int APPLICATION_HOUR_METRIC_TRANSFORM_NODE_ID = 4064;
- public static final int APPLICATION_DAY_METRIC_PERSISTENCE_WORKER_ID = 4065;
- public static final int APPLICATION_DAY_METRIC_TRANSFORM_NODE_ID = 4066;
- public static final int APPLICATION_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4067;
- public static final int APPLICATION_MONTH_METRIC_TRANSFORM_NODE_ID = 4068;
-
- public static final int INSTANCE_MAPPING_MINUTE_AGGREGATION_WORKER_ID = 4070;
- public static final int INSTANCE_MAPPING_MINUTE_REMOTE_WORKER_ID = 4071;
- public static final int INSTANCE_MAPPING_MINUTE_PERSISTENCE_WORKER_ID = 4072;
- public static final int INSTANCE_MAPPING_HOUR_PERSISTENCE_WORKER_ID = 4073;
- public static final int INSTANCE_MAPPING_HOUR_TRANSFORM_NODE_ID = 4074;
- public static final int INSTANCE_MAPPING_DAY_PERSISTENCE_WORKER_ID = 4075;
- public static final int INSTANCE_MAPPING_DAY_TRANSFORM_NODE_ID = 4076;
- public static final int INSTANCE_MAPPING_MONTH_PERSISTENCE_WORKER_ID = 4077;
- public static final int INSTANCE_MAPPING_MONTH_TRANSFORM_NODE_ID = 4078;
-
- public static final int APPLICATION_MAPPING_MINUTE_AGGREGATION_WORKER_ID = 4080;
- public static final int APPLICATION_MAPPING_MINUTE_REMOTE_WORKER_ID = 4081;
- public static final int APPLICATION_MAPPING_MINUTE_PERSISTENCE_WORKER_ID = 4082;
- public static final int APPLICATION_MAPPING_HOUR_PERSISTENCE_WORKER_ID = 4083;
- public static final int APPLICATION_MAPPING_HOUR_TRANSFORM_NODE_ID = 4084;
- public static final int APPLICATION_MAPPING_DAY_PERSISTENCE_WORKER_ID = 4085;
- public static final int APPLICATION_MAPPING_DAY_TRANSFORM_NODE_ID = 4086;
- public static final int APPLICATION_MAPPING_MONTH_PERSISTENCE_WORKER_ID = 4087;
- public static final int APPLICATION_MAPPING_MONTH_TRANSFORM_NODE_ID = 4088;
-
- public static final int APPLICATION_COMPONENT_MINUTE_AGGREGATION_WORKER_ID = 4090;
- public static final int APPLICATION_COMPONENT_MINUTE_REMOTE_WORKER_ID = 4091;
- public static final int APPLICATION_COMPONENT_MINUTE_PERSISTENCE_WORKER_ID = 4092;
- public static final int APPLICATION_COMPONENT_HOUR_PERSISTENCE_WORKER_ID = 4093;
- public static final int APPLICATION_COMPONENT_HOUR_TRANSFORM_NODE_ID = 4094;
- public static final int APPLICATION_COMPONENT_DAY_PERSISTENCE_WORKER_ID = 4095;
- public static final int APPLICATION_COMPONENT_DAY_TRANSFORM_NODE_ID = 4096;
- public static final int APPLICATION_COMPONENT_MONTH_PERSISTENCE_WORKER_ID = 4097;
- public static final int APPLICATION_COMPONENT_MONTH_TRANSFORM_NODE_ID = 4098;
-
- public static final int RESPONSE_TIME_DISTRIBUTION_MINUTE_AGGREGATION_WORKER_ID = 4100;
- public static final int RESPONSE_TIME_DISTRIBUTION_MINUTE_REMOTE_WORKER_ID = 4101;
- public static final int RESPONSE_TIME_DISTRIBUTION_MINUTE_PERSISTENCE_WORKER_ID = 4102;
- public static final int RESPONSE_TIME_DISTRIBUTION_HOUR_PERSISTENCE_WORKER_ID = 4103;
- public static final int RESPONSE_TIME_DISTRIBUTION_HOUR_TRANSFORM_NODE_ID = 4104;
- public static final int RESPONSE_TIME_DISTRIBUTION_DAY_PERSISTENCE_WORKER_ID = 4105;
- public static final int RESPONSE_TIME_DISTRIBUTION_DAY_TRANSFORM_NODE_ID = 4106;
- public static final int RESPONSE_TIME_DISTRIBUTION_MONTH_PERSISTENCE_WORKER_ID = 4107;
- public static final int RESPONSE_TIME_DISTRIBUTION_MONTH_TRANSFORM_NODE_ID = 4108;
-
- public static final int GLOBAL_TRACE_PERSISTENCE_WORKER_ID = 4110;
- public static final int SEGMENT_DURATION_PERSISTENCE_WORKER_ID = 4120;
-
- public static final int INSTANCE_REFERENCE_GRAPH_BRIDGE_WORKER_ID = 4130;
- public static final int APPLICATION_REFERENCE_GRAPH_BRIDGE_WORKER_ID = 4140;
- public static final int SERVICE_METRIC_GRAPH_BRIDGE_WORKER_ID = 4150;
- public static final int INSTANCE_METRIC_GRAPH_BRIDGE_WORKER_ID = 4160;
- public static final int APPLICATION_METRIC_GRAPH_BRIDGE_WORKER_ID = 4170;
-
- public static final int INST_HEART_BEAT_PERSISTENCE_WORKER_ID = 4180;
-
- public static final int SERVICE_NAME_HEART_BEAT_AGGREGATION_WORKER_ID = 4190;
- public static final int SERVICE_NAME_HEART_BEAT_REMOTE_WORKER_ID = 4191;
- public static final int SERVICE_NAME_HEART_BEAT_PERSISTENCE_WORKER_ID = 4192;
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/service/IInstanceHeartBeatService.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/service/IInstanceHeartBeatService.java
deleted file mode 100644
index bcce416ea846341da17a9c6bbd07b10ea12c7c7a..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/service/IInstanceHeartBeatService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.define.service;
-
-import org.apache.skywalking.apm.collector.core.module.Service;
-
-/**
- * @author peng-yongsheng
- */
-public interface IInstanceHeartBeatService extends Service {
- void heartBeat(int instanceId, long heartBeatTime);
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
deleted file mode 100644
index 28fa6613649eb118e961ed89c724213756d46c12..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-#
-
-org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/pom.xml
deleted file mode 100644
index 7eafa1f20c564fe72889157bfef4b3240860f91f..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
- analysis-metric
- org.apache.skywalking
- 6.0.0-alpha-SNAPSHOT
-
- 4.0.0
-
- metric-provider
- jar
-
-
-
- org.apache.skywalking
- metric-define
- ${project.version}
-
-
- org.apache.skywalking
- segment-parser-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-configuration-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-cache-define
- ${project.version}
-
-
- org.apache.skywalking
- collector-storage-define
- ${project.version}
-
-
- org.apache.skywalking
- analysis-worker-model
- ${project.version}
-
-
-
\ No newline at end of file
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleConfig.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleConfig.java
deleted file mode 100644
index 2030486bae1bc360df20a4688379ea1107412945..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleConfig.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider;
-
-import org.apache.skywalking.apm.collector.core.module.ModuleConfig;
-
-/**
- * @author peng-yongsheng
- */
-class AnalysisMetricModuleConfig extends ModuleConfig {
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleProvider.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleProvider.java
deleted file mode 100644
index 35db2d9e36beb193ea748268573981959cb24028..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleProvider.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule;
-import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.service.InstanceHeartBeatService;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component.*;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping.*;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric.ApplicationMetricGraph;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric.ApplicationReferenceMetricGraph;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.*;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std.*;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.heartbeat.InstanceHeartBeatPersistenceGraph;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping.*;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric.InstanceMetricGraph;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric.InstanceReferenceMetricGraph;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.segment.*;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.heartbeat.*;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric.ServiceMetricGraph;
-import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric.*;
-import org.apache.skywalking.apm.collector.analysis.segment.parser.define.AnalysisSegmentParserModule;
-import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParserListenerRegister;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.analysis.worker.timer.PersistenceTimer;
-import org.apache.skywalking.apm.collector.cache.CacheModule;
-import org.apache.skywalking.apm.collector.configuration.ConfigurationModule;
-import org.apache.skywalking.apm.collector.core.module.*;
-import org.apache.skywalking.apm.collector.remote.RemoteModule;
-import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.table.application.*;
-import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution;
-import org.apache.skywalking.apm.collector.storage.table.instance.*;
-import org.apache.skywalking.apm.collector.storage.table.service.*;
-
-/**
- * @author peng-yongsheng
- */
-public class AnalysisMetricModuleProvider extends ModuleProvider {
-
- public static final String NAME = "default";
- private final AnalysisMetricModuleConfig config;
-
- public AnalysisMetricModuleProvider() {
- super();
- this.config = new AnalysisMetricModuleConfig();
- }
-
- @Override public String name() {
- return NAME;
- }
-
- @Override public Class extends ModuleDefine> module() {
- return AnalysisMetricModule.class;
- }
-
- @Override public ModuleConfig createConfigBeanIfAbsent() {
- return config;
- }
-
- @Override public void prepare() throws ServiceNotProvidedException {
- this.registerServiceImplementation(IInstanceHeartBeatService.class, new InstanceHeartBeatService());
- }
-
- @Override public void start() {
- segmentParserListenerRegister();
-
- WorkerCreateListener workerCreateListener = new WorkerCreateListener();
-
- graphCreate(workerCreateListener);
-
- registerRemoteData();
-
- PersistenceTimer.INSTANCE.start(getManager(), workerCreateListener.getPersistenceWorkers());
- }
-
- @Override public void notifyAfterCompleted() {
- }
-
- @Override public String[] requiredModules() {
- return new String[] {AnalysisSegmentParserModule.NAME, ConfigurationModule.NAME, CacheModule.NAME, StorageModule.NAME};
- }
-
- private void segmentParserListenerRegister() {
- ISegmentParserListenerRegister segmentParserListenerRegister = getManager().find(AnalysisSegmentParserModule.NAME).getService(ISegmentParserListenerRegister.class);
- segmentParserListenerRegister.register(new ServiceReferenceMetricSpanListener.Factory());
- segmentParserListenerRegister.register(new ApplicationComponentSpanListener.Factory());
- segmentParserListenerRegister.register(new ApplicationMappingSpanListener.Factory());
- segmentParserListenerRegister.register(new InstanceMappingSpanListener.Factory());
- segmentParserListenerRegister.register(new GlobalTraceSpanListener.Factory());
- segmentParserListenerRegister.register(new SegmentDurationSpanListener.Factory());
- segmentParserListenerRegister.register(new ResponseTimeDistributionSpanListener.Factory());
- segmentParserListenerRegister.register(new ServiceNameSpanListener.Factory());
- }
-
- private void graphCreate(WorkerCreateListener workerCreateListener) {
- new ServiceReferenceMetricGraph(getManager(), workerCreateListener).create();
- new ServiceMetricGraph(getManager(), workerCreateListener).create();
- new ServiceNameHeartBeatGraph(getManager(), workerCreateListener).create();
-
- new InstanceHeartBeatPersistenceGraph(getManager(), workerCreateListener).create();
- new InstanceMappingGraph(getManager(), workerCreateListener).create();
- new InstanceReferenceMetricGraph(getManager(), workerCreateListener).create();
- new InstanceMetricGraph(getManager(), workerCreateListener).create();
-
- new ApplicationComponentGraph(getManager(), workerCreateListener).create();
- new ApplicationMappingGraph(getManager(), workerCreateListener).create();
- new ApplicationReferenceMetricGraph(getManager(), workerCreateListener).create();
- new ApplicationMetricGraph(getManager(), workerCreateListener).create();
-
- new GlobalTraceGraph(getManager(), workerCreateListener).create();
- new ResponseTimeDistributionGraph(getManager(), workerCreateListener).create();
- new SegmentDurationGraph(getManager(), workerCreateListener).create();
- }
-
- private void registerRemoteData() {
- RemoteDataRegisterService remoteDataRegisterService = getManager().find(RemoteModule.NAME).getService(RemoteDataRegisterService.class);
- remoteDataRegisterService.register(ApplicationComponent.class, new ApplicationComponent.InstanceCreator());
- remoteDataRegisterService.register(ApplicationMapping.class, new ApplicationMapping.InstanceCreator());
- remoteDataRegisterService.register(ApplicationMetric.class, new ApplicationMetric.InstanceCreator());
- remoteDataRegisterService.register(ApplicationReferenceMetric.class, new ApplicationReferenceMetric.InstanceCreator());
- remoteDataRegisterService.register(InstanceMapping.class, new InstanceMapping.InstanceCreator());
- remoteDataRegisterService.register(InstanceMetric.class, new InstanceMetric.InstanceCreator());
- remoteDataRegisterService.register(InstanceReferenceMetric.class, new InstanceReferenceMetric.InstanceCreator());
- remoteDataRegisterService.register(ServiceMetric.class, new ServiceMetric.InstanceCreator());
- remoteDataRegisterService.register(ServiceReferenceMetric.class, new ServiceReferenceMetric.InstanceCreator());
- remoteDataRegisterService.register(ResponseTimeDistribution.class, new ResponseTimeDistribution.InstanceCreator());
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/service/InstanceHeartBeatService.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/service/InstanceHeartBeatService.java
deleted file mode 100644
index 1409f02377865fe2c186886ad5763a87ff150c87..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/service/InstanceHeartBeatService.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.service;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService;
-import org.apache.skywalking.apm.collector.core.graph.Graph;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.register.Instance;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static java.util.Objects.isNull;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceHeartBeatService implements IInstanceHeartBeatService {
-
- private static final Logger logger = LoggerFactory.getLogger(InstanceHeartBeatService.class);
-
- private Graph heartBeatGraph;
-
- private Graph getHeartBeatGraph() {
- if (isNull(heartBeatGraph)) {
- this.heartBeatGraph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.INSTANCE_HEART_BEAT_PERSISTENCE_GRAPH_ID, Instance.class);
- }
- return heartBeatGraph;
- }
-
- @Override public void heartBeat(int instanceId, long heartBeatTime) {
- Instance instance = new Instance();
- instance.setId(String.valueOf(instanceId));
- instance.setHeartBeatTime(TimeBucketUtils.INSTANCE.getSecondTimeBucket(heartBeatTime));
- instance.setInstanceId(instanceId);
-
- if (logger.isDebugEnabled()) {
- logger.debug("push to instance heart beat persistence worker, id: {}", instance.getId());
- }
- getHeartBeatGraph().start(instance);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentCopy.java
deleted file mode 100644
index 510ac814e5d6c5d4fe39516c631a23816176ef0c..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentCopy.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentCopy {
-
- public static ApplicationComponent copy(ApplicationComponent applicationComponent) {
- ApplicationComponent newApplicationComponent = new ApplicationComponent();
- newApplicationComponent.setId(applicationComponent.getId());
- newApplicationComponent.setMetricId(applicationComponent.getMetricId());
-
- newApplicationComponent.setComponentId(applicationComponent.getComponentId());
- newApplicationComponent.setApplicationId(applicationComponent.getApplicationId());
- newApplicationComponent.setTimeBucket(newApplicationComponent.getTimeBucket());
- return newApplicationComponent;
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayPersistenceWorker.java
deleted file mode 100644
index 0311eff6b375fc32bdc2194a5d49099b20894caa..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayPersistenceWorker.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentDayPersistenceWorker extends MergePersistenceWorker {
-
- private ApplicationComponentDayPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_COMPONENT_DAY_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationComponent> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationComponentDayPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationComponentDayPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationComponentDayPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationComponentTable.TABLE + "/day")
- @Override protected void onWork(ApplicationComponent input) {
- super.onWork(input);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayTransformNode.java
deleted file mode 100644
index ff72a0f1f64d02aa779644e5b3d15cacc06731bb..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayTransformNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentDayTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_COMPONENT_DAY_TRANSFORM_NODE_ID;
- }
-
- @Override
- public void process(ApplicationComponent applicationComponent, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(applicationComponent.getTimeBucket());
-
- ApplicationComponent newApplicationComponent = ApplicationComponentCopy.copy(applicationComponent);
- newApplicationComponent.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationComponent.getMetricId());
- newApplicationComponent.setTimeBucket(timeBucket);
- next.execute(newApplicationComponent);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentGraph.java
deleted file mode 100644
index 07370b779e983c38d409c3ccfb8d87f343bddbb3..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentGraph.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Node;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.RemoteModule;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public ApplicationComponentGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
-
- Node remoteNode = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.APPLICATION_COMPONENT_GRAPH_ID, ApplicationComponent.class)
- .addNode(new ApplicationComponentMinuteAggregationWorker.Factory(moduleManager).create(workerCreateListener))
- .addNext(new ApplicationComponentMinuteRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.APPLICATION_COMPONENT_GRAPH_ID).create(workerCreateListener));
-
- remoteNode.addNext(new ApplicationComponentMinutePersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- remoteNode.addNext(new ApplicationComponentHourTransformNode())
- .addNext(new ApplicationComponentHourPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- remoteNode.addNext(new ApplicationComponentDayTransformNode())
- .addNext(new ApplicationComponentDayPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- remoteNode.addNext(new ApplicationComponentMonthTransformNode())
- .addNext(new ApplicationComponentMonthPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourPersistenceWorker.java
deleted file mode 100644
index b050b5927a855c1485b36d98cd88d6c5d37aef36..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourPersistenceWorker.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentHourPersistenceWorker extends MergePersistenceWorker {
-
- private ApplicationComponentHourPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_COMPONENT_HOUR_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationComponent> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationComponentHourPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationComponentHourPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationComponentHourPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationComponentTable.TABLE + "/hour")
- @Override protected void onWork(ApplicationComponent input) {
- super.onWork(input);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourTransformNode.java
deleted file mode 100644
index 6c90cb65e7fb45197fbeed17828ff75ce883a428..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourTransformNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentHourTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_COMPONENT_HOUR_TRANSFORM_NODE_ID;
- }
-
- @Override
- public void process(ApplicationComponent applicationComponent, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(applicationComponent.getTimeBucket());
-
- ApplicationComponent newApplicationComponent = ApplicationComponentCopy.copy(applicationComponent);
- newApplicationComponent.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationComponent.getMetricId());
- newApplicationComponent.setTimeBucket(timeBucket);
- next.execute(newApplicationComponent);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteAggregationWorker.java
deleted file mode 100644
index 3ca4287b3b350f030b6f96a16128150a493f473e..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteAggregationWorker.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker;
-import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentMinuteAggregationWorker extends AggregationWorker {
-
- private ApplicationComponentMinuteAggregationWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_COMPONENT_MINUTE_AGGREGATION_WORKER_ID;
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationComponentMinuteAggregationWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationComponentMinuteAggregationWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- @GraphComputingMetric(name = "/aggregation/onWork/" + ApplicationComponentTable.TABLE)
- @Override protected void onWork(ApplicationComponent message) throws WorkerException {
- super.onWork(message);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinutePersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinutePersistenceWorker.java
deleted file mode 100644
index a01b128f6ef3502579c738a82224f840ffbd9b69..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinutePersistenceWorker.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentMinutePersistenceWorker extends MergePersistenceWorker {
-
- private ApplicationComponentMinutePersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_COMPONENT_MINUTE_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationComponent> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationComponentMinutePersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationComponentMinutePersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationComponentMinutePersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationComponentTable.TABLE + "/minute")
- @Override protected void onWork(ApplicationComponent message) {
- super.onWork(message);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteRemoteWorker.java
deleted file mode 100644
index 71c6caff4bdcb2fc1b2957e89056ba4d02e8d05e..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteRemoteWorker.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.remote.service.Selector;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentMinuteRemoteWorker extends AbstractRemoteWorker {
-
- private ApplicationComponentMinuteRemoteWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_COMPONENT_MINUTE_REMOTE_WORKER_ID;
- }
-
- @Override protected void onWork(ApplicationComponent applicationComponent) {
- onNext(applicationComponent);
- }
-
- @Override public Selector selector() {
- return Selector.HashCode;
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
-
- public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) {
- super(moduleManager, remoteSenderService, graphId);
- }
-
- @Override public ApplicationComponentMinuteRemoteWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationComponentMinuteRemoteWorker(moduleManager);
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthPersistenceWorker.java
deleted file mode 100644
index 5ef244348f08c3df7b71e8823f74363239eecfbc..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthPersistenceWorker.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMonthPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentMonthPersistenceWorker extends MergePersistenceWorker {
-
- private ApplicationComponentMonthPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_COMPONENT_MONTH_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationComponent> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationComponentMonthPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationComponentMonthPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationComponentMonthPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationComponentTable.TABLE + "/month")
- @Override protected void onWork(ApplicationComponent message) {
- super.onWork(message);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthTransformNode.java
deleted file mode 100644
index 35ee9fe630c0fceeb1c93509578c5baa4e67f362..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthTransformNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentMonthTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_COMPONENT_MONTH_TRANSFORM_NODE_ID;
- }
-
- @Override
- public void process(ApplicationComponent applicationComponent, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(applicationComponent.getTimeBucket());
-
- ApplicationComponent newApplicationComponent = ApplicationComponentCopy.copy(applicationComponent);
- newApplicationComponent.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationComponent.getMetricId());
- newApplicationComponent.setTimeBucket(timeBucket);
- next.execute(newApplicationComponent);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java
deleted file mode 100644
index 4511305ae317c63fa9b3e1318ba250274138f19e..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component;
-
-import java.util.*;
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*;
-import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.*;
-import org.apache.skywalking.apm.collector.cache.CacheModule;
-import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
-import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric;
-import org.apache.skywalking.apm.collector.core.graph.*;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationComponentSpanListener implements EntrySpanListener, ExitSpanListener {
-
- private final ApplicationCacheService applicationCacheService;
- private final List applicationComponents = new LinkedList<>();
-
- private ApplicationComponentSpanListener(ModuleManager moduleManager) {
- this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class);
- }
-
- @Override public boolean containsPoint(Point point) {
- return Point.Entry.equals(point) || Point.Exit.equals(point);
- }
-
- @Override
- public void parseExit(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) {
- int applicationIdFromPeerId = applicationCacheService.getApplicationIdByAddressId(spanDecorator.getPeerId());
-
- String metricId = applicationIdFromPeerId + Const.ID_SPLIT + String.valueOf(spanDecorator.getComponentId());
-
- ApplicationComponent applicationComponent = new ApplicationComponent();
- applicationComponent.setMetricId(metricId);
- applicationComponent.setComponentId(spanDecorator.getComponentId());
- applicationComponent.setApplicationId(applicationIdFromPeerId);
- applicationComponent.setId(segmentCoreInfo.getMinuteTimeBucket() + Const.ID_SPLIT + applicationComponent.getMetricId());
- applicationComponent.setTimeBucket(segmentCoreInfo.getMinuteTimeBucket());
- applicationComponents.add(applicationComponent);
- }
-
- @Override
- public void parseEntry(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) {
- String metricId = String.valueOf(segmentCoreInfo.getApplicationId()) + Const.ID_SPLIT + String.valueOf(spanDecorator.getComponentId());
-
- ApplicationComponent applicationComponent = new ApplicationComponent();
- applicationComponent.setMetricId(metricId);
- applicationComponent.setComponentId(spanDecorator.getComponentId());
- applicationComponent.setApplicationId(segmentCoreInfo.getApplicationId());
- applicationComponent.setId(segmentCoreInfo.getMinuteTimeBucket() + Const.ID_SPLIT + applicationComponent.getMetricId());
- applicationComponent.setTimeBucket(segmentCoreInfo.getMinuteTimeBucket());
- applicationComponents.add(applicationComponent);
- }
-
- @Override public void build() {
- Graph graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.APPLICATION_COMPONENT_GRAPH_ID, ApplicationComponent.class);
- applicationComponents.forEach(graph::start);
- }
-
- public static class Factory implements SpanListenerFactory {
-
- @GraphComputingMetric(name = "/segment/parse/createSpanListeners/applicationComponentSpanListener")
- @Override public SpanListener create(ModuleManager moduleManager) {
- return new ApplicationComponentSpanListener(moduleManager);
- }
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingCopy.java
deleted file mode 100644
index 3797f1d5fa0646bb7708601297039c7c0577a900..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingCopy.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping;
-
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMappingCopy {
-
- public static ApplicationMapping copy(ApplicationMapping applicationMapping) {
- ApplicationMapping newApplicationMapping = new ApplicationMapping();
- newApplicationMapping.setId(applicationMapping.getId());
- newApplicationMapping.setMetricId(applicationMapping.getMetricId());
- newApplicationMapping.setTimeBucket(applicationMapping.getTimeBucket());
-
- newApplicationMapping.setApplicationId(applicationMapping.getApplicationId());
- newApplicationMapping.setMappingApplicationId(applicationMapping.getMappingApplicationId());
- return newApplicationMapping;
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayPersistenceWorker.java
deleted file mode 100644
index 3c5478bfcced6ec71084cc0926d52ed1dd9e2a00..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayPersistenceWorker.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingDayPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMappingDayPersistenceWorker extends MergePersistenceWorker {
-
- private ApplicationMappingDayPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_MAPPING_DAY_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationMapping> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationMappingDayPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider {
-
- public Factory(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public ApplicationMappingDayPersistenceWorker workerInstance(ModuleManager moduleManager) {
- return new ApplicationMappingDayPersistenceWorker(moduleManager);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationMappingTable.TABLE + "/day")
- @Override protected void onWork(ApplicationMapping input) {
- super.onWork(input);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayTransformNode.java
deleted file mode 100644
index a4b84b1c3fd43fa54beb5acd4ba261a849d586a5..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayTransformNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.core.graph.Next;
-import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMappingDayTransformNode implements NodeProcessor {
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_MAPPING_DAY_TRANSFORM_NODE_ID;
- }
-
- @Override
- public void process(ApplicationMapping applicationMapping, Next next) {
- long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(applicationMapping.getTimeBucket());
-
- ApplicationMapping newApplicationMapping = ApplicationMappingCopy.copy(applicationMapping);
- newApplicationMapping.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationMapping.getMetricId());
- newApplicationMapping.setTimeBucket(timeBucket);
- next.execute(newApplicationMapping);
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingGraph.java
deleted file mode 100644
index 4ed6857c8c4bc0bb2888f3457e7b1c8ad666d06d..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingGraph.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
-import org.apache.skywalking.apm.collector.core.graph.GraphManager;
-import org.apache.skywalking.apm.collector.core.graph.Node;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.remote.RemoteModule;
-import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMappingGraph {
-
- private final ModuleManager moduleManager;
- private final WorkerCreateListener workerCreateListener;
-
- public ApplicationMappingGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
- this.moduleManager = moduleManager;
- this.workerCreateListener = workerCreateListener;
- }
-
- public void create() {
- RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
-
- Node remoteNode = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.APPLICATION_MAPPING_GRAPH_ID, ApplicationMapping.class)
- .addNode(new ApplicationMappingMinuteAggregationWorker.Factory(moduleManager).create(workerCreateListener))
- .addNext(new ApplicationMappingMinuteRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.APPLICATION_MAPPING_GRAPH_ID).create(workerCreateListener));
-
- remoteNode.addNext(new ApplicationMappingMinutePersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- remoteNode.addNext(new ApplicationMappingHourTransformNode())
- .addNext(new ApplicationMappingHourPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- remoteNode.addNext(new ApplicationMappingDayTransformNode())
- .addNext(new ApplicationMappingDayPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
-
- remoteNode.addNext(new ApplicationMappingMonthTransformNode())
- .addNext(new ApplicationMappingMonthPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
- }
-}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourPersistenceWorker.java
deleted file mode 100644
index fb67780c582e4531ff7c8ac689f6324f526cb118..0000000000000000000000000000000000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourPersistenceWorker.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping;
-
-import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker;
-import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider;
-import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingHourPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationMappingHourPersistenceWorker extends MergePersistenceWorker {
-
- private ApplicationMappingHourPersistenceWorker(ModuleManager moduleManager) {
- super(moduleManager);
- }
-
- @Override public int id() {
- return MetricWorkerIdDefine.APPLICATION_MAPPING_HOUR_PERSISTENCE_WORKER_ID;
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override protected IPersistenceDAO, ?, ApplicationMapping> persistenceDAO() {
- return getModuleManager().find(StorageModule.NAME).getService(IApplicationMappingHourPersistenceDAO.class);
- }
-
- public static class Factory extends MergePersistenceWorkerProvider