peng-yongsheng closed pull request #1161: Rename thermodynamic attributes. URL: https://github.com/apache/incubator-skywalking/pull/1161
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListener.java index 1d1092cb9..ea14849fb 100644 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListener.java +++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListener.java @@ -73,11 +73,11 @@ public void parseFirst(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreI } int getStep(int duration) { - int responseTimeMaxStep = configService.getResponseTimeStep() * configService.getResponseTimeMaxStep(); + int countOfResponseTimeSteps = configService.getResponseTimeStep() * configService.getCountOfResponseTimeSteps(); int responseTimeStep = configService.getResponseTimeStep(); - if (duration > responseTimeMaxStep) { - return responseTimeMaxStep / responseTimeStep; + if (duration > countOfResponseTimeSteps) { + return countOfResponseTimeSteps / responseTimeStep; } else if (duration <= responseTimeStep) { return 0; } else { diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListenerTestCase.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListenerTestCase.java index a003e273d..c059f17a0 100644 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListenerTestCase.java +++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListenerTestCase.java @@ -42,7 +42,7 @@ public void testStep() { IResponseTimeDistributionConfigService service = Mockito.mock(IResponseTimeDistributionConfigService.class); Mockito.when(service.getResponseTimeStep()).thenReturn(50); - Mockito.when(service.getResponseTimeMaxStep()).thenReturn(40); + Mockito.when(service.getCountOfResponseTimeSteps()).thenReturn(40); Module module = Mockito.mock(Module.class); Whitebox.setInternalState(module, "loadedProviders", loadedProviders); diff --git a/apm-collector/apm-collector-boot/src/main/resources/application.yml b/apm-collector/apm-collector-boot/src/main/resources/application.yml index 437e6f48f..b5fa4b849 100644 --- a/apm-collector/apm-collector-boot/src/main/resources/application.yml +++ b/apm-collector/apm-collector-boot/src/main/resources/application.yml @@ -75,10 +75,14 @@ storage: configuration: default: # namespace: xxxxx +# alarm threshold applicationApdexThreshold: 2000 serviceErrorRateThreshold: 10.00 serviceAverageResponseTimeThreshold: 2000 instanceErrorRateThreshold: 10.00 instanceAverageResponseTimeThreshold: 2000 applicationErrorRateThreshold: 10.00 - applicationAverageResponseTimeThreshold: 2000 \ No newline at end of file + applicationAverageResponseTimeThreshold: 2000 +# thermodynamic + thermodynamicResponseTimeStep: 50 + thermodynamicCountOfResponseTimeSteps: 40 \ No newline at end of file diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IResponseTimeDistributionConfigService.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IResponseTimeDistributionConfigService.java index 08047fac2..7cec4c441 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IResponseTimeDistributionConfigService.java +++ b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IResponseTimeDistributionConfigService.java @@ -27,5 +27,5 @@ int getResponseTimeStep(); - int getResponseTimeMaxStep(); + int getCountOfResponseTimeSteps(); } diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleConfig.java index 7d836a29e..1b2ac6c97 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleConfig.java +++ b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleConfig.java @@ -33,8 +33,8 @@ private int instanceAverageResponseTimeThreshold; private double applicationErrorRateThreshold; private int applicationAverageResponseTimeThreshold; - private int responseTimeDistributionDuration; - private int responseTimeDistributionMaxDurationns; + private int thermodynamicResponseTimeStep; + private int thermodynamicCountOfResponseTimeSteps; public String getNamespace() { return namespace; @@ -100,19 +100,19 @@ public void setApplicationAverageResponseTimeThreshold(int applicationAverageRes this.applicationAverageResponseTimeThreshold = applicationAverageResponseTimeThreshold; } - public int getResponseTimeDistributionDuration() { - return responseTimeDistributionDuration; + public int getThermodynamicResponseTimeStep() { + return thermodynamicResponseTimeStep; } - public void setResponseTimeDistributionDuration(int responseTimeDistributionDuration) { - this.responseTimeDistributionDuration = responseTimeDistributionDuration; + public void setThermodynamicResponseTimeStep(int thermodynamicResponseTimeStep) { + this.thermodynamicResponseTimeStep = thermodynamicResponseTimeStep; } - public int getResponseTimeDistributionMaxDurationns() { - return responseTimeDistributionMaxDurationns; + public int getThermodynamicCountOfResponseTimeSteps() { + return thermodynamicCountOfResponseTimeSteps; } - public void setResponseTimeDistributionMaxDurationns(int responseTimeDistributionMaxDurationns) { - this.responseTimeDistributionMaxDurationns = responseTimeDistributionMaxDurationns; + public void setThermodynamicCountOfResponseTimeSteps(int thermodynamicCountOfResponseTimeSteps) { + this.thermodynamicCountOfResponseTimeSteps = thermodynamicCountOfResponseTimeSteps; } } diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java index 9cfba732e..d3b49562f 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java +++ b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java @@ -18,32 +18,9 @@ package org.apache.skywalking.apm.collector.configuration; -import org.apache.skywalking.apm.collector.configuration.service.ApdexThresholdService; -import org.apache.skywalking.apm.collector.configuration.service.ApplicationAlarmRuleConfig; -import org.apache.skywalking.apm.collector.configuration.service.ApplicationReferenceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.configuration.service.CollectorConfigService; -import org.apache.skywalking.apm.collector.configuration.service.ComponentLibraryCatalogService; -import org.apache.skywalking.apm.collector.configuration.service.IApdexThresholdService; -import org.apache.skywalking.apm.collector.configuration.service.IApplicationAlarmRuleConfig; -import org.apache.skywalking.apm.collector.configuration.service.IApplicationReferenceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.configuration.service.ICollectorConfig; -import org.apache.skywalking.apm.collector.configuration.service.IComponentLibraryCatalogService; -import org.apache.skywalking.apm.collector.configuration.service.IInstanceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.configuration.service.IInstanceReferenceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.configuration.service.IResponseTimeDistributionConfigService; -import org.apache.skywalking.apm.collector.configuration.service.IServiceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.configuration.service.IServiceReferenceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.configuration.service.InstanceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.configuration.service.InstanceReferenceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.configuration.service.ResponseTimeDistributionConfigService; -import org.apache.skywalking.apm.collector.configuration.service.ServiceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.configuration.service.ServiceReferenceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.core.module.Module; -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.configuration.service.*; +import org.apache.skywalking.apm.collector.core.module.*; +import org.apache.skywalking.apm.collector.core.util.*; /** * @author peng-yongsheng @@ -79,8 +56,8 @@ public ConfigurationModuleProvider() { double applicationErrorRateThreshold = config.getApplicationErrorRateThreshold() == 0 ? 10.00 : config.getApplicationErrorRateThreshold(); int applicationAverageResponseTimeThreshold = config.getApplicationAverageResponseTimeThreshold() == 0 ? 2000 : config.getApplicationAverageResponseTimeThreshold(); - int responseTimeDistributionDuration = config.getResponseTimeDistributionDuration() == 0 ? 50 : config.getResponseTimeDistributionDuration(); - int responseTimeDistributionMaxDurations = config.getResponseTimeDistributionMaxDurationns() == 0 ? 40 : config.getResponseTimeDistributionMaxDurationns(); + int thermodynamicResponseTimeStep = config.getThermodynamicResponseTimeStep() == 0 ? 50 : config.getThermodynamicResponseTimeStep(); + int thermodynamicCountOfResponseTimeSteps = config.getThermodynamicCountOfResponseTimeSteps() == 0 ? 40 : config.getThermodynamicCountOfResponseTimeSteps(); this.registerServiceImplementation(ICollectorConfig.class, new CollectorConfigService(namespace)); this.registerServiceImplementation(IComponentLibraryCatalogService.class, new ComponentLibraryCatalogService()); @@ -91,7 +68,7 @@ public ConfigurationModuleProvider() { this.registerServiceImplementation(IServiceReferenceAlarmRuleConfig.class, new ServiceReferenceAlarmRuleConfig(serviceErrorRateThreshold, serviceAverageResponseTimeThreshold)); this.registerServiceImplementation(IInstanceReferenceAlarmRuleConfig.class, new InstanceReferenceAlarmRuleConfig(instanceErrorRateThreshold, instanceAverageResponseTimeThreshold)); this.registerServiceImplementation(IApplicationReferenceAlarmRuleConfig.class, new ApplicationReferenceAlarmRuleConfig(applicationErrorRateThreshold, applicationAverageResponseTimeThreshold)); - this.registerServiceImplementation(IResponseTimeDistributionConfigService.class, new ResponseTimeDistributionConfigService(responseTimeDistributionDuration, responseTimeDistributionMaxDurations)); + this.registerServiceImplementation(IResponseTimeDistributionConfigService.class, new ResponseTimeDistributionConfigService(thermodynamicResponseTimeStep, thermodynamicCountOfResponseTimeSteps)); } @Override public void start() { diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ResponseTimeDistributionConfigService.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ResponseTimeDistributionConfigService.java index 4201abd14..cc50be2d8 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ResponseTimeDistributionConfigService.java +++ b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ResponseTimeDistributionConfigService.java @@ -24,18 +24,18 @@ public class ResponseTimeDistributionConfigService implements IResponseTimeDistributionConfigService { private final int responseTimeStep; - private final int responseTimeMaxStep; + private final int countOfResponseTimeSteps; - public ResponseTimeDistributionConfigService(int responseTimeStep, int responseTimeMaxStep) { + public ResponseTimeDistributionConfigService(int responseTimeStep, int countOfResponseTimeSteps) { this.responseTimeStep = responseTimeStep; - this.responseTimeMaxStep = responseTimeMaxStep + 1; + this.countOfResponseTimeSteps = countOfResponseTimeSteps + 1; } @Override public int getResponseTimeStep() { return responseTimeStep; } - @Override public int getResponseTimeMaxStep() { - return responseTimeMaxStep; + @Override public int getCountOfResponseTimeSteps() { + return countOfResponseTimeSteps; } } diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ResponseTimeDistributionService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ResponseTimeDistributionService.java index 86d6c197b..51dd45bb3 100644 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ResponseTimeDistributionService.java +++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ResponseTimeDistributionService.java @@ -51,7 +51,7 @@ public Thermodynamic getThermodynamic(Step step, long startTimeBucket, long endT List<IResponseTimeDistributionUIDAO.ResponseTimeStep> responseTimeSteps = new LinkedList<>(); for (int i = 0; i < durationPoints.size(); i++) { - for (int j = 0; j < responseTimeDistributionConfigService.getResponseTimeMaxStep(); j++) { + for (int j = 0; j < responseTimeDistributionConfigService.getCountOfResponseTimeSteps(); j++) { responseTimeSteps.add(new IResponseTimeDistributionUIDAO.ResponseTimeStep(durationPoints.get(i).getPoint(), i, j)); } } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services