diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java index d918f85696549ea52f8b5934680292e720f610c5..62a329ec8ab7702945fd91b1e562a117f5bbfa90 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java @@ -33,8 +33,23 @@ public class CoreModuleConfig extends ModuleConfig { @Setter private String gRPCHost; @Setter private int gRPCPort; private final List downsampling; + @Setter private int recordDataTTL; + @Setter private int minuteMetricsDataTTL; + @Setter private int hourMetricsDataTTL; + @Setter private int dayMetricsDataTTL; + @Setter private int monthMetricsDataTTL; CoreModuleConfig() { this.downsampling = new ArrayList<>(); } + + public DataTTL getDataTTL() { + DataTTL dataTTL = new DataTTL(); + dataTTL.setRecordDataTTL(recordDataTTL); + dataTTL.setMinuteMetricsDataTTL(minuteMetricsDataTTL); + dataTTL.setHourMetricsDataTTL(hourMetricsDataTTL); + dataTTL.setDayMetricsDataTTL(dayMetricsDataTTL); + dataTTL.setMonthMetricsDataTTL(monthMetricsDataTTL); + return dataTTL; + } } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java index 1f85ce243621f44889065bae8aba921efb4455a1..2ed633dfe7025e551b33d6393e58392219452347 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java @@ -36,6 +36,7 @@ import org.apache.skywalking.oap.server.core.source.*; import org.apache.skywalking.oap.server.core.storage.PersistenceTimer; import org.apache.skywalking.oap.server.core.storage.annotation.StorageAnnotationListener; import org.apache.skywalking.oap.server.core.storage.model.IModelGetter; +import org.apache.skywalking.oap.server.core.storage.ttl.DataTTLKeeperTimer; import org.apache.skywalking.oap.server.library.module.*; import org.apache.skywalking.oap.server.library.server.ServerException; import org.apache.skywalking.oap.server.library.server.grpc.GRPCServer; @@ -154,6 +155,9 @@ public class CoreModuleProvider extends ModuleProvider { this.getManager().find(ClusterModule.NAME).getService(ClusterRegister.class).registerRemote(gRPCServerInstance); PersistenceTimer.INSTANCE.start(getManager()); + + DataTTLKeeperTimer.INSTANCE.setDataTTL(moduleConfig.getDataTTL()); + DataTTLKeeperTimer.INSTANCE.start(getManager()); } @Override diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/DataTTL.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/DataTTL.java new file mode 100644 index 0000000000000000000000000000000000000000..a9a0de1af4caf41a602fdf4804e49feb82f837bc --- /dev/null +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/DataTTL.java @@ -0,0 +1,34 @@ +/* + * 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.oap.server.core; + +import lombok.*; + +/** + * @author peng-yongsheng + */ +@Setter +@Getter +public class DataTTL { + private int recordDataTTL; + private int minuteMetricsDataTTL; + private int hourMetricsDataTTL; + private int dayMetricsDataTTL; + private int monthMetricsDataTTL; +} diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllHeatmapIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllHeatmapIndicator.java index fc0947b0a11d9f83a669da9ca353793f8af92777..a020a42ac6c9a4eed6bc050fb2f60e5f2b4e08ad 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllHeatmapIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllHeatmapIndicator.java @@ -51,7 +51,6 @@ public class AllHeatmapIndicator extends ThermodynamicIndicator implements Alarm return result; } - @Override public int remoteHashCode() { int result = 17; return result; @@ -108,30 +107,36 @@ public class AllHeatmapIndicator extends ThermodynamicIndicator implements Alarm @Override public Indicator toHour() { AllHeatmapIndicator indicator = new AllHeatmapIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setStep(this.getStep()); indicator.setNumOfSteps(this.getNumOfSteps()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { AllHeatmapIndicator indicator = new AllHeatmapIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setStep(this.getStep()); indicator.setNumOfSteps(this.getNumOfSteps()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { AllHeatmapIndicator indicator = new AllHeatmapIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setStep(this.getStep()); indicator.setNumOfSteps(this.getNumOfSteps()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP50Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP50Indicator.java index 0220536e1a1976eb73969b0d649681b8d6042d19..a30bcc1f5e78825f13e949342c83cc66c740859a 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP50Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP50Indicator.java @@ -51,7 +51,6 @@ public class AllP50Indicator extends P50Indicator implements AlarmSupported { return result; } - @Override public int remoteHashCode() { int result = 17; return result; @@ -108,30 +107,36 @@ public class AllP50Indicator extends P50Indicator implements AlarmSupported { @Override public Indicator toHour() { AllP50Indicator indicator = new AllP50Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { AllP50Indicator indicator = new AllP50Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { AllP50Indicator indicator = new AllP50Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP75Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP75Indicator.java index 09fc0687eb1969812e4a7eefd3f63ca22e6fd0d4..21a3f94c1f8dabb28cad090f8e40086a65d34742 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP75Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP75Indicator.java @@ -51,7 +51,6 @@ public class AllP75Indicator extends P75Indicator implements AlarmSupported { return result; } - @Override public int remoteHashCode() { int result = 17; return result; @@ -108,30 +107,36 @@ public class AllP75Indicator extends P75Indicator implements AlarmSupported { @Override public Indicator toHour() { AllP75Indicator indicator = new AllP75Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { AllP75Indicator indicator = new AllP75Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { AllP75Indicator indicator = new AllP75Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP90Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP90Indicator.java index 12f39edc31650ff1dadab91c7d9c453b63ef7ed1..66f6fe2c1936ff6335e6fc789278c566f55bb5ef 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP90Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP90Indicator.java @@ -51,7 +51,6 @@ public class AllP90Indicator extends P90Indicator implements AlarmSupported { return result; } - @Override public int remoteHashCode() { int result = 17; return result; @@ -108,30 +107,36 @@ public class AllP90Indicator extends P90Indicator implements AlarmSupported { @Override public Indicator toHour() { AllP90Indicator indicator = new AllP90Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { AllP90Indicator indicator = new AllP90Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { AllP90Indicator indicator = new AllP90Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP95Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP95Indicator.java index 64f3734fa60a22791a59495c32a9c336ac3ebe58..3c651a77ba145b51cf176df414da148e02ec6ca8 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP95Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP95Indicator.java @@ -51,7 +51,6 @@ public class AllP95Indicator extends P95Indicator implements AlarmSupported { return result; } - @Override public int remoteHashCode() { int result = 17; return result; @@ -108,30 +107,36 @@ public class AllP95Indicator extends P95Indicator implements AlarmSupported { @Override public Indicator toHour() { AllP95Indicator indicator = new AllP95Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { AllP95Indicator indicator = new AllP95Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { AllP95Indicator indicator = new AllP95Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP99Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP99Indicator.java index f9054a3d1002d8ad7839f31b142547b7b0b5a7b4..69c5a0bb0836fadec12f97b83b74b3d47675793f 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP99Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/all/AllP99Indicator.java @@ -51,7 +51,6 @@ public class AllP99Indicator extends P99Indicator implements AlarmSupported { return result; } - @Override public int remoteHashCode() { int result = 17; return result; @@ -108,30 +107,36 @@ public class AllP99Indicator extends P99Indicator implements AlarmSupported { @Override public Indicator toHour() { AllP99Indicator indicator = new AllP99Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { AllP99Indicator indicator = new AllP99Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { AllP99Indicator indicator = new AllP99Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointAvgIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointAvgIndicator.java index 41b270c919b57bbe6dc576b8d4c34616ebbba745..586ebd4f16539e5d8861906e456ef5ed2e6a0245 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointAvgIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointAvgIndicator.java @@ -58,7 +58,6 @@ public class EndpointAvgIndicator extends LongAvgIndicator implements AlarmSuppo return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -121,39 +120,39 @@ public class EndpointAvgIndicator extends LongAvgIndicator implements AlarmSuppo @Override public Indicator toHour() { EndpointAvgIndicator indicator = new EndpointAvgIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { EndpointAvgIndicator indicator = new EndpointAvgIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { EndpointAvgIndicator indicator = new EndpointAvgIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointCpmIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointCpmIndicator.java index ffbd64fe0bbe63f012930c76664c2645fd7a881e..2b843397db459def8b56ade1d668dd598cff0e4a 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointCpmIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointCpmIndicator.java @@ -58,7 +58,6 @@ public class EndpointCpmIndicator extends CPMIndicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -119,36 +118,36 @@ public class EndpointCpmIndicator extends CPMIndicator implements AlarmSupported @Override public Indicator toHour() { EndpointCpmIndicator indicator = new EndpointCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { EndpointCpmIndicator indicator = new EndpointCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { EndpointCpmIndicator indicator = new EndpointCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP50Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP50Indicator.java index 1a44a7e0e8867a95988fe457c6227d15ce3a9447..4e17585e923c69530b59b41884a232dbe68791d5 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP50Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP50Indicator.java @@ -58,7 +58,6 @@ public class EndpointP50Indicator extends P50Indicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -124,39 +123,45 @@ public class EndpointP50Indicator extends P50Indicator implements AlarmSupported @Override public Indicator toHour() { EndpointP50Indicator indicator = new EndpointP50Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { EndpointP50Indicator indicator = new EndpointP50Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { EndpointP50Indicator indicator = new EndpointP50Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP75Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP75Indicator.java index 87db4af7c5ff65585a68a4c8763bc21ea602668e..cc2524b971af6fbc195d400dd4db761082042d66 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP75Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP75Indicator.java @@ -58,7 +58,6 @@ public class EndpointP75Indicator extends P75Indicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -124,39 +123,45 @@ public class EndpointP75Indicator extends P75Indicator implements AlarmSupported @Override public Indicator toHour() { EndpointP75Indicator indicator = new EndpointP75Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { EndpointP75Indicator indicator = new EndpointP75Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { EndpointP75Indicator indicator = new EndpointP75Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP90Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP90Indicator.java index cf65588e34c94095a7c721032d79da5e758ed2a1..ded1642d6cf42fbc8699197fa7f3838b403dae61 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP90Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP90Indicator.java @@ -58,7 +58,6 @@ public class EndpointP90Indicator extends P90Indicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -124,39 +123,45 @@ public class EndpointP90Indicator extends P90Indicator implements AlarmSupported @Override public Indicator toHour() { EndpointP90Indicator indicator = new EndpointP90Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { EndpointP90Indicator indicator = new EndpointP90Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { EndpointP90Indicator indicator = new EndpointP90Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP95Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP95Indicator.java index cf76238d724fa59a1340c4c356ddbeca60192e90..09514053e5d51d30777ca99fc2be480edb94137e 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP95Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP95Indicator.java @@ -58,7 +58,6 @@ public class EndpointP95Indicator extends P95Indicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -124,39 +123,45 @@ public class EndpointP95Indicator extends P95Indicator implements AlarmSupported @Override public Indicator toHour() { EndpointP95Indicator indicator = new EndpointP95Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { EndpointP95Indicator indicator = new EndpointP95Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { EndpointP95Indicator indicator = new EndpointP95Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP99Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP99Indicator.java index 60c0768cd028643a13d61aa2dcd0c87a7107c4b5..4052e18a80c0dbe49d320b46b074fe897d656838 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP99Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointP99Indicator.java @@ -58,7 +58,6 @@ public class EndpointP99Indicator extends P99Indicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -124,39 +123,45 @@ public class EndpointP99Indicator extends P99Indicator implements AlarmSupported @Override public Indicator toHour() { EndpointP99Indicator indicator = new EndpointP99Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { EndpointP99Indicator indicator = new EndpointP99Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { EndpointP99Indicator indicator = new EndpointP99Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointSlaIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointSlaIndicator.java index 20a6bd1d081dea47f3a764165a2b76dd00cec70e..4032f962e36f540257dd90286d42eedd830d1484 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointSlaIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointSlaIndicator.java @@ -58,7 +58,6 @@ public class EndpointSlaIndicator extends PercentIndicator implements AlarmSuppo return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -121,39 +120,39 @@ public class EndpointSlaIndicator extends PercentIndicator implements AlarmSuppo @Override public Indicator toHour() { EndpointSlaIndicator indicator = new EndpointSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { EndpointSlaIndicator indicator = new EndpointSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { EndpointSlaIndicator indicator = new EndpointSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpointrelation/EndpointRelationCpmIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpointrelation/EndpointRelationCpmIndicator.java index 9b890d233836d4426b8512f6fcc67372ec50cf5f..49a63600258b510a89353d1b710aca0b0702c72a 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpointrelation/EndpointRelationCpmIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpointrelation/EndpointRelationCpmIndicator.java @@ -60,7 +60,6 @@ public class EndpointRelationCpmIndicator extends CPMIndicator implements AlarmS return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -125,7 +124,6 @@ public class EndpointRelationCpmIndicator extends CPMIndicator implements AlarmS @Override public Indicator toHour() { EndpointRelationCpmIndicator indicator = new EndpointRelationCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setChildServiceId(this.getChildServiceId()); @@ -133,13 +131,13 @@ public class EndpointRelationCpmIndicator extends CPMIndicator implements AlarmS indicator.setChildServiceInstanceId(this.getChildServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { EndpointRelationCpmIndicator indicator = new EndpointRelationCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setChildServiceId(this.getChildServiceId()); @@ -147,13 +145,13 @@ public class EndpointRelationCpmIndicator extends CPMIndicator implements AlarmS indicator.setChildServiceInstanceId(this.getChildServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { EndpointRelationCpmIndicator indicator = new EndpointRelationCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setChildServiceId(this.getChildServiceId()); @@ -161,6 +159,7 @@ public class EndpointRelationCpmIndicator extends CPMIndicator implements AlarmS indicator.setChildServiceInstanceId(this.getChildServiceInstanceId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpointrelation/EndpointRelationRespTimeIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpointrelation/EndpointRelationRespTimeIndicator.java index 8682119b0363b9995eee0e254b77089dd3f78abb..c4bb00264bb04ab24a87e72b1053d32b1ce4c358 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpointrelation/EndpointRelationRespTimeIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpointrelation/EndpointRelationRespTimeIndicator.java @@ -60,7 +60,6 @@ public class EndpointRelationRespTimeIndicator extends LongAvgIndicator implemen return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -127,7 +126,6 @@ public class EndpointRelationRespTimeIndicator extends LongAvgIndicator implemen @Override public Indicator toHour() { EndpointRelationRespTimeIndicator indicator = new EndpointRelationRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setChildServiceId(this.getChildServiceId()); @@ -136,13 +134,13 @@ public class EndpointRelationRespTimeIndicator extends LongAvgIndicator implemen indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { EndpointRelationRespTimeIndicator indicator = new EndpointRelationRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setChildServiceId(this.getChildServiceId()); @@ -151,13 +149,13 @@ public class EndpointRelationRespTimeIndicator extends LongAvgIndicator implemen indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { EndpointRelationRespTimeIndicator indicator = new EndpointRelationRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setChildServiceId(this.getChildServiceId()); @@ -166,6 +164,7 @@ public class EndpointRelationRespTimeIndicator extends LongAvgIndicator implemen indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceCpmIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceCpmIndicator.java index c2c00459dab4af41b02790ab8449044bfe8e17da..3d7886703fbb7177661c7b780429b39d505da614 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceCpmIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceCpmIndicator.java @@ -56,7 +56,6 @@ public class ServiceCpmIndicator extends CPMIndicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -113,30 +112,30 @@ public class ServiceCpmIndicator extends CPMIndicator implements AlarmSupported @Override public Indicator toHour() { ServiceCpmIndicator indicator = new ServiceCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceCpmIndicator indicator = new ServiceCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceCpmIndicator indicator = new ServiceCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP50Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP50Indicator.java index b050e8eb3e5fc2a3599a59698f8999c17970b939..b3b20dfe288d9185adc4717c491cc7b1b686600f 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP50Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP50Indicator.java @@ -56,7 +56,6 @@ public class ServiceP50Indicator extends P50Indicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,33 +117,39 @@ public class ServiceP50Indicator extends P50Indicator implements AlarmSupported @Override public Indicator toHour() { ServiceP50Indicator indicator = new ServiceP50Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceP50Indicator indicator = new ServiceP50Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceP50Indicator indicator = new ServiceP50Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP75Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP75Indicator.java index 5a7015990c13953750fec02a62640f1cab5d412e..374d9c271f3f48b55a610eefb4a8c7d16dc7f776 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP75Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP75Indicator.java @@ -56,7 +56,6 @@ public class ServiceP75Indicator extends P75Indicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,33 +117,39 @@ public class ServiceP75Indicator extends P75Indicator implements AlarmSupported @Override public Indicator toHour() { ServiceP75Indicator indicator = new ServiceP75Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceP75Indicator indicator = new ServiceP75Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceP75Indicator indicator = new ServiceP75Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP90Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP90Indicator.java index 7b4deb6cda741966fa8315a6a57fef168a4055ed..79cdbf907e97956d40ce99ef6d3eab1cd3b41447 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP90Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP90Indicator.java @@ -56,7 +56,6 @@ public class ServiceP90Indicator extends P90Indicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,33 +117,39 @@ public class ServiceP90Indicator extends P90Indicator implements AlarmSupported @Override public Indicator toHour() { ServiceP90Indicator indicator = new ServiceP90Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceP90Indicator indicator = new ServiceP90Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceP90Indicator indicator = new ServiceP90Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP95Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP95Indicator.java index 212eb92af4c82b641707da3bfe27f623849dd0c9..7a4603d945c4eb452c4180756d6765ec8fbd1b14 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP95Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP95Indicator.java @@ -56,7 +56,6 @@ public class ServiceP95Indicator extends P95Indicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,33 +117,39 @@ public class ServiceP95Indicator extends P95Indicator implements AlarmSupported @Override public Indicator toHour() { ServiceP95Indicator indicator = new ServiceP95Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceP95Indicator indicator = new ServiceP95Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceP95Indicator indicator = new ServiceP95Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP99Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP99Indicator.java index 2f9d317b7b918e0e97f056f49d5c6ad9a5d21e84..5f756504f097f206fce0275cca37433cd6fdb06b 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP99Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceP99Indicator.java @@ -56,7 +56,6 @@ public class ServiceP99Indicator extends P99Indicator implements AlarmSupported return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,33 +117,39 @@ public class ServiceP99Indicator extends P99Indicator implements AlarmSupported @Override public Indicator toHour() { ServiceP99Indicator indicator = new ServiceP99Indicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceP99Indicator indicator = new ServiceP99Indicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceP99Indicator indicator = new ServiceP99Indicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setPrecision(this.getPrecision()); - indicator.setDetailGroup(this.getDetailGroup()); + org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray newValue = new org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray(); + newValue.copyFrom(this.getDetailGroup()); + indicator.setDetailGroup(newValue); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceRespTimeIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceRespTimeIndicator.java index 60ae6c2cefd0f1f1b6d073922ecbbadc617255e0..8a4bde0d7333d567a0d980fd89e79901806508df 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceRespTimeIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceRespTimeIndicator.java @@ -56,7 +56,6 @@ public class ServiceRespTimeIndicator extends LongAvgIndicator implements AlarmS return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -115,33 +114,33 @@ public class ServiceRespTimeIndicator extends LongAvgIndicator implements AlarmS @Override public Indicator toHour() { ServiceRespTimeIndicator indicator = new ServiceRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceRespTimeIndicator indicator = new ServiceRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceRespTimeIndicator indicator = new ServiceRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceSlaIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceSlaIndicator.java index 68f023ab648d8ef68127df47658e450b87711def..9571e3632d749e38a24b7e05c65cd137c4ac2536 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceSlaIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceSlaIndicator.java @@ -56,7 +56,6 @@ public class ServiceSlaIndicator extends PercentIndicator implements AlarmSuppor return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -115,33 +114,33 @@ public class ServiceSlaIndicator extends PercentIndicator implements AlarmSuppor @Override public Indicator toHour() { ServiceSlaIndicator indicator = new ServiceSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceSlaIndicator indicator = new ServiceSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceSlaIndicator indicator = new ServiceSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstance/ServiceInstanceCpmIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstance/ServiceInstanceCpmIndicator.java index dc9669a66fb88f2b208e63d72af0fc38cbe4734e..2bd9d36bff2850568f56cb341e71c90b78b14b16 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstance/ServiceInstanceCpmIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstance/ServiceInstanceCpmIndicator.java @@ -57,7 +57,6 @@ public class ServiceInstanceCpmIndicator extends CPMIndicator implements AlarmSu return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -116,33 +115,33 @@ public class ServiceInstanceCpmIndicator extends CPMIndicator implements AlarmSu @Override public Indicator toHour() { ServiceInstanceCpmIndicator indicator = new ServiceInstanceCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceInstanceCpmIndicator indicator = new ServiceInstanceCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceInstanceCpmIndicator indicator = new ServiceInstanceCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstance/ServiceInstanceRespTimeIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstance/ServiceInstanceRespTimeIndicator.java index 39a6ac1e4b4977c4deacfc5f18fc40a4b270a40c..3b9a7d78e99105abbcf4125da6fb1a100288845b 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstance/ServiceInstanceRespTimeIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstance/ServiceInstanceRespTimeIndicator.java @@ -57,7 +57,6 @@ public class ServiceInstanceRespTimeIndicator extends LongAvgIndicator implement return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,36 +117,36 @@ public class ServiceInstanceRespTimeIndicator extends LongAvgIndicator implement @Override public Indicator toHour() { ServiceInstanceRespTimeIndicator indicator = new ServiceInstanceRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceInstanceRespTimeIndicator indicator = new ServiceInstanceRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceInstanceRespTimeIndicator indicator = new ServiceInstanceRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceId(this.getServiceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmcpu/InstanceJvmCpuIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmcpu/InstanceJvmCpuIndicator.java index 99fe1085d2bfe388c21b653d7f0ce1b6b7213650..af09d121c888c54ef307a3508e3faa0f7935ea75 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmcpu/InstanceJvmCpuIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmcpu/InstanceJvmCpuIndicator.java @@ -57,7 +57,6 @@ public class InstanceJvmCpuIndicator extends DoubleAvgIndicator implements Alarm return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,36 +117,36 @@ public class InstanceJvmCpuIndicator extends DoubleAvgIndicator implements Alarm @Override public Indicator toHour() { InstanceJvmCpuIndicator indicator = new InstanceJvmCpuIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { InstanceJvmCpuIndicator indicator = new InstanceJvmCpuIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { InstanceJvmCpuIndicator indicator = new InstanceJvmCpuIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmOldGcCountIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmOldGcCountIndicator.java index f5f8a36c6c5eee57711d7abcdebd315903513613..76661f44d767f349b475aaad93c4da4adca67f2c 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmOldGcCountIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmOldGcCountIndicator.java @@ -57,7 +57,6 @@ public class InstanceJvmOldGcCountIndicator extends SumIndicator implements Alar return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -114,30 +113,30 @@ public class InstanceJvmOldGcCountIndicator extends SumIndicator implements Alar @Override public Indicator toHour() { InstanceJvmOldGcCountIndicator indicator = new InstanceJvmOldGcCountIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { InstanceJvmOldGcCountIndicator indicator = new InstanceJvmOldGcCountIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { InstanceJvmOldGcCountIndicator indicator = new InstanceJvmOldGcCountIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmOldGcTimeIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmOldGcTimeIndicator.java index 4c4d5afd43ca3630e688d50452304a019ec699b0..9cbf6c6d5d7b8bd499a2d312703b01861a2dbe08 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmOldGcTimeIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmOldGcTimeIndicator.java @@ -57,7 +57,6 @@ public class InstanceJvmOldGcTimeIndicator extends LongAvgIndicator implements A return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,36 +117,36 @@ public class InstanceJvmOldGcTimeIndicator extends LongAvgIndicator implements A @Override public Indicator toHour() { InstanceJvmOldGcTimeIndicator indicator = new InstanceJvmOldGcTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { InstanceJvmOldGcTimeIndicator indicator = new InstanceJvmOldGcTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { InstanceJvmOldGcTimeIndicator indicator = new InstanceJvmOldGcTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmYoungGcCountIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmYoungGcCountIndicator.java index 614e02ece77dee46ed643c1e679ba8639cd808cf..1e639b73d0dea6789bd2d4d78c3ec1a67af829be 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmYoungGcCountIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmYoungGcCountIndicator.java @@ -57,7 +57,6 @@ public class InstanceJvmYoungGcCountIndicator extends SumIndicator implements Al return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -114,30 +113,30 @@ public class InstanceJvmYoungGcCountIndicator extends SumIndicator implements Al @Override public Indicator toHour() { InstanceJvmYoungGcCountIndicator indicator = new InstanceJvmYoungGcCountIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { InstanceJvmYoungGcCountIndicator indicator = new InstanceJvmYoungGcCountIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { InstanceJvmYoungGcCountIndicator indicator = new InstanceJvmYoungGcCountIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmYoungGcTimeIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmYoungGcTimeIndicator.java index e017f65ddbb4c9c00ef0036a01ebd0a747427486..9ac625751273ca7faf830034de5fd273da18f7a1 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmYoungGcTimeIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmgc/InstanceJvmYoungGcTimeIndicator.java @@ -57,7 +57,6 @@ public class InstanceJvmYoungGcTimeIndicator extends LongAvgIndicator implements return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,36 +117,36 @@ public class InstanceJvmYoungGcTimeIndicator extends LongAvgIndicator implements @Override public Indicator toHour() { InstanceJvmYoungGcTimeIndicator indicator = new InstanceJvmYoungGcTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { InstanceJvmYoungGcTimeIndicator indicator = new InstanceJvmYoungGcTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { InstanceJvmYoungGcTimeIndicator indicator = new InstanceJvmYoungGcTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryHeapIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryHeapIndicator.java index 2480f8420c8fd0d34456f50dd6a3a9f5f4f99fc9..8a33c8fee3a541e7040805fa052c3d5561edbc6e 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryHeapIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryHeapIndicator.java @@ -57,7 +57,6 @@ public class InstanceJvmMemoryHeapIndicator extends LongAvgIndicator implements return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,36 +117,36 @@ public class InstanceJvmMemoryHeapIndicator extends LongAvgIndicator implements @Override public Indicator toHour() { InstanceJvmMemoryHeapIndicator indicator = new InstanceJvmMemoryHeapIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { InstanceJvmMemoryHeapIndicator indicator = new InstanceJvmMemoryHeapIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { InstanceJvmMemoryHeapIndicator indicator = new InstanceJvmMemoryHeapIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryHeapMaxIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryHeapMaxIndicator.java index 0e070d46ae7d9605ed7a37bfee084d898af0ec00..a3b92bf0c5aba15105d2b83ff4f42432d004c103 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryHeapMaxIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryHeapMaxIndicator.java @@ -57,7 +57,6 @@ public class InstanceJvmMemoryHeapMaxIndicator extends LongAvgIndicator implemen return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,36 +117,36 @@ public class InstanceJvmMemoryHeapMaxIndicator extends LongAvgIndicator implemen @Override public Indicator toHour() { InstanceJvmMemoryHeapMaxIndicator indicator = new InstanceJvmMemoryHeapMaxIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { InstanceJvmMemoryHeapMaxIndicator indicator = new InstanceJvmMemoryHeapMaxIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { InstanceJvmMemoryHeapMaxIndicator indicator = new InstanceJvmMemoryHeapMaxIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryNoheapIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryNoheapIndicator.java index a426d98f3526255f4dd0a79b63e339b263534a7c..9ff7409ef2ce44539f9f23e9274ba32ceee79819 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryNoheapIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryNoheapIndicator.java @@ -57,7 +57,6 @@ public class InstanceJvmMemoryNoheapIndicator extends LongAvgIndicator implement return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,36 +117,36 @@ public class InstanceJvmMemoryNoheapIndicator extends LongAvgIndicator implement @Override public Indicator toHour() { InstanceJvmMemoryNoheapIndicator indicator = new InstanceJvmMemoryNoheapIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { InstanceJvmMemoryNoheapIndicator indicator = new InstanceJvmMemoryNoheapIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { InstanceJvmMemoryNoheapIndicator indicator = new InstanceJvmMemoryNoheapIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryNoheapMaxIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryNoheapMaxIndicator.java index 375eb7fc158cdcdfd213c6d5dc2f2a01f68d4cbd..7effa98e7f212c707afac72c57c0c3594398b745 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryNoheapMaxIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/serviceinstancejvmmemory/InstanceJvmMemoryNoheapMaxIndicator.java @@ -57,7 +57,6 @@ public class InstanceJvmMemoryNoheapMaxIndicator extends LongAvgIndicator implem return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -118,36 +117,36 @@ public class InstanceJvmMemoryNoheapMaxIndicator extends LongAvgIndicator implem @Override public Indicator toHour() { InstanceJvmMemoryNoheapMaxIndicator indicator = new InstanceJvmMemoryNoheapMaxIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { InstanceJvmMemoryNoheapMaxIndicator indicator = new InstanceJvmMemoryNoheapMaxIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { InstanceJvmMemoryNoheapMaxIndicator indicator = new InstanceJvmMemoryNoheapMaxIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setServiceInstanceId(this.getServiceInstanceId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientCallSlaIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientCallSlaIndicator.java index 272e34019596945e3d92d9dc2165683d6cc58f8d..8b6dcfee73e1c95e4328cd9b5d0545a21a048f5d 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientCallSlaIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientCallSlaIndicator.java @@ -56,7 +56,6 @@ public class ServiceRelationClientCallSlaIndicator extends PercentIndicator impl return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -115,33 +114,33 @@ public class ServiceRelationClientCallSlaIndicator extends PercentIndicator impl @Override public Indicator toHour() { ServiceRelationClientCallSlaIndicator indicator = new ServiceRelationClientCallSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceRelationClientCallSlaIndicator indicator = new ServiceRelationClientCallSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceRelationClientCallSlaIndicator indicator = new ServiceRelationClientCallSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientCpmIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientCpmIndicator.java index ad1c6776a2445f8c130c07a48c661161011bb1bd..db444a98e0ec509c6313d7dfcc3a8cc6f8ebfc7e 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientCpmIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientCpmIndicator.java @@ -56,7 +56,6 @@ public class ServiceRelationClientCpmIndicator extends CPMIndicator implements A return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -113,30 +112,30 @@ public class ServiceRelationClientCpmIndicator extends CPMIndicator implements A @Override public Indicator toHour() { ServiceRelationClientCpmIndicator indicator = new ServiceRelationClientCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceRelationClientCpmIndicator indicator = new ServiceRelationClientCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceRelationClientCpmIndicator indicator = new ServiceRelationClientCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientRespTimeIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientRespTimeIndicator.java index 2f536b803f2ce952e8fdd09d25f53cefa6fb4eeb..b866cc9873f5a9c739243d30e366c4e7816816cb 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientRespTimeIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationClientRespTimeIndicator.java @@ -56,7 +56,6 @@ public class ServiceRelationClientRespTimeIndicator extends LongAvgIndicator imp return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -115,33 +114,33 @@ public class ServiceRelationClientRespTimeIndicator extends LongAvgIndicator imp @Override public Indicator toHour() { ServiceRelationClientRespTimeIndicator indicator = new ServiceRelationClientRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceRelationClientRespTimeIndicator indicator = new ServiceRelationClientRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceRelationClientRespTimeIndicator indicator = new ServiceRelationClientRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerCallSlaIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerCallSlaIndicator.java index 159b7eadf9ce885865e585cee2fb04ee34989801..cd9e529d458e00cb8356935c582db46769cd8c26 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerCallSlaIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerCallSlaIndicator.java @@ -56,7 +56,6 @@ public class ServiceRelationServerCallSlaIndicator extends PercentIndicator impl return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -115,33 +114,33 @@ public class ServiceRelationServerCallSlaIndicator extends PercentIndicator impl @Override public Indicator toHour() { ServiceRelationServerCallSlaIndicator indicator = new ServiceRelationServerCallSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceRelationServerCallSlaIndicator indicator = new ServiceRelationServerCallSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceRelationServerCallSlaIndicator indicator = new ServiceRelationServerCallSlaIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setTotal(this.getTotal()); indicator.setPercentage(this.getPercentage()); indicator.setMatch(this.getMatch()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerCpmIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerCpmIndicator.java index 8255b7f91ec28ab455684d8046b3d4a4ee9bf391..8ee49210b8e8416c4206d7ea0e1e3dc96f858ebe 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerCpmIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerCpmIndicator.java @@ -56,7 +56,6 @@ public class ServiceRelationServerCpmIndicator extends CPMIndicator implements A return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -113,30 +112,30 @@ public class ServiceRelationServerCpmIndicator extends CPMIndicator implements A @Override public Indicator toHour() { ServiceRelationServerCpmIndicator indicator = new ServiceRelationServerCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceRelationServerCpmIndicator indicator = new ServiceRelationServerCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceRelationServerCpmIndicator indicator = new ServiceRelationServerCpmIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setValue(this.getValue()); indicator.setTotal(this.getTotal()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerRespTimeIndicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerRespTimeIndicator.java index ffc9d53b5e96bd5e8216013352632014a7d4b73a..d87ec4060d9353e867c8dc633417dbd2d8686802 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerRespTimeIndicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/servicerelation/ServiceRelationServerRespTimeIndicator.java @@ -56,7 +56,6 @@ public class ServiceRelationServerRespTimeIndicator extends LongAvgIndicator imp return result; } - @Override public int remoteHashCode() { int result = 17; result = 31 * result + entityId.hashCode(); @@ -115,33 +114,33 @@ public class ServiceRelationServerRespTimeIndicator extends LongAvgIndicator imp @Override public Indicator toHour() { ServiceRelationServerRespTimeIndicator indicator = new ServiceRelationServerRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInHour()); indicator.setEntityId(this.getEntityId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInHour()); return indicator; } @Override public Indicator toDay() { ServiceRelationServerRespTimeIndicator indicator = new ServiceRelationServerRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInDay()); indicator.setEntityId(this.getEntityId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInDay()); return indicator; } @Override public Indicator toMonth() { ServiceRelationServerRespTimeIndicator indicator = new ServiceRelationServerRespTimeIndicator(); - indicator.setTimeBucket(toTimeBucketInMonth()); indicator.setEntityId(this.getEntityId()); indicator.setSummation(this.getSummation()); indicator.setCount(this.getCount()); indicator.setValue(this.getValue()); + indicator.setTimeBucket(toTimeBucketInMonth()); return indicator; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/Indicator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/Indicator.java index 235d2a10777eecc4dc691d0d94fa9cbe676fcef4..42d4af1a5f0165d8ea9b7095418e1b7262065a2d 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/Indicator.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/Indicator.java @@ -18,18 +18,17 @@ package org.apache.skywalking.oap.server.core.analysis.indicator; -import lombok.Getter; -import lombok.Setter; +import lombok.*; import org.apache.skywalking.oap.server.core.remote.data.StreamData; import org.apache.skywalking.oap.server.core.storage.StorageData; import org.apache.skywalking.oap.server.core.storage.annotation.Column; -import org.joda.time.format.DateTimeFormat; -import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.*; /** * @author peng-yongsheng */ public abstract class Indicator extends StreamData implements StorageData { + private static DateTimeFormatter TIME_BUCKET_MONTH_FORMATTER = DateTimeFormat.forPattern("yyyyMM"); public static final String TIME_BUCKET = "time_bucket"; diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/IntKeyLongValue.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/IntKeyLongValue.java index f3fcdc07501374e93bcf90aa4442d21806f93df2..cd7d179d5056f694fa078445abdcfe35b9483498 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/IntKeyLongValue.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/IntKeyLongValue.java @@ -83,4 +83,10 @@ public class IntKeyLongValue implements Comparable, StorageData this.key = Integer.valueOf(keyValue[0]); this.value = Long.valueOf(keyValue[1]); } + + @Override public void copyFrom(Object source) { + IntKeyLongValue value = (IntKeyLongValue)source; + this.key = value.key; + this.value = value.value; + } } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/IntKeyLongValueArray.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/IntKeyLongValueArray.java index d102d85152b4f0693a0a90315b1500e8aab72845..8f8c7c05e2f781328fd25a0bb332bf5c6ece9617 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/IntKeyLongValueArray.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/IntKeyLongValueArray.java @@ -31,6 +31,10 @@ public class IntKeyLongValueArray extends ArrayList implements super(initialCapacity); } + public IntKeyLongValueArray() { + super(30); + } + public IntKeyLongValueArray(String data) { super(); toObject(data); @@ -56,4 +60,13 @@ public class IntKeyLongValueArray extends ArrayList implements this.add(value); } } + + @Override public void copyFrom(Object source) { + IntKeyLongValueArray valueArray = (IntKeyLongValueArray)source; + valueArray.forEach(value -> { + IntKeyLongValue newValue = new IntKeyLongValue(); + newValue.copyFrom(value); + this.add(newValue); + }); + } } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java index d5a842a5e461188a71e1628d9270ec35d5839e26..12d2496eeaaabd45b8562bcaf0b48a8aa64368e3 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java @@ -32,7 +32,7 @@ import org.apache.skywalking.oap.server.library.util.CollectionUtils; * @author peng-yongsheng */ @RecordType -@StorageEntity(name = SegmentRecord.INDEX_NAME, builder = SegmentRecord.Builder.class) +@StorageEntity(name = SegmentRecord.INDEX_NAME, builder = SegmentRecord.Builder.class, deleteHistory = false) public class SegmentRecord extends Record { public static final String INDEX_NAME = "segment"; diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/IndicatorPersistentWorker.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/IndicatorPersistentWorker.java index e06e0677d52a57b6900eb2abc6ca921ac0af46b3..efecef9679e4ab8665cea41b05e1df0f04ef1532 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/IndicatorPersistentWorker.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/IndicatorPersistentWorker.java @@ -19,7 +19,9 @@ package org.apache.skywalking.oap.server.core.analysis.worker; import java.util.*; -import org.apache.skywalking.oap.server.core.analysis.data.MergeDataCache; +import org.apache.skywalking.apm.commons.datacarrier.DataCarrier; +import org.apache.skywalking.apm.commons.datacarrier.consumer.IConsumer; +import org.apache.skywalking.oap.server.core.analysis.data.*; import org.apache.skywalking.oap.server.core.analysis.indicator.Indicator; import org.apache.skywalking.oap.server.core.storage.IIndicatorDAO; import org.apache.skywalking.oap.server.core.worker.AbstractWorker; @@ -39,6 +41,7 @@ public class IndicatorPersistentWorker extends PersistenceWorker mergeDataCache; private final IIndicatorDAO indicatorDAO; private final AbstractWorker nextWorker; + private final DataCarrier dataCarrier; IndicatorPersistentWorker(int workerId, String modelName, int batchSize, ModuleManager moduleManager, IIndicatorDAO indicatorDAO, AbstractWorker nextWorker) { @@ -47,6 +50,13 @@ public class IndicatorPersistentWorker extends PersistenceWorker(); this.indicatorDAO = indicatorDAO; this.nextWorker = nextWorker; + this.dataCarrier = new DataCarrier<>(1, 10000); + this.dataCarrier.consume(new IndicatorPersistentWorker.PersistentConsumer(this), 1); + } + + @Override public void in(Indicator indicator) { + indicator.setEndOfBatchContext(new EndOfBatchContext(false)); + dataCarrier.produce(indicator); } @Override public MergeDataCache getCache() { @@ -106,4 +116,38 @@ public class IndicatorPersistentWorker extends PersistenceWorker { + + private final IndicatorPersistentWorker persistent; + + private PersistentConsumer(IndicatorPersistentWorker persistent) { + this.persistent = persistent; + } + + @Override public void init() { + + } + + @Override public void consume(List data) { + Iterator inputIterator = data.iterator(); + + int i = 0; + while (inputIterator.hasNext()) { + Indicator indicator = inputIterator.next(); + i++; + if (i == data.size()) { + indicator.getEndOfBatchContext().setEndOfBatch(true); + } + persistent.onWork(indicator); + } + } + + @Override public void onError(List data, Throwable t) { + logger.error(t.getMessage(), t); + } + + @Override public void onExit() { + } + } } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/PersistenceWorker.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/PersistenceWorker.java index d731c733acd9a9bce8d4310d13e3f0f703b91cbf..d559ef82c8a8d30d261abe8ece8656547acf8a4d 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/PersistenceWorker.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/PersistenceWorker.java @@ -41,7 +41,7 @@ public abstract class PersistenceWorker= batchSize) { try { if (getCache().trySwitchPointer()) { diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/RecordPersistentWorker.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/RecordPersistentWorker.java index ea8a47d2ed3f30db8a2081662101219dad8cefb3..8d291d7582bba68cb4f5bacbbe041d5ea389d9b6 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/RecordPersistentWorker.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/RecordPersistentWorker.java @@ -19,6 +19,8 @@ package org.apache.skywalking.oap.server.core.analysis.worker; import java.util.*; +import org.apache.skywalking.apm.commons.datacarrier.DataCarrier; +import org.apache.skywalking.apm.commons.datacarrier.consumer.IConsumer; import org.apache.skywalking.oap.server.core.analysis.data.NonMergeDataCache; import org.apache.skywalking.oap.server.core.analysis.record.Record; import org.apache.skywalking.oap.server.core.storage.IRecordDAO; @@ -35,6 +37,7 @@ public class RecordPersistentWorker extends PersistenceWorker nonMergeDataCache; private final IRecordDAO recordDAO; + private final DataCarrier dataCarrier; RecordPersistentWorker(int workerId, String modelName, int batchSize, ModuleManager moduleManager, IRecordDAO recordDAO) { @@ -42,6 +45,12 @@ public class RecordPersistentWorker extends PersistenceWorker(); this.recordDAO = recordDAO; + this.dataCarrier = new DataCarrier<>(1, 10000); + this.dataCarrier.consume(new RecordPersistentWorker.PersistentConsumer(this), 1); + } + + @Override public void in(Record record) { + dataCarrier.produce(record); } @Override public NonMergeDataCache getCache() { @@ -65,4 +74,30 @@ public class RecordPersistentWorker extends PersistenceWorker { + + private final RecordPersistentWorker persistent; + + private PersistentConsumer(RecordPersistentWorker persistent) { + this.persistent = persistent; + } + + @Override public void init() { + + } + + @Override public void consume(List data) { + for (Record record : data) { + persistent.onWork(record); + } + } + + @Override public void onError(List data, Throwable t) { + logger.error(t.getMessage(), t); + } + + @Override public void onExit() { + } + } } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/EndpointInventory.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/EndpointInventory.java index 7286b0dd1d942fbd92dd09c1052c1463e4241077..cb954406bc84bfdeb81d1c4b7b8a7c9c91ea242c 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/EndpointInventory.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/EndpointInventory.java @@ -33,7 +33,7 @@ import org.apache.skywalking.oap.server.core.storage.annotation.*; */ @InventoryType(scope = Scope.Endpoint) @StreamData -@StorageEntity(name = EndpointInventory.MODEL_NAME, builder = EndpointInventory.Builder.class) +@StorageEntity(name = EndpointInventory.MODEL_NAME, builder = EndpointInventory.Builder.class, deleteHistory = false) public class EndpointInventory extends RegisterSource { public static final String MODEL_NAME = "endpoint_inventory"; diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/NetworkAddressInventory.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/NetworkAddressInventory.java index 801355ece4af24422f37f42ace80808aaabc26f5..8afe1f9b6c5bdeb4af2e8a34d1b11e26634c69db 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/NetworkAddressInventory.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/NetworkAddressInventory.java @@ -33,7 +33,7 @@ import org.apache.skywalking.oap.server.core.storage.annotation.*; */ @InventoryType(scope = Scope.NetworkAddress) @StreamData -@StorageEntity(name = NetworkAddressInventory.MODEL_NAME, builder = NetworkAddressInventory.Builder.class) +@StorageEntity(name = NetworkAddressInventory.MODEL_NAME, builder = NetworkAddressInventory.Builder.class, deleteHistory = false) public class NetworkAddressInventory extends RegisterSource { public static final String MODEL_NAME = "network_address_inventory"; diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInstanceInventory.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInstanceInventory.java index 4f864591fe5e12d88bac9b173eb469e303c1da39..7e6956c51643a61d939085d328114c2db9490b68 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInstanceInventory.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInstanceInventory.java @@ -36,7 +36,7 @@ import org.apache.skywalking.oap.server.library.util.BooleanUtils; */ @InventoryType(scope = Scope.ServiceInstance) @StreamData -@StorageEntity(name = ServiceInstanceInventory.MODEL_NAME, builder = ServiceInstanceInventory.Builder.class) +@StorageEntity(name = ServiceInstanceInventory.MODEL_NAME, builder = ServiceInstanceInventory.Builder.class, deleteHistory = false) public class ServiceInstanceInventory extends RegisterSource { public static final String MODEL_NAME = "service_instance_inventory"; diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInventory.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInventory.java index 978fb8bce4831b7cea8d1e3467c3a13561fa1f4e..7e195ba587bd73f941c9514a668ede630a398fd5 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInventory.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInventory.java @@ -34,7 +34,7 @@ import org.apache.skywalking.oap.server.library.util.BooleanUtils; */ @InventoryType(scope = Scope.Service) @StreamData -@StorageEntity(name = ServiceInventory.MODEL_NAME, builder = ServiceInventory.Builder.class) +@StorageEntity(name = ServiceInventory.MODEL_NAME, builder = ServiceInventory.Builder.class, deleteHistory = false) public class ServiceInventory extends RegisterSource { public static final String MODEL_NAME = "service_inventory"; diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/remote/RemoteSenderService.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/remote/RemoteSenderService.java index d05fcb26575620a56532d9347d7983c93776946b..e91e45e2f89210b0b96ad00b8fa9700f72e697a4 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/remote/RemoteSenderService.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/remote/RemoteSenderService.java @@ -19,8 +19,8 @@ package org.apache.skywalking.oap.server.core.remote; import org.apache.skywalking.oap.server.core.CoreModule; -import org.apache.skywalking.oap.server.core.remote.data.StreamData; import org.apache.skywalking.oap.server.core.remote.client.*; +import org.apache.skywalking.oap.server.core.remote.data.StreamData; import org.apache.skywalking.oap.server.core.remote.selector.*; import org.apache.skywalking.oap.server.library.module.*; @@ -49,12 +49,15 @@ public class RemoteSenderService implements Service { case HashCode: remoteClient = hashCodeSelector.select(clientManager.getRemoteClient(), streamData); remoteClient.push(nextWorkId, streamData); + break; case Rolling: remoteClient = rollingSelector.select(clientManager.getRemoteClient(), streamData); remoteClient.push(nextWorkId, streamData); + break; case ForeverFirst: remoteClient = foreverFirstSelector.select(clientManager.getRemoteClient(), streamData); remoteClient.push(nextWorkId, streamData); + break; } } } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IHistoryDeleteDAO.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IHistoryDeleteDAO.java new file mode 100644 index 0000000000000000000000000000000000000000..382d7dd673189b027e81da5aff60ed56e4c462ff --- /dev/null +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IHistoryDeleteDAO.java @@ -0,0 +1,29 @@ +/* + * 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.oap.server.core.storage; + +import java.io.IOException; + +/** + * @author peng-yongsheng + */ +public interface IHistoryDeleteDAO extends DAO { + + void deleteHistory(String modelName, String timeBucketColumnName, Long timeBucketBefore) throws IOException; +} diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IIndicatorDAO.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IIndicatorDAO.java index 3dbf34806e89cd80616cff3a2b82057d1d191d07..146ac0af0184923b8cae8c927d461fb445161b14 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IIndicatorDAO.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IIndicatorDAO.java @@ -31,6 +31,4 @@ public interface IIndicatorDAO extends DAO { INSERT prepareBatchInsert(String modelName, Indicator indicator) throws IOException; UPDATE prepareBatchUpdate(String modelName, Indicator indicator) throws IOException; - - void deleteHistory(String modelName, Long timeBucketBefore); } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IRecordDAO.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IRecordDAO.java index d5e156f39af8a82c91846145b9da7fbab93e4376..0b44884041e2f79ef984e99be8b8de26b170e4a9 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IRecordDAO.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IRecordDAO.java @@ -27,6 +27,4 @@ import org.apache.skywalking.oap.server.core.analysis.record.Record; public interface IRecordDAO extends DAO { INSERT prepareBatchInsert(String modelName, Record record) throws IOException; - - void deleteHistory(String modelName, Long timeBucketBefore); } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/StorageModule.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/StorageModule.java index 488661f4e5b48362225b97aa3db50dc64735d1eb..1665cc12f0a1bb81201e7791ce553c9b84c4afab 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/StorageModule.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/StorageModule.java @@ -36,6 +36,7 @@ public class StorageModule extends ModuleDefine { @Override public Class[] services() { return new Class[] { IBatchDAO.class, StorageDAO.class, IRegisterLockDAO.class, + IHistoryDeleteDAO.class, IServiceInventoryCacheDAO.class, IServiceInstanceInventoryCacheDAO.class, IEndpointInventoryCacheDAO.class, INetworkAddressInventoryCacheDAO.class, ITopologyQueryDAO.class, IMetricQueryDAO.class, ITraceQueryDAO.class, IMetadataQueryDAO.class, IAggregationQueryDAO.class, IAlarmQueryDAO.class}; diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageAnnotationListener.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageAnnotationListener.java index a728e1e8777bd0df002aedc37b48f2e70e9733d5..0ca3b82bcc18699060476df4a37d48a2eff2ea68 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageAnnotationListener.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageAnnotationListener.java @@ -48,11 +48,12 @@ public class StorageAnnotationListener implements AnnotationListener, IModelGett logger.info("The owner class of storage annotation, class name: {}", aClass.getName()); String modelName = StorageEntityAnnotationUtils.getModelName(aClass); + boolean deleteHistory = StorageEntityAnnotationUtils.getDeleteHistory(aClass); boolean isIndicator = IndicatorAnnotationUtils.isIndicator(aClass); List modelColumns = new LinkedList<>(); retrieval(aClass, modelName, modelColumns); - models.add(new Model(modelName, modelColumns, isIndicator)); + models.add(new Model(modelName, modelColumns, isIndicator, deleteHistory)); } private void retrieval(Class clazz, String modelName, List modelColumns) { diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageEntity.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageEntity.java index 7bf8cab97b0858b777bca742582e5fdb0637ef91..d3e77f488b659e014c18159f0c2047925f6246e0 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageEntity.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageEntity.java @@ -30,4 +30,6 @@ public @interface StorageEntity { String name(); Class builder(); + + boolean deleteHistory() default true; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageEntityAnnotationUtils.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageEntityAnnotationUtils.java index b754039de7e9196b2cd2ff395a544ed331d4b340..b271d91fad7ef6a8522ec7a7e423f01b859bb1a8 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageEntityAnnotationUtils.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/StorageEntityAnnotationUtils.java @@ -35,6 +35,15 @@ public class StorageEntityAnnotationUtils { } } + public static boolean getDeleteHistory(Class aClass) { + if (aClass.isAnnotationPresent(StorageEntity.class)) { + StorageEntity annotation = (StorageEntity)aClass.getAnnotation(StorageEntity.class); + return annotation.deleteHistory(); + } else { + throw new UnexpectedException(""); + } + } + public static Class getBuilder(Class aClass) { if (aClass.isAnnotationPresent(StorageEntity.class)) { StorageEntity annotation = (StorageEntity)aClass.getAnnotation(StorageEntity.class); diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/Model.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/Model.java index 0c2dc472611d14f49b3cdd4254aac66c08d960ac..6a2a854bc4c17405be5920983ac47c2251e56fc2 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/Model.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/Model.java @@ -28,15 +28,17 @@ import lombok.Getter; public class Model { private final String name; private final boolean isIndicator; + private final boolean deleteHistory; private final List columns; - public Model(String name, List columns, boolean isIndicator) { + public Model(String name, List columns, boolean isIndicator, boolean deleteHistory) { this.name = name; this.columns = columns; this.isIndicator = isIndicator; + this.deleteHistory = deleteHistory; } public Model copy(String name) { - return new Model(name, columns, isIndicator); + return new Model(name, columns, isIndicator, deleteHistory); } } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/ModelInstaller.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/ModelInstaller.java index 681ed738b09bb0cb9aa52afadd1a7a74a1f6ba3c..bba466b4f41a781489f737ab335279c4823d0af0 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/ModelInstaller.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/ModelInstaller.java @@ -58,11 +58,11 @@ public abstract class ModelInstaller { } } }); - models.addAll(downsamplingModels); + downsamplingModels.addAll(models); boolean debug = System.getProperty("debug") != null; - for (Model model : models) { + for (Model model : downsamplingModels) { if (!isExists(client, model)) { logger.info("table: {} not exists", model.getName()); createTable(client, model); diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/ttl/DataTTLKeeperTimer.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/ttl/DataTTLKeeperTimer.java new file mode 100644 index 0000000000000000000000000000000000000000..98a08b3eb7f8c46de7a0464ddcc0fabd73c72920 --- /dev/null +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/ttl/DataTTLKeeperTimer.java @@ -0,0 +1,122 @@ +/* + * 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.oap.server.core.storage.ttl; + +import java.io.IOException; +import java.util.List; +import java.util.concurrent.*; +import lombok.Setter; +import org.apache.skywalking.apm.util.RunnableWithExceptionProtection; +import org.apache.skywalking.oap.server.core.*; +import org.apache.skywalking.oap.server.core.analysis.indicator.Indicator; +import org.apache.skywalking.oap.server.core.analysis.record.Record; +import org.apache.skywalking.oap.server.core.cluster.*; +import org.apache.skywalking.oap.server.core.config.DownsamplingConfigService; +import org.apache.skywalking.oap.server.core.storage.*; +import org.apache.skywalking.oap.server.core.storage.model.*; +import org.apache.skywalking.oap.server.library.module.ModuleManager; +import org.apache.skywalking.oap.server.library.util.CollectionUtils; +import org.joda.time.DateTime; +import org.slf4j.*; + +/** + * @author peng-yongsheng + */ +public enum DataTTLKeeperTimer { + INSTANCE; + + private static final Logger logger = LoggerFactory.getLogger(DataTTLKeeperTimer.class); + + private ModuleManager moduleManager; + private ClusterNodesQuery clusterNodesQuery; + @Setter private DataTTL dataTTL; + + public void start(ModuleManager moduleManager) { + this.moduleManager = moduleManager; + this.clusterNodesQuery = moduleManager.find(ClusterModule.NAME).getService(ClusterNodesQuery.class); + + Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate( + new RunnableWithExceptionProtection(this::delete, + t -> logger.error("Remove data in background failure.", t)), 1, 5, TimeUnit.MINUTES); + } + + private void delete() { + List remoteInstances = clusterNodesQuery.queryRemoteNodes(); + if (CollectionUtils.isNotEmpty(remoteInstances) && !remoteInstances.get(0).isSelf()) { + logger.info("The selected first address is {}. Skip.", remoteInstances.get(0).toString()); + return; + } + + TimeBuckets timeBuckets = convertTimeBucket(new DateTime()); + logger.info("Beginning to remove expired metrics from the storage."); + logger.info("Metrics in minute dimension before {}, are going to be removed.", timeBuckets.minuteTimeBucketBefore); + logger.info("Metrics in hour dimension before {}, are going to be removed.", timeBuckets.hourTimeBucketBefore); + logger.info("Metrics in day dimension before {}, are going to be removed.", timeBuckets.dayTimeBucketBefore); + logger.info("Metrics in month dimension before {}, are going to be removed.", timeBuckets.monthTimeBucketBefore); + + IModelGetter modelGetter = moduleManager.find(CoreModule.NAME).getService(IModelGetter.class); + DownsamplingConfigService downsamplingConfigService = moduleManager.find(CoreModule.NAME).getService(DownsamplingConfigService.class); + List models = modelGetter.getModels(); + models.forEach(model -> { + if (model.isIndicator()) { + execute(model.getName(), timeBuckets.minuteTimeBucketBefore, Indicator.TIME_BUCKET); + + if (downsamplingConfigService.shouldToHour()) { + execute(model.getName() + Const.ID_SPLIT + Downsampling.Hour.getName(), timeBuckets.hourTimeBucketBefore, Indicator.TIME_BUCKET); + } + if (downsamplingConfigService.shouldToDay()) { + execute(model.getName() + Const.ID_SPLIT + Downsampling.Day.getName(), timeBuckets.dayTimeBucketBefore, Indicator.TIME_BUCKET); + } + if (downsamplingConfigService.shouldToMonth()) { + execute(model.getName() + Const.ID_SPLIT + Downsampling.Month.getName(), timeBuckets.monthTimeBucketBefore, Indicator.TIME_BUCKET); + } + } else { + execute(model.getName(), timeBuckets.recordDataTTL, Record.TIME_BUCKET); + } + }); + } + + TimeBuckets convertTimeBucket(DateTime currentTime) { + TimeBuckets timeBuckets = new TimeBuckets(); + + timeBuckets.recordDataTTL = Long.valueOf(currentTime.plusMinutes(0 - dataTTL.getRecordDataTTL()).toString("yyyyMMddHHmm")); + timeBuckets.minuteTimeBucketBefore = Long.valueOf(currentTime.plusMinutes(0 - dataTTL.getMinuteMetricsDataTTL()).toString("yyyyMMddHHmm")); + timeBuckets.hourTimeBucketBefore = Long.valueOf(currentTime.plusHours(0 - dataTTL.getHourMetricsDataTTL()).toString("yyyyMMddHH")); + timeBuckets.dayTimeBucketBefore = Long.valueOf(currentTime.plusDays(0 - dataTTL.getDayMetricsDataTTL()).toString("yyyyMMdd")); + timeBuckets.monthTimeBucketBefore = Long.valueOf(currentTime.plusMonths(0 - dataTTL.getMonthMetricsDataTTL()).toString("yyyyMM")); + + return timeBuckets; + } + + private void execute(String modelName, long timeBucketBefore, String timeBucketColumnName) { + try { + moduleManager.find(StorageModule.NAME).getService(IHistoryDeleteDAO.class).deleteHistory(modelName, timeBucketColumnName, timeBucketBefore); + } catch (IOException e) { + logger.warn("History delete failure, error message: {}", e.getMessage()); + } + } + + class TimeBuckets { + private long recordDataTTL; + private long minuteTimeBucketBefore; + private long hourTimeBucketBefore; + private long dayTimeBucketBefore; + private long monthTimeBucketBefore; + } +} \ No newline at end of file diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/type/StorageDataType.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/type/StorageDataType.java index 4545d9e0f1c6dbd98cb71ea22df495b02053b521..7b440d5f36dbbf17da696122ad4208225edb32f6 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/type/StorageDataType.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/type/StorageDataType.java @@ -26,4 +26,6 @@ public interface StorageDataType { String toStorageData(); void toObject(String data); + + void copyFrom(Object source); } diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/elasticsearch/ElasticSearchClient.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/elasticsearch/ElasticSearchClient.java index 7dd9adf6c4b2f4f1a428c2b0066b5ec399950956..45df02479e0a6d1d51e1a3701ec629fe51e850e4 100644 --- a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/elasticsearch/ElasticSearchClient.java +++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/elasticsearch/ElasticSearchClient.java @@ -166,22 +166,21 @@ public class ElasticSearchClient implements Client { return new UpdateRequest(indexName, TYPE, id).doc(source); } - public void delete(String indexName, String timeBucketColumnName, long startTimeBucket, - long endTimeBucket) throws IOException { + public int delete(String indexName, String timeBucketColumnName, long endTimeBucket) throws IOException { indexName = formatIndexName(indexName); - Map params = Collections.singletonMap("pretty", "true"); + Map params = Collections.singletonMap("conflicts", "proceed"); String jsonString = "{" + " \"query\": {" + " \"range\": {" + " \"" + timeBucketColumnName + "\": {" + - " \"gte\": " + startTimeBucket + "," + - " \"lte\": " + endTimeBucket + "" + + " \"lte\": " + endTimeBucket + " }" + " }" + " }" + "}"; HttpEntity entity = new NStringEntity(jsonString, ContentType.APPLICATION_JSON); - client.getLowLevelClient().performRequest("POST", "/" + indexName + "/_delete_by_query", params, entity); + Response response = client.getLowLevelClient().performRequest("POST", "/" + indexName + "/_delete_by_query", params, entity); + return response.getStatusLine().getStatusCode(); } private String formatIndexName(String indexName) { diff --git a/oap-server/server-starter/src/main/resources/application.yml b/oap-server/server-starter/src/main/resources/application.yml index ae772c79024c25670aa98c83103e72f8158c1304..9fac3e79bf9f5c5948b6ab601942cedcbfa05306 100644 --- a/oap-server/server-starter/src/main/resources/application.yml +++ b/oap-server/server-starter/src/main/resources/application.yml @@ -34,9 +34,15 @@ core: gRPCHost: 0.0.0.0 gRPCPort: 11800 downsampling: - - Hour - - Day - - Month + - Hour + - Day + - Month + # Set a timeout on metric data. After the timeout has expired, the metric data will automatically be deleted. + recordDataTTL: 90 # Unit is minute + minuteMetricsDataTTL: 90 # Unit is minute + hourMetricsDataTTL: 36 # Unit is hour + dayMetricsDataTTL: 45 # Unit is day + monthMetricsDataTTL: 18 # Unit is month storage: elasticsearch: clusterNodes: localhost:9200 @@ -47,12 +53,6 @@ storage: bulkSize: 20 # flush the bulk every 20mb flushInterval: 10 # flush the bulk every 10 seconds whatever the number of requests concurrentRequests: 2 # the number of concurrent requests - # Set a timeout on metric data. After the timeout has expired, the metric data will automatically be deleted. - traceDataTTL: 90 # Unit is minute - minuteMetricDataTTL: 90 # Unit is minute - hourMetricDataTTL: 36 # Unit is hour - dayMetricDataTTL: 45 # Unit is day - monthMetricDataTTL: 18 # Unit is month receiver-register: default: receiver-trace: diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchProvider.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchProvider.java index e6b9eb45397ccc2d3e654b6b6f3d56c35e784582..40d5416e21060a260e5bf1d0d7da00ff44851b9f 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchProvider.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchProvider.java @@ -69,6 +69,7 @@ public class StorageModuleElasticsearchProvider extends ModuleProvider { this.registerServiceImplementation(IBatchDAO.class, new BatchProcessEsDAO(elasticSearchClient, config.getBulkActions(), config.getBulkSize(), config.getFlushInterval(), config.getConcurrentRequests())); this.registerServiceImplementation(StorageDAO.class, new StorageEsDAO(elasticSearchClient)); this.registerServiceImplementation(IRegisterLockDAO.class, new RegisterLockDAOImpl(elasticSearchClient, 1000)); + this.registerServiceImplementation(IHistoryDeleteDAO.class, new HistoryDeleteEsDAO(elasticSearchClient)); this.registerServiceImplementation(IServiceInventoryCacheDAO.class, new ServiceInventoryCacheEsDAO(elasticSearchClient)); this.registerServiceImplementation(IServiceInstanceInventoryCacheDAO.class, new ServiceInstanceInventoryCacheDAO(elasticSearchClient)); diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java new file mode 100644 index 0000000000000000000000000000000000000000..d105fddd221d4389f48c05f42648c4b1d239e3a1 --- /dev/null +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java @@ -0,0 +1,45 @@ +/* + * 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.oap.server.storage.plugin.elasticsearch.base; + +import java.io.IOException; +import org.apache.skywalking.oap.server.core.analysis.indicator.Indicator; +import org.apache.skywalking.oap.server.core.storage.IHistoryDeleteDAO; +import org.apache.skywalking.oap.server.library.client.elasticsearch.ElasticSearchClient; +import org.slf4j.*; + +/** + * @author peng-yongsheng + */ +public class HistoryDeleteEsDAO extends EsDAO implements IHistoryDeleteDAO { + + private static final Logger logger = LoggerFactory.getLogger(HistoryDeleteEsDAO.class); + + public HistoryDeleteEsDAO(ElasticSearchClient client) { + super(client); + } + + @Override + public void deleteHistory(String modelName, String timeBucketColumnName, Long timeBucketBefore) throws IOException { + int statusCode = getClient().delete(modelName, Indicator.TIME_BUCKET, timeBucketBefore); + if (logger.isDebugEnabled()) { + logger.debug("Delete history from {} index, status code {}", modelName, statusCode); + } + } +} diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/IndicatorEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/IndicatorEsDAO.java index 8bfb6d46bb0132fa84585b7886c3d56bb19d5d8f..6e855d64572d90dbb8237d347bbcf6d364e345d8 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/IndicatorEsDAO.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/IndicatorEsDAO.java @@ -28,12 +28,15 @@ import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.common.xcontent.*; +import org.slf4j.*; /** * @author peng-yongsheng */ public class IndicatorEsDAO extends EsDAO implements IIndicatorDAO { + private static final Logger logger = LoggerFactory.getLogger(IndicatorEsDAO.class); + private final StorageBuilder storageBuilder; public IndicatorEsDAO(ElasticSearchClient client, StorageBuilder storageBuilder) { @@ -81,7 +84,4 @@ public class IndicatorEsDAO extends EsDAO implements IIndicatorDAO { builder.endObject(); return getClient().prepareInsert(modelName, record.id(), builder); } - - @Override public void deleteHistory(String modelName, Long timeBucketBefore) { - } }