Fix CI and Add new alarm bridge by using latest code generator.
This commit is contained in:
parent
42eb8f7376
commit
59a30ed0ac
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* 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.alarm;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.skywalking.oap.server.core.source.Scope;
|
||||
|
||||
/**
|
||||
* @author wusheng
|
||||
*/
|
||||
public class AlarmMeta {
|
||||
@Setter @Getter private String indicatorName;
|
||||
@Setter @Getter private Scope scope;
|
||||
@Setter @Getter private ScopeIDs ids;
|
||||
|
||||
public AlarmMeta(String indicatorName, Scope scope, int... ids) {
|
||||
this.indicatorName = indicatorName;
|
||||
this.scope = scope;
|
||||
this.ids = new ScopeIDs(ids);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* 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.alarm;
|
||||
|
||||
/**
|
||||
* Alarm supported interface implementor could return the {@link AlarmMeta}
|
||||
*
|
||||
* @author wusheng
|
||||
*/
|
||||
public interface AlarmSupported {
|
||||
AlarmMeta getAlarmMeta();
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* 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.alarm;
|
||||
|
||||
/**
|
||||
* Scope IDs represent IDs of this scope.
|
||||
* Such as:
|
||||
* 1. Service, Endpoint have a single int ID.
|
||||
* 2. Service Relation ID is combined by two INTs.
|
||||
*/
|
||||
public class ScopeIDs {
|
||||
private int[] ids;
|
||||
|
||||
public ScopeIDs(int... ids) {
|
||||
this.ids = ids;
|
||||
}
|
||||
|
||||
public int getID(int idx) {
|
||||
return ids[idx];
|
||||
}
|
||||
}
|
||||
|
|
@ -21,12 +21,15 @@ package org.apache.skywalking.oap.server.core.analysis.generated.endpoint;
|
|||
import java.util.*;
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.LongAvgIndicator;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmMeta;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmSupported;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.*;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.annotation.IndicatorType;
|
||||
import org.apache.skywalking.oap.server.core.remote.annotation.StreamData;
|
||||
import org.apache.skywalking.oap.server.core.remote.grpc.proto.RemoteData;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.source.Scope;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
|
|
@ -36,7 +39,7 @@ import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
|||
@IndicatorType
|
||||
@StreamData
|
||||
@StorageEntity(name = "endpoint_avg", builder = EndpointAvgIndicator.Builder.class)
|
||||
public class EndpointAvgIndicator extends LongAvgIndicator {
|
||||
public class EndpointAvgIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") private int id;
|
||||
@Setter @Getter @Column(columnName = "service_id") private int serviceId;
|
||||
|
|
@ -101,6 +104,10 @@ public class EndpointAvgIndicator extends LongAvgIndicator {
|
|||
setCount(remoteData.getDataIntegers(3));
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("endpoint_Avg", Scope.Endpoint, id, serviceId, serviceInstanceId);
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<EndpointAvgIndicator> {
|
||||
|
||||
@Override public Map<String, Object> data2Map(EndpointAvgIndicator storageData) {
|
||||
|
|
|
|||
|
|
@ -19,9 +19,8 @@
|
|||
package org.apache.skywalking.oap.server.core.analysis.generated.endpoint;
|
||||
|
||||
import org.apache.skywalking.oap.server.core.analysis.SourceDispatcher;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.expression.EqualMatch;
|
||||
import org.apache.skywalking.oap.server.core.analysis.worker.IndicatorProcess;
|
||||
import org.apache.skywalking.oap.server.core.source.Endpoint;
|
||||
import org.apache.skywalking.oap.server.core.source.*;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
|
|
@ -38,6 +37,7 @@ public class EndpointDispatcher implements SourceDispatcher<Endpoint> {
|
|||
private void doEndpointAvg(Endpoint source) {
|
||||
EndpointAvgIndicator indicator = new EndpointAvgIndicator();
|
||||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setServiceId(source.getServiceId());
|
||||
|
|
@ -49,11 +49,12 @@ public class EndpointDispatcher implements SourceDispatcher<Endpoint> {
|
|||
private void doEndpointPercent(Endpoint source) {
|
||||
EndpointPercentIndicator indicator = new EndpointPercentIndicator();
|
||||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setServiceId(source.getServiceId());
|
||||
indicator.setServiceInstanceId(source.getServiceInstanceId());
|
||||
indicator.combine(new EqualMatch(), source.isStatus(), true);
|
||||
indicator.combine(new org.apache.skywalking.oap.server.core.analysis.indicator.expression.EqualMatch(), source.isStatus(), true);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,12 +21,15 @@ package org.apache.skywalking.oap.server.core.analysis.generated.endpoint;
|
|||
import java.util.*;
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.PercentIndicator;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmMeta;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmSupported;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.*;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.annotation.IndicatorType;
|
||||
import org.apache.skywalking.oap.server.core.remote.annotation.StreamData;
|
||||
import org.apache.skywalking.oap.server.core.remote.grpc.proto.RemoteData;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.source.Scope;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
|
|
@ -36,7 +39,7 @@ import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
|||
@IndicatorType
|
||||
@StreamData
|
||||
@StorageEntity(name = "endpoint_percent", builder = EndpointPercentIndicator.Builder.class)
|
||||
public class EndpointPercentIndicator extends PercentIndicator {
|
||||
public class EndpointPercentIndicator extends PercentIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") private int id;
|
||||
@Setter @Getter @Column(columnName = "service_id") private int serviceId;
|
||||
|
|
@ -101,6 +104,10 @@ public class EndpointPercentIndicator extends PercentIndicator {
|
|||
setPercentage(remoteData.getDataIntegers(3));
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("endpoint_percent", Scope.Endpoint, id, serviceId, serviceInstanceId);
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<EndpointPercentIndicator> {
|
||||
|
||||
@Override public Map<String, Object> data2Map(EndpointPercentIndicator storageData) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* 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.analysis.generated.service;
|
||||
|
||||
import java.util.*;
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmMeta;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmSupported;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.*;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.annotation.IndicatorType;
|
||||
import org.apache.skywalking.oap.server.core.remote.annotation.StreamData;
|
||||
import org.apache.skywalking.oap.server.core.remote.grpc.proto.RemoteData;
|
||||
import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.source.Scope;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
*
|
||||
* @author Observability Analysis Language code generator
|
||||
*/
|
||||
@IndicatorType
|
||||
@StreamData
|
||||
@StorageEntity(name = "service_avg", builder = ServiceAvgIndicator.Builder.class)
|
||||
public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") private int id;
|
||||
|
||||
@Override public String id() {
|
||||
String splitJointId = String.valueOf(getTimeBucket());
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(id);
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + id;
|
||||
result = 31 * result + (int)getTimeBucket();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
|
||||
ServiceAvgIndicator indicator = (ServiceAvgIndicator)obj;
|
||||
if (id != indicator.id)
|
||||
return false;
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override public RemoteData.Builder serialize() {
|
||||
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
|
||||
|
||||
remoteBuilder.setDataLongs(0, getSummation());
|
||||
remoteBuilder.setDataLongs(1, getValue());
|
||||
remoteBuilder.setDataLongs(2, getTimeBucket());
|
||||
|
||||
|
||||
remoteBuilder.setDataIntegers(0, getId());
|
||||
remoteBuilder.setDataIntegers(1, getCount());
|
||||
|
||||
return remoteBuilder;
|
||||
}
|
||||
|
||||
@Override public void deserialize(RemoteData remoteData) {
|
||||
|
||||
setSummation(remoteData.getDataLongs(0));
|
||||
setValue(remoteData.getDataLongs(1));
|
||||
setTimeBucket(remoteData.getDataLongs(2));
|
||||
|
||||
|
||||
setId(remoteData.getDataIntegers(0));
|
||||
setCount(remoteData.getDataIntegers(1));
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("Service_Avg", Scope.Service, id);
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<ServiceAvgIndicator> {
|
||||
|
||||
@Override public Map<String, Object> data2Map(ServiceAvgIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", storageData.getId());
|
||||
map.put("summation", storageData.getSummation());
|
||||
map.put("count", storageData.getCount());
|
||||
map.put("value", storageData.getValue());
|
||||
map.put("time_bucket", storageData.getTimeBucket());
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override public ServiceAvgIndicator map2Data(Map<String, Object> dbMap) {
|
||||
ServiceAvgIndicator indicator = new ServiceAvgIndicator();
|
||||
indicator.setId(((Number)dbMap.get("id")).intValue());
|
||||
indicator.setSummation(((Number)dbMap.get("summation")).longValue());
|
||||
indicator.setCount(((Number)dbMap.get("count")).intValue());
|
||||
indicator.setValue(((Number)dbMap.get("value")).longValue());
|
||||
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
|
||||
return indicator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.oap.server.core.analysis.generated.service;
|
||||
|
||||
import org.apache.skywalking.oap.server.core.analysis.SourceDispatcher;
|
||||
import org.apache.skywalking.oap.server.core.analysis.worker.IndicatorProcess;
|
||||
import org.apache.skywalking.oap.server.core.source.*;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
*
|
||||
* @author Observability Analysis Language code generator
|
||||
*/
|
||||
public class ServiceDispatcher implements SourceDispatcher<Service> {
|
||||
|
||||
@Override public void dispatch(Service source) {
|
||||
doServiceAvg(source);
|
||||
}
|
||||
|
||||
private void doServiceAvg(Service source) {
|
||||
ServiceAvgIndicator indicator = new ServiceAvgIndicator();
|
||||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.combine(source.getLatency(), 1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
}
|
||||
}
|
||||
|
|
@ -21,12 +21,15 @@ package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstance
|
|||
import java.util.*;
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.DoubleAvgIndicator;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmMeta;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmSupported;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.*;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.annotation.IndicatorType;
|
||||
import org.apache.skywalking.oap.server.core.remote.annotation.StreamData;
|
||||
import org.apache.skywalking.oap.server.core.remote.grpc.proto.RemoteData;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.source.Scope;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
|
|
@ -36,7 +39,7 @@ import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
|||
@IndicatorType
|
||||
@StreamData
|
||||
@StorageEntity(name = "instance_jvm_cpu", builder = InstanceJvmCpuIndicator.Builder.class)
|
||||
public class InstanceJvmCpuIndicator extends DoubleAvgIndicator {
|
||||
public class InstanceJvmCpuIndicator extends DoubleAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") private int id;
|
||||
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
|
||||
|
|
@ -98,6 +101,10 @@ public class InstanceJvmCpuIndicator extends DoubleAvgIndicator {
|
|||
setCount(remoteData.getDataIntegers(2));
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("instance_jvm_cpu", Scope.ServiceInstanceJVMCPU, id, serviceInstanceId);
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<InstanceJvmCpuIndicator> {
|
||||
|
||||
@Override public Map<String, Object> data2Map(InstanceJvmCpuIndicator storageData) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstance
|
|||
|
||||
import org.apache.skywalking.oap.server.core.analysis.SourceDispatcher;
|
||||
import org.apache.skywalking.oap.server.core.analysis.worker.IndicatorProcess;
|
||||
import org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMCPU;
|
||||
import org.apache.skywalking.oap.server.core.source.*;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
|
|
@ -36,6 +36,7 @@ public class ServiceInstanceJVMCPUDispatcher implements SourceDispatcher<Service
|
|||
private void doInstanceJvmCpu(ServiceInstanceJVMCPU source) {
|
||||
InstanceJvmCpuIndicator indicator = new InstanceJvmCpuIndicator();
|
||||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setServiceInstanceId(source.getServiceInstanceId());
|
||||
|
|
|
|||
|
|
@ -21,12 +21,15 @@ package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstance
|
|||
import java.util.*;
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.LongAvgIndicator;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmMeta;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmSupported;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.*;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.annotation.IndicatorType;
|
||||
import org.apache.skywalking.oap.server.core.remote.annotation.StreamData;
|
||||
import org.apache.skywalking.oap.server.core.remote.grpc.proto.RemoteData;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.source.Scope;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
|
|
@ -35,8 +38,8 @@ import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
|||
*/
|
||||
@IndicatorType
|
||||
@StreamData
|
||||
@StorageEntity(name = "instance_jvm_gc_time", builder = InstanceJvmGcTimeIndicator.Builder.class)
|
||||
public class InstanceJvmGcTimeIndicator extends LongAvgIndicator {
|
||||
@StorageEntity(name = "instance_jvm_young_gc_time", builder = InstanceJvmYoungGcTimeIndicator.Builder.class)
|
||||
public class InstanceJvmYoungGcTimeIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") private int id;
|
||||
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
|
||||
|
|
@ -62,7 +65,7 @@ public class InstanceJvmGcTimeIndicator extends LongAvgIndicator {
|
|||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
|
||||
InstanceJvmGcTimeIndicator indicator = (InstanceJvmGcTimeIndicator)obj;
|
||||
InstanceJvmYoungGcTimeIndicator indicator = (InstanceJvmYoungGcTimeIndicator)obj;
|
||||
if (id != indicator.id)
|
||||
return false;
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -98,9 +101,13 @@ public class InstanceJvmGcTimeIndicator extends LongAvgIndicator {
|
|||
setCount(remoteData.getDataIntegers(2));
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<InstanceJvmGcTimeIndicator> {
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("instance_jvm_young_gc_time", Scope.ServiceInstanceJVMGC, id, serviceInstanceId);
|
||||
}
|
||||
|
||||
@Override public Map<String, Object> data2Map(InstanceJvmGcTimeIndicator storageData) {
|
||||
public static class Builder implements StorageBuilder<InstanceJvmYoungGcTimeIndicator> {
|
||||
|
||||
@Override public Map<String, Object> data2Map(InstanceJvmYoungGcTimeIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", storageData.getId());
|
||||
map.put("service_instance_id", storageData.getServiceInstanceId());
|
||||
|
|
@ -111,8 +118,8 @@ public class InstanceJvmGcTimeIndicator extends LongAvgIndicator {
|
|||
return map;
|
||||
}
|
||||
|
||||
@Override public InstanceJvmGcTimeIndicator map2Data(Map<String, Object> dbMap) {
|
||||
InstanceJvmGcTimeIndicator indicator = new InstanceJvmGcTimeIndicator();
|
||||
@Override public InstanceJvmYoungGcTimeIndicator map2Data(Map<String, Object> dbMap) {
|
||||
InstanceJvmYoungGcTimeIndicator indicator = new InstanceJvmYoungGcTimeIndicator();
|
||||
indicator.setId(((Number)dbMap.get("id")).intValue());
|
||||
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
|
||||
indicator.setSummation(((Number)dbMap.get("summation")).longValue());
|
||||
|
|
@ -20,7 +20,8 @@ package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstance
|
|||
|
||||
import org.apache.skywalking.oap.server.core.analysis.SourceDispatcher;
|
||||
import org.apache.skywalking.oap.server.core.analysis.worker.IndicatorProcess;
|
||||
import org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMGC;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.expression.*;
|
||||
import org.apache.skywalking.oap.server.core.source.*;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
|
|
@ -30,11 +31,15 @@ import org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMGC;
|
|||
public class ServiceInstanceJVMGCDispatcher implements SourceDispatcher<ServiceInstanceJVMGC> {
|
||||
|
||||
@Override public void dispatch(ServiceInstanceJVMGC source) {
|
||||
doInstanceJvmGcTime(source);
|
||||
doInstanceJvmYoungGcTime(source);
|
||||
}
|
||||
|
||||
private void doInstanceJvmGcTime(ServiceInstanceJVMGC source) {
|
||||
InstanceJvmGcTimeIndicator indicator = new InstanceJvmGcTimeIndicator();
|
||||
private void doInstanceJvmYoungGcTime(ServiceInstanceJVMGC source) {
|
||||
InstanceJvmYoungGcTimeIndicator indicator = new InstanceJvmYoungGcTimeIndicator();
|
||||
|
||||
if (!new EqualMatch().setLeft(source.getPhrase()).setRight(GCPhrase.NEW).match()) {
|
||||
return;
|
||||
}
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
|
|
|
|||
|
|
@ -21,12 +21,15 @@ package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstance
|
|||
import java.util.*;
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.LongAvgIndicator;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmMeta;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmSupported;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.*;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.annotation.IndicatorType;
|
||||
import org.apache.skywalking.oap.server.core.remote.annotation.StreamData;
|
||||
import org.apache.skywalking.oap.server.core.remote.grpc.proto.RemoteData;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.source.Scope;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
|
|
@ -36,7 +39,7 @@ import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
|||
@IndicatorType
|
||||
@StreamData
|
||||
@StorageEntity(name = "instance_jvm_memory_max", builder = InstanceJvmMemoryMaxIndicator.Builder.class)
|
||||
public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator {
|
||||
public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") private int id;
|
||||
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
|
||||
|
|
@ -98,6 +101,10 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator {
|
|||
setCount(remoteData.getDataIntegers(2));
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("instance_jvm_memory_max", Scope.ServiceInstanceJVMMemory, id, serviceInstanceId);
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<InstanceJvmMemoryMaxIndicator> {
|
||||
|
||||
@Override public Map<String, Object> data2Map(InstanceJvmMemoryMaxIndicator storageData) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstance
|
|||
|
||||
import org.apache.skywalking.oap.server.core.analysis.SourceDispatcher;
|
||||
import org.apache.skywalking.oap.server.core.analysis.worker.IndicatorProcess;
|
||||
import org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMMemory;
|
||||
import org.apache.skywalking.oap.server.core.source.*;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
|
|
@ -36,6 +36,7 @@ public class ServiceInstanceJVMMemoryDispatcher implements SourceDispatcher<Serv
|
|||
private void doInstanceJvmMemoryMax(ServiceInstanceJVMMemory source) {
|
||||
InstanceJvmMemoryMaxIndicator indicator = new InstanceJvmMemoryMaxIndicator();
|
||||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setServiceInstanceId(source.getServiceInstanceId());
|
||||
|
|
|
|||
|
|
@ -21,12 +21,15 @@ package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstance
|
|||
import java.util.*;
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.LongAvgIndicator;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmMeta;
|
||||
import org.apache.skywalking.oap.server.core.alarm.AlarmSupported;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.*;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.annotation.IndicatorType;
|
||||
import org.apache.skywalking.oap.server.core.remote.annotation.StreamData;
|
||||
import org.apache.skywalking.oap.server.core.remote.grpc.proto.RemoteData;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.source.Scope;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
|
|
@ -36,7 +39,7 @@ import org.apache.skywalking.oap.server.core.storage.annotation.*;
|
|||
@IndicatorType
|
||||
@StreamData
|
||||
@StorageEntity(name = "instance_jvm_memory_pool_max", builder = InstanceJvmMemoryPoolMaxIndicator.Builder.class)
|
||||
public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator {
|
||||
public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") private int id;
|
||||
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
|
||||
|
|
@ -98,6 +101,10 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator {
|
|||
setCount(remoteData.getDataIntegers(2));
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("instance_jvm_memory_pool_max", Scope.ServiceInstanceJVMMemoryPool, id, serviceInstanceId);
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<InstanceJvmMemoryPoolMaxIndicator> {
|
||||
|
||||
@Override public Map<String, Object> data2Map(InstanceJvmMemoryPoolMaxIndicator storageData) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstance
|
|||
|
||||
import org.apache.skywalking.oap.server.core.analysis.SourceDispatcher;
|
||||
import org.apache.skywalking.oap.server.core.analysis.worker.IndicatorProcess;
|
||||
import org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMMemoryPool;
|
||||
import org.apache.skywalking.oap.server.core.source.*;
|
||||
|
||||
/**
|
||||
* This class is auto generated. Please don't change this class manually.
|
||||
|
|
@ -36,6 +36,7 @@ public class ServiceInstanceJVMMemoryPoolDispatcher implements SourceDispatcher<
|
|||
private void doInstanceJvmMemoryPoolMax(ServiceInstanceJVMMemoryPool source) {
|
||||
InstanceJvmMemoryPoolMaxIndicator indicator = new InstanceJvmMemoryPoolMaxIndicator();
|
||||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setServiceInstanceId(source.getServiceInstanceId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue