提交 7bb577a4 编写于 作者: 彭勇升 pengys 提交者: wu-sheng

Provide auto delete history data service. (#1797)

上级 ad63d1c3
......@@ -33,8 +33,23 @@ public class CoreModuleConfig extends ModuleConfig {
@Setter private String gRPCHost;
@Setter private int gRPCPort;
private final List<String> 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;
}
}
......@@ -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
......
/*
* 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;
}
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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";
......
......@@ -83,4 +83,10 @@ public class IntKeyLongValue implements Comparable<IntKeyLongValue>, 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;
}
}
......@@ -31,6 +31,10 @@ public class IntKeyLongValueArray extends ArrayList<IntKeyLongValue> implements
super(initialCapacity);
}
public IntKeyLongValueArray() {
super(30);
}
public IntKeyLongValueArray(String data) {
super();
toObject(data);
......@@ -56,4 +60,13 @@ public class IntKeyLongValueArray extends ArrayList<IntKeyLongValue> 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);
});
}
}
......@@ -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";
......
......@@ -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<Indicator, Merg
private final MergeDataCache<Indicator> mergeDataCache;
private final IIndicatorDAO indicatorDAO;
private final AbstractWorker<Indicator> nextWorker;
private final DataCarrier<Indicator> dataCarrier;
IndicatorPersistentWorker(int workerId, String modelName, int batchSize, ModuleManager moduleManager,
IIndicatorDAO indicatorDAO, AbstractWorker<Indicator> nextWorker) {
......@@ -47,6 +50,13 @@ public class IndicatorPersistentWorker extends PersistenceWorker<Indicator, Merg
this.mergeDataCache = new MergeDataCache<>();
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<Indicator> getCache() {
......@@ -106,4 +116,38 @@ public class IndicatorPersistentWorker extends PersistenceWorker<Indicator, Merg
mergeDataCache.finishWriting();
}
private class PersistentConsumer implements IConsumer<Indicator> {
private final IndicatorPersistentWorker persistent;
private PersistentConsumer(IndicatorPersistentWorker persistent) {
this.persistent = persistent;
}
@Override public void init() {
}
@Override public void consume(List<Indicator> data) {
Iterator<Indicator> 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<Indicator> data, Throwable t) {
logger.error(t.getMessage(), t);
}
@Override public void onExit() {
}
}
}
......@@ -41,7 +41,7 @@ public abstract class PersistenceWorker<INPUT extends StorageData, CACHE extends
this.batchDAO = moduleManager.find(StorageModule.NAME).getService(IBatchDAO.class);
}
@Override public final void in(INPUT input) {
final void onWork(INPUT input) {
if (getCache().currentCollectionSize() >= batchSize) {
try {
if (getCache().trySwitchPointer()) {
......
......@@ -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<Record, NonMergeDa
private final String modelName;
private final NonMergeDataCache<Record> nonMergeDataCache;
private final IRecordDAO recordDAO;
private final DataCarrier<Record> dataCarrier;
RecordPersistentWorker(int workerId, String modelName, int batchSize, ModuleManager moduleManager,
IRecordDAO recordDAO) {
......@@ -42,6 +45,12 @@ public class RecordPersistentWorker extends PersistenceWorker<Record, NonMergeDa
this.modelName = modelName;
this.nonMergeDataCache = new NonMergeDataCache<>();
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<Record> getCache() {
......@@ -65,4 +74,30 @@ public class RecordPersistentWorker extends PersistenceWorker<Record, NonMergeDa
nonMergeDataCache.add(input);
nonMergeDataCache.finishWriting();
}
private class PersistentConsumer implements IConsumer<Record> {
private final RecordPersistentWorker persistent;
private PersistentConsumer(RecordPersistentWorker persistent) {
this.persistent = persistent;
}
@Override public void init() {
}
@Override public void consume(List<Record> data) {
for (Record record : data) {
persistent.onWork(record);
}
}
@Override public void onError(List<Record> data, Throwable t) {
logger.error(t.getMessage(), t);
}
@Override public void onExit() {
}
}
}
......@@ -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";
......
......@@ -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";
......
......@@ -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";
......
......@@ -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";
......
......@@ -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;
}
}
}
/*
* 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;
}
......@@ -31,6 +31,4 @@ public interface IIndicatorDAO<INSERT, UPDATE> extends DAO {
INSERT prepareBatchInsert(String modelName, Indicator indicator) throws IOException;
UPDATE prepareBatchUpdate(String modelName, Indicator indicator) throws IOException;
void deleteHistory(String modelName, Long timeBucketBefore);
}
......@@ -27,6 +27,4 @@ import org.apache.skywalking.oap.server.core.analysis.record.Record;
public interface IRecordDAO<INSERT> extends DAO {
INSERT prepareBatchInsert(String modelName, Record record) throws IOException;
void deleteHistory(String modelName, Long timeBucketBefore);
}
......@@ -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};
......
......@@ -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<ModelColumn> 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<ModelColumn> modelColumns) {
......
......@@ -30,4 +30,6 @@ public @interface StorageEntity {
String name();
Class<? extends StorageBuilder> builder();
boolean deleteHistory() default true;
}
......@@ -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<? extends StorageBuilder> getBuilder(Class aClass) {
if (aClass.isAnnotationPresent(StorageEntity.class)) {
StorageEntity annotation = (StorageEntity)aClass.getAnnotation(StorageEntity.class);
......
......@@ -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<ModelColumn> columns;
public Model(String name, List<ModelColumn> columns, boolean isIndicator) {
public Model(String name, List<ModelColumn> 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);
}
}
......@@ -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);
......
/*
* 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<RemoteInstance> 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<Model> 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
......@@ -26,4 +26,6 @@ public interface StorageDataType {
String toStorageData();
void toObject(String data);
void copyFrom(Object source);
}
......@@ -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<String, String> params = Collections.singletonMap("pretty", "true");
Map<String, String> 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) {
......
......@@ -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:
......
......@@ -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));
......
/*
* 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);
}
}
}
......@@ -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<IndexRequest, UpdateRequest> {
private static final Logger logger = LoggerFactory.getLogger(IndicatorEsDAO.class);
private final StorageBuilder<Indicator> storageBuilder;
public IndicatorEsDAO(ElasticSearchClient client, StorageBuilder<Indicator> storageBuilder) {
......@@ -81,7 +84,4 @@ public class IndicatorEsDAO extends EsDAO implements IIndicatorDAO<IndexRequest,
builder.endObject();
return getClient().prepareUpdate(modelName, indicator.id(), builder);
}
@Override public void deleteHistory(String modelName, Long timeBucketBefore) {
}
}
......@@ -54,7 +54,4 @@ public class RecordEsDAO extends EsDAO implements IRecordDAO<IndexRequest> {
builder.endObject();
return getClient().prepareInsert(modelName, record.id(), builder);
}
@Override public void deleteHistory(String modelName, Long timeBucketBefore) {
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册