From 03537166cd94afbe8120851439081e5f90541183 Mon Sep 17 00:00:00 2001 From: peng-yongsheng <8082209@qq.com> Date: Sun, 26 Nov 2017 21:07:20 +0800 Subject: [PATCH] Create the configuration module. --- .../collector-configuration-define/pom.xml | 33 +++++++++++ .../configuration/ConfigurationModule.java | 38 +++++++++++++ .../service/IApdexThresholdService.java | 35 ++++++++++++ ...kywalking.apm.collector.core.module.Module | 19 +++++++ .../collector-configuration-provider/pom.xml | 40 +++++++++++++ .../ConfigurationModuleProvider.java | 56 +++++++++++++++++++ .../service/ApdexThresholdService.java | 35 ++++++++++++ ...g.apm.collector.core.module.ModuleProvider | 19 +++++++ .../apm-collector-configuration/pom.xml | 44 +++++++++++++++ .../main/resources/application-default.yml | 2 + apm-collector/pom.xml | 1 + 11 files changed, 322 insertions(+) create mode 100644 apm-collector/apm-collector-configuration/collector-configuration-define/pom.xml create mode 100644 apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/skywalking/apm/collector/configuration/ConfigurationModule.java create mode 100644 apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/skywalking/apm/collector/configuration/service/IApdexThresholdService.java create mode 100644 apm-collector/apm-collector-configuration/collector-configuration-define/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.Module create mode 100644 apm-collector/apm-collector-configuration/collector-configuration-provider/pom.xml create mode 100644 apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java create mode 100644 apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/skywalking/apm/collector/configuration/service/ApdexThresholdService.java create mode 100644 apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider create mode 100644 apm-collector/apm-collector-configuration/pom.xml diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/pom.xml b/apm-collector/apm-collector-configuration/collector-configuration-define/pom.xml new file mode 100644 index 0000000000..3d3db6f87f --- /dev/null +++ b/apm-collector/apm-collector-configuration/collector-configuration-define/pom.xml @@ -0,0 +1,33 @@ + + + + + + apm-collector-configuration + org.skywalking + 3.3.0-2017 + + 4.0.0 + + collector-configuration-define + jar + + \ No newline at end of file diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/skywalking/apm/collector/configuration/ConfigurationModule.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/skywalking/apm/collector/configuration/ConfigurationModule.java new file mode 100644 index 0000000000..138e95616c --- /dev/null +++ b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/skywalking/apm/collector/configuration/ConfigurationModule.java @@ -0,0 +1,38 @@ +/* + * Copyright 2017, OpenSkywalking Organization All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Project repository: https://github.com/OpenSkywalking/skywalking + */ + +package org.skywalking.apm.collector.configuration; + +import org.skywalking.apm.collector.configuration.service.IApdexThresholdService; +import org.skywalking.apm.collector.core.module.Module; + +/** + * @author peng-yongsheng + */ +public class ConfigurationModule extends Module { + + public static final String NAME = "configuration"; + + @Override public String name() { + return NAME; + } + + @Override public Class[] services() { + return new Class[] {IApdexThresholdService.class}; + } +} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/skywalking/apm/collector/configuration/service/IApdexThresholdService.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/skywalking/apm/collector/configuration/service/IApdexThresholdService.java new file mode 100644 index 0000000000..57a56549fb --- /dev/null +++ b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/skywalking/apm/collector/configuration/service/IApdexThresholdService.java @@ -0,0 +1,35 @@ +/* + * Copyright 2017, OpenSkywalking Organization All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Project repository: https://github.com/OpenSkywalking/skywalking + */ + +package org.skywalking.apm.collector.configuration.service; + +import org.skywalking.apm.collector.core.module.Service; + +/** + * @author peng-yongsheng + */ +public interface IApdexThresholdService extends Service { + + /** + * Apdex T applies to web transactions only + * + * @param applicationId + * @return This value is in milli-seconds. + */ + Integer getApplicationApdexThreshold(int applicationId); +} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.Module b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.Module new file mode 100644 index 0000000000..71c8273d3a --- /dev/null +++ b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.Module @@ -0,0 +1,19 @@ +# +# Copyright 2017, OpenSkywalking Organization All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Project repository: https://github.com/OpenSkywalking/skywalking +# + +org.skywalking.apm.collector.configuration.ConfigurationModule \ No newline at end of file diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/pom.xml b/apm-collector/apm-collector-configuration/collector-configuration-provider/pom.xml new file mode 100644 index 0000000000..69c7045f67 --- /dev/null +++ b/apm-collector/apm-collector-configuration/collector-configuration-provider/pom.xml @@ -0,0 +1,40 @@ + + + + + + apm-collector-configuration + org.skywalking + 3.3.0-2017 + + 4.0.0 + + collector-configuration-provider + jar + + + + org.skywalking + collector-configuration-define + ${project.version} + + + \ No newline at end of file diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java new file mode 100644 index 0000000000..f89e49ce7d --- /dev/null +++ b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java @@ -0,0 +1,56 @@ +/* + * Copyright 2017, OpenSkywalking Organization All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Project repository: https://github.com/OpenSkywalking/skywalking + */ + +package org.skywalking.apm.collector.configuration; + +import java.util.Properties; +import org.skywalking.apm.collector.configuration.service.ApdexThresholdService; +import org.skywalking.apm.collector.configuration.service.IApdexThresholdService; +import org.skywalking.apm.collector.core.module.Module; +import org.skywalking.apm.collector.core.module.ModuleProvider; +import org.skywalking.apm.collector.core.module.ServiceNotProvidedException; + +/** + * @author peng-yongsheng + */ +public class ConfigurationModuleProvider extends ModuleProvider { + + @Override public String name() { + return "default"; + } + + @Override public Class module() { + return ConfigurationModule.class; + } + + @Override public void prepare(Properties config) throws ServiceNotProvidedException { + this.registerServiceImplementation(IApdexThresholdService.class, new ApdexThresholdService()); + } + + @Override public void start(Properties config) throws ServiceNotProvidedException { + + } + + @Override public void notifyAfterCompleted() throws ServiceNotProvidedException { + + } + + @Override public String[] requiredModules() { + return new String[0]; + } +} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/skywalking/apm/collector/configuration/service/ApdexThresholdService.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/skywalking/apm/collector/configuration/service/ApdexThresholdService.java new file mode 100644 index 0000000000..e7c8b5254a --- /dev/null +++ b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/skywalking/apm/collector/configuration/service/ApdexThresholdService.java @@ -0,0 +1,35 @@ +/* + * Copyright 2017, OpenSkywalking Organization All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Project repository: https://github.com/OpenSkywalking/skywalking + */ + +package org.skywalking.apm.collector.configuration.service; + +/** + * @author peng-yongsheng + */ +public class ApdexThresholdService implements IApdexThresholdService { + + /** + * Apdex T applies to web transactions only + * + * @param applicationId + * @return This value is in milli-seconds. + */ + @Override public Integer getApplicationApdexThreshold(int applicationId) { + return 500; + } +} \ No newline at end of file diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider new file mode 100644 index 0000000000..5949a52f9e --- /dev/null +++ b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider @@ -0,0 +1,19 @@ +# +# Copyright 2017, OpenSkywalking Organization All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Project repository: https://github.com/OpenSkywalking/skywalking +# + +org.skywalking.apm.collector.configuration.ConfigurationModuleProvider \ No newline at end of file diff --git a/apm-collector/apm-collector-configuration/pom.xml b/apm-collector/apm-collector-configuration/pom.xml new file mode 100644 index 0000000000..1f5ccaf0fd --- /dev/null +++ b/apm-collector/apm-collector-configuration/pom.xml @@ -0,0 +1,44 @@ + + + + + + apm-collector + org.skywalking + 3.3.0-2017 + + 4.0.0 + + apm-collector-configuration + pom + + collector-configuration-define + collector-configuration-provider + + + + + org.skywalking + apm-collector-core + ${project.version} + + + \ No newline at end of file diff --git a/apm-collector/apm-collector-core/src/main/resources/application-default.yml b/apm-collector/apm-collector-core/src/main/resources/application-default.yml index 3fb433933c..4ecad1dbb9 100644 --- a/apm-collector/apm-collector-core/src/main/resources/application-default.yml +++ b/apm-collector/apm-collector-core/src/main/resources/application-default.yml @@ -29,6 +29,8 @@ agent_stream: buffer_file_path: ../buffer/ buffer_offset_max_file_size: 10M buffer_segment_max_file_size: 500M +configuration: + default: ui: jetty: host: localhost diff --git a/apm-collector/pom.xml b/apm-collector/pom.xml index 7fb2c989c2..7bbbbf3670 100644 --- a/apm-collector/pom.xml +++ b/apm-collector/pom.xml @@ -50,6 +50,7 @@ apm-collector-agent-jetty apm-collector-agent-stream apm-collector-alerting + apm-collector-configuration -- GitLab