未验证 提交 7e23f495 编写于 作者: wu-sheng's avatar wu-sheng 提交者: GitHub

Generate all metric for official release, also new func (#1679)

* New generated indicators for real backend system.

* Support cpm and new indicators.

* Fix CI and change document.

* Remove an useless line.
上级 2bad786e
......@@ -61,7 +61,7 @@ Calculate the metric data if the service instance is a JVM and collected by java
| id | Represent the unique id of the service instance, usually a number. | yes | int |
| name | Represent the name of the service instance. Such as `ip:port@Service Name`. **Notice**: current native agent uses `processId@Service name` as instance name, which is useless when you want to setup a filter in aggregation. | | string|
| serviceName | Represent the name of the service. | | string |
| isHeap | Represent this value the memory metric values are heap or not | | bool |
| heapStatus | Represent this value the memory metric values are heap or not | | bool |
| init | See JVM document | | long |
| max | See JVM document | | long |
| used | See JVM document | | long |
......
......@@ -19,14 +19,15 @@
package org.apache.skywalking.oap.server.core.analysis.generated.all;
import java.util.*;
import org.apache.skywalking.oap.server.core.alarm.*;
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.source.Scope;
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.storage.annotation.StorageEntity;
import org.apache.skywalking.oap.server.core.source.Scope;
/**
* This class is auto generated. Please don't change this class manually.
......@@ -38,6 +39,7 @@ import org.apache.skywalking.oap.server.core.storage.annotation.StorageEntity;
@StorageEntity(name = "all_heatmap", builder = AllHeatmapIndicator.Builder.class)
public class AllHeatmapIndicator extends ThermodynamicIndicator implements AlarmSupported {
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
return splitJointId;
......@@ -49,6 +51,7 @@ public class AllHeatmapIndicator extends ThermodynamicIndicator implements Alarm
return result;
}
@Override public int remoteHashCode() {
int result = 17;
return result;
......@@ -75,6 +78,7 @@ public class AllHeatmapIndicator extends ThermodynamicIndicator implements Alarm
remoteBuilder.setDataLongs(0, getTimeBucket());
remoteBuilder.setDataIntegers(0, getStep());
remoteBuilder.setDataIntegers(1, getNumOfSteps());
getDetailGroup().forEach(element -> remoteBuilder.addDataIntLongPairList(element.serialize()));
......@@ -86,6 +90,7 @@ public class AllHeatmapIndicator extends ThermodynamicIndicator implements Alarm
setTimeBucket(remoteData.getDataLongs(0));
setStep(remoteData.getDataIntegers(0));
setNumOfSteps(remoteData.getDataIntegers(1));
......@@ -97,7 +102,7 @@ public class AllHeatmapIndicator extends ThermodynamicIndicator implements Alarm
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("All_heatmap", Scope.All);
return new AlarmMeta("all_heatmap", Scope.All);
}
@Override
......@@ -148,7 +153,7 @@ public class AllHeatmapIndicator extends ThermodynamicIndicator implements Alarm
AllHeatmapIndicator indicator = new AllHeatmapIndicator();
indicator.setStep(((Number)dbMap.get("step")).intValue());
indicator.setNumOfSteps(((Number)dbMap.get("num_of_steps")).intValue());
indicator.setDetailGroup((IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
......
......@@ -102,7 +102,7 @@ public class AllP50Indicator extends P50Indicator implements AlarmSupported {
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("All_p50", Scope.All);
return new AlarmMeta("all_p50", Scope.All);
}
@Override
......@@ -153,7 +153,7 @@ public class AllP50Indicator extends P50Indicator implements AlarmSupported {
AllP50Indicator indicator = new AllP50Indicator();
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
......
......@@ -102,7 +102,7 @@ public class AllP75Indicator extends P75Indicator implements AlarmSupported {
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("All_p75", Scope.All);
return new AlarmMeta("all_p75", Scope.All);
}
@Override
......@@ -153,7 +153,7 @@ public class AllP75Indicator extends P75Indicator implements AlarmSupported {
AllP75Indicator indicator = new AllP75Indicator();
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
......
......@@ -102,7 +102,7 @@ public class AllP90Indicator extends P90Indicator implements AlarmSupported {
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("All_p90", Scope.All);
return new AlarmMeta("all_p90", Scope.All);
}
@Override
......@@ -153,7 +153,7 @@ public class AllP90Indicator extends P90Indicator implements AlarmSupported {
AllP90Indicator indicator = new AllP90Indicator();
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
......
......@@ -102,7 +102,7 @@ public class AllP95Indicator extends P95Indicator implements AlarmSupported {
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("All_p95", Scope.All);
return new AlarmMeta("all_p95", Scope.All);
}
@Override
......@@ -153,7 +153,7 @@ public class AllP95Indicator extends P95Indicator implements AlarmSupported {
AllP95Indicator indicator = new AllP95Indicator();
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
......
......@@ -102,7 +102,7 @@ public class AllP99Indicator extends P99Indicator implements AlarmSupported {
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("All_p99", Scope.All);
return new AlarmMeta("all_p99", Scope.All);
}
@Override
......@@ -153,7 +153,7 @@ public class AllP99Indicator extends P99Indicator implements AlarmSupported {
AllP99Indicator indicator = new AllP99Indicator();
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
......
......@@ -31,7 +31,12 @@ public class EndpointDispatcher implements SourceDispatcher<Endpoint> {
@Override public void dispatch(Endpoint source) {
doEndpointAvg(source);
doEndpointPercent(source);
doEndpointSla(source);
doEndpointP99(source);
doEndpointP95(source);
doEndpointP90(source);
doEndpointP75(source);
doEndpointP50(source);
}
private void doEndpointAvg(Endpoint source) {
......@@ -46,8 +51,8 @@ public class EndpointDispatcher implements SourceDispatcher<Endpoint> {
IndicatorProcess.INSTANCE.in(indicator);
}
private void doEndpointPercent(Endpoint source) {
EndpointPercentIndicator indicator = new EndpointPercentIndicator();
private void doEndpointSla(Endpoint source) {
EndpointSlaIndicator indicator = new EndpointSlaIndicator();
indicator.setTimeBucket(source.getTimeBucket());
......@@ -58,4 +63,64 @@ public class EndpointDispatcher implements SourceDispatcher<Endpoint> {
IndicatorProcess.INSTANCE.in(indicator);
}
private void doEndpointP99(Endpoint source) {
EndpointP99Indicator indicator = new EndpointP99Indicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceId(source.getServiceId());
indicator.setServiceInstanceId(source.getServiceInstanceId());
indicator.combine(source.getLatency(), 10);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doEndpointP95(Endpoint source) {
EndpointP95Indicator indicator = new EndpointP95Indicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceId(source.getServiceId());
indicator.setServiceInstanceId(source.getServiceInstanceId());
indicator.combine(source.getLatency(), 10);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doEndpointP90(Endpoint source) {
EndpointP90Indicator indicator = new EndpointP90Indicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceId(source.getServiceId());
indicator.setServiceInstanceId(source.getServiceInstanceId());
indicator.combine(source.getLatency(), 10);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doEndpointP75(Endpoint source) {
EndpointP75Indicator indicator = new EndpointP75Indicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceId(source.getServiceId());
indicator.setServiceInstanceId(source.getServiceInstanceId());
indicator.combine(source.getLatency(), 10);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doEndpointP50(Endpoint source) {
EndpointP50Indicator indicator = new EndpointP50Indicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceId(source.getServiceId());
indicator.setServiceInstanceId(source.getServiceInstanceId());
indicator.combine(source.getLatency(), 10);
IndicatorProcess.INSTANCE.in(indicator);
}
}
/*
* 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.endpoint;
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 = "endpoint_p50", builder = EndpointP50Indicator.Builder.class)
public class EndpointP50Indicator extends P50Indicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_id") private int serviceId;
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EndpointP50Indicator indicator = (EndpointP50Indicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTimeBucket());
remoteBuilder.setDataIntegers(0, getServiceId());
remoteBuilder.setDataIntegers(1, getServiceInstanceId());
remoteBuilder.setDataIntegers(2, getValue());
remoteBuilder.setDataIntegers(3, getPrecision());
getDetailGroup().forEach(element -> remoteBuilder.addDataIntLongPairList(element.serialize()));
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTimeBucket(remoteData.getDataLongs(0));
setServiceId(remoteData.getDataIntegers(0));
setServiceInstanceId(remoteData.getDataIntegers(1));
setValue(remoteData.getDataIntegers(2));
setPrecision(remoteData.getDataIntegers(3));
setDetailGroup(new IntKeyLongValueArray(30));
remoteData.getDataIntLongPairListList().forEach(element -> {
getDetailGroup().add(new IntKeyLongValue(element.getKey(), element.getValue()));
});
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("endpoint_p50", Scope.Endpoint, entityId);
}
@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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<EndpointP50Indicator> {
@Override public Map<String, Object> data2Map(EndpointP50Indicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_id", storageData.getServiceId());
map.put("service_instance_id", storageData.getServiceInstanceId());
map.put("value", storageData.getValue());
map.put("precision", storageData.getPrecision());
map.put("detail_group", storageData.getDetailGroup());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public EndpointP50Indicator map2Data(Map<String, Object> dbMap) {
EndpointP50Indicator indicator = new EndpointP50Indicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceId(((Number)dbMap.get("service_id")).intValue());
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
/*
* 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.endpoint;
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 = "endpoint_p75", builder = EndpointP75Indicator.Builder.class)
public class EndpointP75Indicator extends P75Indicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_id") private int serviceId;
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EndpointP75Indicator indicator = (EndpointP75Indicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTimeBucket());
remoteBuilder.setDataIntegers(0, getServiceId());
remoteBuilder.setDataIntegers(1, getServiceInstanceId());
remoteBuilder.setDataIntegers(2, getValue());
remoteBuilder.setDataIntegers(3, getPrecision());
getDetailGroup().forEach(element -> remoteBuilder.addDataIntLongPairList(element.serialize()));
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTimeBucket(remoteData.getDataLongs(0));
setServiceId(remoteData.getDataIntegers(0));
setServiceInstanceId(remoteData.getDataIntegers(1));
setValue(remoteData.getDataIntegers(2));
setPrecision(remoteData.getDataIntegers(3));
setDetailGroup(new IntKeyLongValueArray(30));
remoteData.getDataIntLongPairListList().forEach(element -> {
getDetailGroup().add(new IntKeyLongValue(element.getKey(), element.getValue()));
});
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("endpoint_p75", Scope.Endpoint, entityId);
}
@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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<EndpointP75Indicator> {
@Override public Map<String, Object> data2Map(EndpointP75Indicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_id", storageData.getServiceId());
map.put("service_instance_id", storageData.getServiceInstanceId());
map.put("value", storageData.getValue());
map.put("precision", storageData.getPrecision());
map.put("detail_group", storageData.getDetailGroup());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public EndpointP75Indicator map2Data(Map<String, Object> dbMap) {
EndpointP75Indicator indicator = new EndpointP75Indicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceId(((Number)dbMap.get("service_id")).intValue());
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
/*
* 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.endpoint;
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 = "endpoint_p90", builder = EndpointP90Indicator.Builder.class)
public class EndpointP90Indicator extends P90Indicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_id") private int serviceId;
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EndpointP90Indicator indicator = (EndpointP90Indicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTimeBucket());
remoteBuilder.setDataIntegers(0, getServiceId());
remoteBuilder.setDataIntegers(1, getServiceInstanceId());
remoteBuilder.setDataIntegers(2, getValue());
remoteBuilder.setDataIntegers(3, getPrecision());
getDetailGroup().forEach(element -> remoteBuilder.addDataIntLongPairList(element.serialize()));
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTimeBucket(remoteData.getDataLongs(0));
setServiceId(remoteData.getDataIntegers(0));
setServiceInstanceId(remoteData.getDataIntegers(1));
setValue(remoteData.getDataIntegers(2));
setPrecision(remoteData.getDataIntegers(3));
setDetailGroup(new IntKeyLongValueArray(30));
remoteData.getDataIntLongPairListList().forEach(element -> {
getDetailGroup().add(new IntKeyLongValue(element.getKey(), element.getValue()));
});
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("endpoint_p90", Scope.Endpoint, entityId);
}
@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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<EndpointP90Indicator> {
@Override public Map<String, Object> data2Map(EndpointP90Indicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_id", storageData.getServiceId());
map.put("service_instance_id", storageData.getServiceInstanceId());
map.put("value", storageData.getValue());
map.put("precision", storageData.getPrecision());
map.put("detail_group", storageData.getDetailGroup());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public EndpointP90Indicator map2Data(Map<String, Object> dbMap) {
EndpointP90Indicator indicator = new EndpointP90Indicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceId(((Number)dbMap.get("service_id")).intValue());
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
/*
* 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.endpoint;
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 = "endpoint_p95", builder = EndpointP95Indicator.Builder.class)
public class EndpointP95Indicator extends P95Indicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_id") private int serviceId;
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EndpointP95Indicator indicator = (EndpointP95Indicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTimeBucket());
remoteBuilder.setDataIntegers(0, getServiceId());
remoteBuilder.setDataIntegers(1, getServiceInstanceId());
remoteBuilder.setDataIntegers(2, getValue());
remoteBuilder.setDataIntegers(3, getPrecision());
getDetailGroup().forEach(element -> remoteBuilder.addDataIntLongPairList(element.serialize()));
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTimeBucket(remoteData.getDataLongs(0));
setServiceId(remoteData.getDataIntegers(0));
setServiceInstanceId(remoteData.getDataIntegers(1));
setValue(remoteData.getDataIntegers(2));
setPrecision(remoteData.getDataIntegers(3));
setDetailGroup(new IntKeyLongValueArray(30));
remoteData.getDataIntLongPairListList().forEach(element -> {
getDetailGroup().add(new IntKeyLongValue(element.getKey(), element.getValue()));
});
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("endpoint_p95", Scope.Endpoint, entityId);
}
@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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<EndpointP95Indicator> {
@Override public Map<String, Object> data2Map(EndpointP95Indicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_id", storageData.getServiceId());
map.put("service_instance_id", storageData.getServiceInstanceId());
map.put("value", storageData.getValue());
map.put("precision", storageData.getPrecision());
map.put("detail_group", storageData.getDetailGroup());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public EndpointP95Indicator map2Data(Map<String, Object> dbMap) {
EndpointP95Indicator indicator = new EndpointP95Indicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceId(((Number)dbMap.get("service_id")).intValue());
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
/*
* 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.endpoint;
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 = "endpoint_p99", builder = EndpointP99Indicator.Builder.class)
public class EndpointP99Indicator extends P99Indicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_id") private int serviceId;
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EndpointP99Indicator indicator = (EndpointP99Indicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTimeBucket());
remoteBuilder.setDataIntegers(0, getServiceId());
remoteBuilder.setDataIntegers(1, getServiceInstanceId());
remoteBuilder.setDataIntegers(2, getValue());
remoteBuilder.setDataIntegers(3, getPrecision());
getDetailGroup().forEach(element -> remoteBuilder.addDataIntLongPairList(element.serialize()));
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTimeBucket(remoteData.getDataLongs(0));
setServiceId(remoteData.getDataIntegers(0));
setServiceInstanceId(remoteData.getDataIntegers(1));
setValue(remoteData.getDataIntegers(2));
setPrecision(remoteData.getDataIntegers(3));
setDetailGroup(new IntKeyLongValueArray(30));
remoteData.getDataIntLongPairListList().forEach(element -> {
getDetailGroup().add(new IntKeyLongValue(element.getKey(), element.getValue()));
});
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("endpoint_p99", Scope.Endpoint, entityId);
}
@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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<EndpointP99Indicator> {
@Override public Map<String, Object> data2Map(EndpointP99Indicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_id", storageData.getServiceId());
map.put("service_instance_id", storageData.getServiceInstanceId());
map.put("value", storageData.getValue());
map.put("precision", storageData.getPrecision());
map.put("detail_group", storageData.getDetailGroup());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public EndpointP99Indicator map2Data(Map<String, Object> dbMap) {
EndpointP99Indicator indicator = new EndpointP99Indicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceId(((Number)dbMap.get("service_id")).intValue());
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
......@@ -38,8 +38,8 @@ import org.apache.skywalking.oap.server.core.source.Scope;
*/
@IndicatorType
@StreamData
@StorageEntity(name = "endpoint_percent", builder = EndpointPercentIndicator.Builder.class)
public class EndpointPercentIndicator extends PercentIndicator implements AlarmSupported {
@StorageEntity(name = "endpoint_sla", builder = EndpointSlaIndicator.Builder.class)
public class EndpointSlaIndicator extends PercentIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_id") private int serviceId;
......@@ -73,7 +73,7 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
if (getClass() != obj.getClass())
return false;
EndpointPercentIndicator indicator = (EndpointPercentIndicator)obj;
EndpointSlaIndicator indicator = (EndpointSlaIndicator)obj;
if (entityId != indicator.entityId)
return false;
......@@ -115,12 +115,12 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("endpoint_percent", Scope.Endpoint, entityId);
return new AlarmMeta("endpoint_sla", Scope.Endpoint, entityId);
}
@Override
public Indicator toHour() {
EndpointPercentIndicator indicator = new EndpointPercentIndicator();
EndpointSlaIndicator indicator = new EndpointSlaIndicator();
indicator.setTimeBucket(toTimeBucketInHour());
indicator.setEntityId(this.getEntityId());
indicator.setServiceId(this.getServiceId());
......@@ -134,7 +134,7 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
@Override
public Indicator toDay() {
EndpointPercentIndicator indicator = new EndpointPercentIndicator();
EndpointSlaIndicator indicator = new EndpointSlaIndicator();
indicator.setTimeBucket(toTimeBucketInDay());
indicator.setEntityId(this.getEntityId());
indicator.setServiceId(this.getServiceId());
......@@ -148,7 +148,7 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
@Override
public Indicator toMonth() {
EndpointPercentIndicator indicator = new EndpointPercentIndicator();
EndpointSlaIndicator indicator = new EndpointSlaIndicator();
indicator.setTimeBucket(toTimeBucketInMonth());
indicator.setEntityId(this.getEntityId());
indicator.setServiceId(this.getServiceId());
......@@ -160,9 +160,9 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
return indicator;
}
public static class Builder implements StorageBuilder<EndpointPercentIndicator> {
public static class Builder implements StorageBuilder<EndpointSlaIndicator> {
@Override public Map<String, Object> data2Map(EndpointPercentIndicator storageData) {
@Override public Map<String, Object> data2Map(EndpointSlaIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_id", storageData.getServiceId());
......@@ -174,8 +174,8 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
return map;
}
@Override public EndpointPercentIndicator map2Data(Map<String, Object> dbMap) {
EndpointPercentIndicator indicator = new EndpointPercentIndicator();
@Override public EndpointSlaIndicator map2Data(Map<String, Object> dbMap) {
EndpointSlaIndicator indicator = new EndpointSlaIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceId(((Number)dbMap.get("service_id")).intValue());
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
......
/*
* 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.endpointrelation;
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 = "endpoint_relation_cpm", builder = EndpointRelationCpmIndicator.Builder.class)
public class EndpointRelationCpmIndicator extends CPMIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_id") private int serviceId;
@Setter @Getter @Column(columnName = "child_service_id") private int childServiceId;
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
@Setter @Getter @Column(columnName = "child_service_instance_id") private int childServiceInstanceId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EndpointRelationCpmIndicator indicator = (EndpointRelationCpmIndicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getValue());
remoteBuilder.setDataLongs(1, getTotal());
remoteBuilder.setDataLongs(2, getTimeBucket());
remoteBuilder.setDataIntegers(0, getServiceId());
remoteBuilder.setDataIntegers(1, getChildServiceId());
remoteBuilder.setDataIntegers(2, getServiceInstanceId());
remoteBuilder.setDataIntegers(3, getChildServiceInstanceId());
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setValue(remoteData.getDataLongs(0));
setTotal(remoteData.getDataLongs(1));
setTimeBucket(remoteData.getDataLongs(2));
setServiceId(remoteData.getDataIntegers(0));
setChildServiceId(remoteData.getDataIntegers(1));
setServiceInstanceId(remoteData.getDataIntegers(2));
setChildServiceInstanceId(remoteData.getDataIntegers(3));
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("endpoint_relation_cpm", Scope.EndpointRelation, entityId);
}
@Override
public Indicator toHour() {
EndpointRelationCpmIndicator indicator = new EndpointRelationCpmIndicator();
indicator.setTimeBucket(toTimeBucketInHour());
indicator.setEntityId(this.getEntityId());
indicator.setServiceId(this.getServiceId());
indicator.setChildServiceId(this.getChildServiceId());
indicator.setServiceInstanceId(this.getServiceInstanceId());
indicator.setChildServiceInstanceId(this.getChildServiceInstanceId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setServiceInstanceId(this.getServiceInstanceId());
indicator.setChildServiceInstanceId(this.getChildServiceInstanceId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setServiceInstanceId(this.getServiceInstanceId());
indicator.setChildServiceInstanceId(this.getChildServiceInstanceId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<EndpointRelationCpmIndicator> {
@Override public Map<String, Object> data2Map(EndpointRelationCpmIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_id", storageData.getServiceId());
map.put("child_service_id", storageData.getChildServiceId());
map.put("service_instance_id", storageData.getServiceInstanceId());
map.put("child_service_instance_id", storageData.getChildServiceInstanceId());
map.put("value", storageData.getValue());
map.put("total", storageData.getTotal());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public EndpointRelationCpmIndicator map2Data(Map<String, Object> dbMap) {
EndpointRelationCpmIndicator indicator = new EndpointRelationCpmIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceId(((Number)dbMap.get("service_id")).intValue());
indicator.setChildServiceId(((Number)dbMap.get("child_service_id")).intValue());
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
indicator.setChildServiceInstanceId(((Number)dbMap.get("child_service_instance_id")).intValue());
indicator.setValue(((Number)dbMap.get("value")).longValue());
indicator.setTotal(((Number)dbMap.get("total")).longValue());
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
......@@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.core.analysis.generated.endpointrelatio
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.analysis.indicator.expression.*;
import org.apache.skywalking.oap.server.core.source.*;
/**
......@@ -30,12 +31,32 @@ import org.apache.skywalking.oap.server.core.source.*;
public class EndpointRelationDispatcher implements SourceDispatcher<EndpointRelation> {
@Override public void dispatch(EndpointRelation source) {
doEndpointRelationAvg(source);
doEndpointRelationCpm(source);
doEndpointRelationRespTime(source);
}
private void doEndpointRelationAvg(EndpointRelation source) {
EndpointRelationAvgIndicator indicator = new EndpointRelationAvgIndicator();
private void doEndpointRelationCpm(EndpointRelation source) {
EndpointRelationCpmIndicator indicator = new EndpointRelationCpmIndicator();
if (!new EqualMatch().setLeft(source.getDetectPoint()).setRight(DetectPoint.SERVER).match()) {
return;
}
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceId(source.getServiceId());
indicator.setChildServiceId(source.getChildServiceId());
indicator.setServiceInstanceId(source.getServiceInstanceId());
indicator.setChildServiceInstanceId(source.getChildServiceInstanceId());
indicator.combine(1);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doEndpointRelationRespTime(EndpointRelation source) {
EndpointRelationRespTimeIndicator indicator = new EndpointRelationRespTimeIndicator();
if (!new EqualMatch().setLeft(source.getDetectPoint()).setRight(DetectPoint.SERVER).match()) {
return;
}
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
......
......@@ -38,8 +38,8 @@ import org.apache.skywalking.oap.server.core.source.Scope;
*/
@IndicatorType
@StreamData
@StorageEntity(name = "endpointrelation_avg", builder = EndpointRelationAvgIndicator.Builder.class)
public class EndpointRelationAvgIndicator extends LongAvgIndicator implements AlarmSupported {
@StorageEntity(name = "endpoint_relation_resp_time", builder = EndpointRelationRespTimeIndicator.Builder.class)
public class EndpointRelationRespTimeIndicator extends LongAvgIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_id") private int serviceId;
......@@ -75,7 +75,7 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
if (getClass() != obj.getClass())
return false;
EndpointRelationAvgIndicator indicator = (EndpointRelationAvgIndicator)obj;
EndpointRelationRespTimeIndicator indicator = (EndpointRelationRespTimeIndicator)obj;
if (entityId != indicator.entityId)
return false;
......@@ -121,12 +121,12 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("EndpointRelation_Avg", Scope.EndpointRelation, entityId);
return new AlarmMeta("endpoint_relation_resp_time", Scope.EndpointRelation, entityId);
}
@Override
public Indicator toHour() {
EndpointRelationAvgIndicator indicator = new EndpointRelationAvgIndicator();
EndpointRelationRespTimeIndicator indicator = new EndpointRelationRespTimeIndicator();
indicator.setTimeBucket(toTimeBucketInHour());
indicator.setEntityId(this.getEntityId());
indicator.setServiceId(this.getServiceId());
......@@ -142,7 +142,7 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
@Override
public Indicator toDay() {
EndpointRelationAvgIndicator indicator = new EndpointRelationAvgIndicator();
EndpointRelationRespTimeIndicator indicator = new EndpointRelationRespTimeIndicator();
indicator.setTimeBucket(toTimeBucketInDay());
indicator.setEntityId(this.getEntityId());
indicator.setServiceId(this.getServiceId());
......@@ -158,7 +158,7 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
@Override
public Indicator toMonth() {
EndpointRelationAvgIndicator indicator = new EndpointRelationAvgIndicator();
EndpointRelationRespTimeIndicator indicator = new EndpointRelationRespTimeIndicator();
indicator.setTimeBucket(toTimeBucketInMonth());
indicator.setEntityId(this.getEntityId());
indicator.setServiceId(this.getServiceId());
......@@ -172,9 +172,9 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
return indicator;
}
public static class Builder implements StorageBuilder<EndpointRelationAvgIndicator> {
public static class Builder implements StorageBuilder<EndpointRelationRespTimeIndicator> {
@Override public Map<String, Object> data2Map(EndpointRelationAvgIndicator storageData) {
@Override public Map<String, Object> data2Map(EndpointRelationRespTimeIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_id", storageData.getServiceId());
......@@ -188,8 +188,8 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
return map;
}
@Override public EndpointRelationAvgIndicator map2Data(Map<String, Object> dbMap) {
EndpointRelationAvgIndicator indicator = new EndpointRelationAvgIndicator();
@Override public EndpointRelationRespTimeIndicator map2Data(Map<String, Object> dbMap) {
EndpointRelationRespTimeIndicator indicator = new EndpointRelationRespTimeIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceId(((Number)dbMap.get("service_id")).intValue());
indicator.setChildServiceId(((Number)dbMap.get("child_service_id")).intValue());
......
......@@ -38,8 +38,8 @@ import org.apache.skywalking.oap.server.core.source.Scope;
*/
@IndicatorType
@StreamData
@StorageEntity(name = "service_calls_sum", builder = ServiceCallsSumIndicator.Builder.class)
public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSupported {
@StorageEntity(name = "service_cpm", builder = ServiceCpmIndicator.Builder.class)
public class ServiceCpmIndicator extends CPMIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
......@@ -71,7 +71,7 @@ public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSuppo
if (getClass() != obj.getClass())
return false;
ServiceCallsSumIndicator indicator = (ServiceCallsSumIndicator)obj;
ServiceCpmIndicator indicator = (ServiceCpmIndicator)obj;
if (entityId != indicator.entityId)
return false;
......@@ -86,7 +86,8 @@ public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSuppo
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getValue());
remoteBuilder.setDataLongs(1, getTimeBucket());
remoteBuilder.setDataLongs(1, getTotal());
remoteBuilder.setDataLongs(2, getTimeBucket());
......@@ -97,7 +98,8 @@ public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSuppo
setEntityId(remoteData.getDataStrings(0));
setValue(remoteData.getDataLongs(0));
setTimeBucket(remoteData.getDataLongs(1));
setTotal(remoteData.getDataLongs(1));
setTimeBucket(remoteData.getDataLongs(2));
......@@ -105,53 +107,58 @@ public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSuppo
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("Service_Calls_Sum", Scope.Service, entityId);
return new AlarmMeta("service_cpm", Scope.Service, entityId);
}
@Override
public Indicator toHour() {
ServiceCallsSumIndicator indicator = new ServiceCallsSumIndicator();
ServiceCpmIndicator indicator = new ServiceCpmIndicator();
indicator.setTimeBucket(toTimeBucketInHour());
indicator.setEntityId(this.getEntityId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
@Override
public Indicator toDay() {
ServiceCallsSumIndicator indicator = new ServiceCallsSumIndicator();
ServiceCpmIndicator indicator = new ServiceCpmIndicator();
indicator.setTimeBucket(toTimeBucketInDay());
indicator.setEntityId(this.getEntityId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
@Override
public Indicator toMonth() {
ServiceCallsSumIndicator indicator = new ServiceCallsSumIndicator();
ServiceCpmIndicator indicator = new ServiceCpmIndicator();
indicator.setTimeBucket(toTimeBucketInMonth());
indicator.setEntityId(this.getEntityId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceCallsSumIndicator> {
public static class Builder implements StorageBuilder<ServiceCpmIndicator> {
@Override public Map<String, Object> data2Map(ServiceCallsSumIndicator storageData) {
@Override public Map<String, Object> data2Map(ServiceCpmIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("value", storageData.getValue());
map.put("total", storageData.getTotal());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceCallsSumIndicator map2Data(Map<String, Object> dbMap) {
ServiceCallsSumIndicator indicator = new ServiceCallsSumIndicator();
@Override public ServiceCpmIndicator map2Data(Map<String, Object> dbMap) {
ServiceCpmIndicator indicator = new ServiceCpmIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setValue(((Number)dbMap.get("value")).longValue());
indicator.setTotal(((Number)dbMap.get("total")).longValue());
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
......
......@@ -30,12 +30,18 @@ import org.apache.skywalking.oap.server.core.source.*;
public class ServiceDispatcher implements SourceDispatcher<Service> {
@Override public void dispatch(Service source) {
doServiceAvg(source);
doServiceCallsSum(source);
doServiceRespTime(source);
doServiceSla(source);
doServiceCpm(source);
doServiceP99(source);
doServiceP95(source);
doServiceP90(source);
doServiceP75(source);
doServiceP50(source);
}
private void doServiceAvg(Service source) {
ServiceAvgIndicator indicator = new ServiceAvgIndicator();
private void doServiceRespTime(Service source) {
ServiceRespTimeIndicator indicator = new ServiceRespTimeIndicator();
indicator.setTimeBucket(source.getTimeBucket());
......@@ -43,8 +49,17 @@ public class ServiceDispatcher implements SourceDispatcher<Service> {
indicator.combine(source.getLatency(), 1);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceCallsSum(Service source) {
ServiceCallsSumIndicator indicator = new ServiceCallsSumIndicator();
private void doServiceSla(Service source) {
ServiceSlaIndicator indicator = new ServiceSlaIndicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.combine(new org.apache.skywalking.oap.server.core.analysis.indicator.expression.EqualMatch(), source.isStatus(), true);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceCpm(Service source) {
ServiceCpmIndicator indicator = new ServiceCpmIndicator();
indicator.setTimeBucket(source.getTimeBucket());
......@@ -52,4 +67,49 @@ public class ServiceDispatcher implements SourceDispatcher<Service> {
indicator.combine(1);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceP99(Service source) {
ServiceP99Indicator indicator = new ServiceP99Indicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.combine(source.getLatency(), 10);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceP95(Service source) {
ServiceP95Indicator indicator = new ServiceP95Indicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.combine(source.getLatency(), 10);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceP90(Service source) {
ServiceP90Indicator indicator = new ServiceP90Indicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.combine(source.getLatency(), 10);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceP75(Service source) {
ServiceP75Indicator indicator = new ServiceP75Indicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.combine(source.getLatency(), 10);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceP50(Service source) {
ServiceP50Indicator indicator = new ServiceP50Indicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.combine(source.getLatency(), 10);
IndicatorProcess.INSTANCE.in(indicator);
}
}
/*
* 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_p50", builder = ServiceP50Indicator.Builder.class)
public class ServiceP50Indicator extends P50Indicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceP50Indicator indicator = (ServiceP50Indicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTimeBucket());
remoteBuilder.setDataIntegers(0, getValue());
remoteBuilder.setDataIntegers(1, getPrecision());
getDetailGroup().forEach(element -> remoteBuilder.addDataIntLongPairList(element.serialize()));
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTimeBucket(remoteData.getDataLongs(0));
setValue(remoteData.getDataIntegers(0));
setPrecision(remoteData.getDataIntegers(1));
setDetailGroup(new IntKeyLongValueArray(30));
remoteData.getDataIntLongPairListList().forEach(element -> {
getDetailGroup().add(new IntKeyLongValue(element.getKey(), element.getValue()));
});
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("service_p50", Scope.Service, entityId);
}
@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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceP50Indicator> {
@Override public Map<String, Object> data2Map(ServiceP50Indicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("value", storageData.getValue());
map.put("precision", storageData.getPrecision());
map.put("detail_group", storageData.getDetailGroup());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceP50Indicator map2Data(Map<String, Object> dbMap) {
ServiceP50Indicator indicator = new ServiceP50Indicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
/*
* 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_p75", builder = ServiceP75Indicator.Builder.class)
public class ServiceP75Indicator extends P75Indicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceP75Indicator indicator = (ServiceP75Indicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTimeBucket());
remoteBuilder.setDataIntegers(0, getValue());
remoteBuilder.setDataIntegers(1, getPrecision());
getDetailGroup().forEach(element -> remoteBuilder.addDataIntLongPairList(element.serialize()));
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTimeBucket(remoteData.getDataLongs(0));
setValue(remoteData.getDataIntegers(0));
setPrecision(remoteData.getDataIntegers(1));
setDetailGroup(new IntKeyLongValueArray(30));
remoteData.getDataIntLongPairListList().forEach(element -> {
getDetailGroup().add(new IntKeyLongValue(element.getKey(), element.getValue()));
});
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("service_p75", Scope.Service, entityId);
}
@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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceP75Indicator> {
@Override public Map<String, Object> data2Map(ServiceP75Indicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("value", storageData.getValue());
map.put("precision", storageData.getPrecision());
map.put("detail_group", storageData.getDetailGroup());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceP75Indicator map2Data(Map<String, Object> dbMap) {
ServiceP75Indicator indicator = new ServiceP75Indicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
/*
* 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_p90", builder = ServiceP90Indicator.Builder.class)
public class ServiceP90Indicator extends P90Indicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceP90Indicator indicator = (ServiceP90Indicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTimeBucket());
remoteBuilder.setDataIntegers(0, getValue());
remoteBuilder.setDataIntegers(1, getPrecision());
getDetailGroup().forEach(element -> remoteBuilder.addDataIntLongPairList(element.serialize()));
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTimeBucket(remoteData.getDataLongs(0));
setValue(remoteData.getDataIntegers(0));
setPrecision(remoteData.getDataIntegers(1));
setDetailGroup(new IntKeyLongValueArray(30));
remoteData.getDataIntLongPairListList().forEach(element -> {
getDetailGroup().add(new IntKeyLongValue(element.getKey(), element.getValue()));
});
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("service_p90", Scope.Service, entityId);
}
@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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceP90Indicator> {
@Override public Map<String, Object> data2Map(ServiceP90Indicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("value", storageData.getValue());
map.put("precision", storageData.getPrecision());
map.put("detail_group", storageData.getDetailGroup());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceP90Indicator map2Data(Map<String, Object> dbMap) {
ServiceP90Indicator indicator = new ServiceP90Indicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
/*
* 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_p95", builder = ServiceP95Indicator.Builder.class)
public class ServiceP95Indicator extends P95Indicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceP95Indicator indicator = (ServiceP95Indicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTimeBucket());
remoteBuilder.setDataIntegers(0, getValue());
remoteBuilder.setDataIntegers(1, getPrecision());
getDetailGroup().forEach(element -> remoteBuilder.addDataIntLongPairList(element.serialize()));
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTimeBucket(remoteData.getDataLongs(0));
setValue(remoteData.getDataIntegers(0));
setPrecision(remoteData.getDataIntegers(1));
setDetailGroup(new IntKeyLongValueArray(30));
remoteData.getDataIntLongPairListList().forEach(element -> {
getDetailGroup().add(new IntKeyLongValue(element.getKey(), element.getValue()));
});
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("service_p95", Scope.Service, entityId);
}
@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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceP95Indicator> {
@Override public Map<String, Object> data2Map(ServiceP95Indicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("value", storageData.getValue());
map.put("precision", storageData.getPrecision());
map.put("detail_group", storageData.getDetailGroup());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceP95Indicator map2Data(Map<String, Object> dbMap) {
ServiceP95Indicator indicator = new ServiceP95Indicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
/*
* 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_p99", builder = ServiceP99Indicator.Builder.class)
public class ServiceP99Indicator extends P99Indicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceP99Indicator indicator = (ServiceP99Indicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTimeBucket());
remoteBuilder.setDataIntegers(0, getValue());
remoteBuilder.setDataIntegers(1, getPrecision());
getDetailGroup().forEach(element -> remoteBuilder.addDataIntLongPairList(element.serialize()));
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTimeBucket(remoteData.getDataLongs(0));
setValue(remoteData.getDataIntegers(0));
setPrecision(remoteData.getDataIntegers(1));
setDetailGroup(new IntKeyLongValueArray(30));
remoteData.getDataIntLongPairListList().forEach(element -> {
getDetailGroup().add(new IntKeyLongValue(element.getKey(), element.getValue()));
});
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("service_p99", Scope.Service, entityId);
}
@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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
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());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceP99Indicator> {
@Override public Map<String, Object> data2Map(ServiceP99Indicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("value", storageData.getValue());
map.put("precision", storageData.getPrecision());
map.put("detail_group", storageData.getDetailGroup());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceP99Indicator map2Data(Map<String, Object> dbMap) {
ServiceP99Indicator indicator = new ServiceP99Indicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setValue(((Number)dbMap.get("value")).intValue());
indicator.setPrecision(((Number)dbMap.get("precision")).intValue());
indicator.setDetailGroup((org.apache.skywalking.oap.server.core.analysis.indicator.IntKeyLongValueArray)dbMap.get("detail_group"));
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
......@@ -38,8 +38,8 @@ import org.apache.skywalking.oap.server.core.source.Scope;
*/
@IndicatorType
@StreamData
@StorageEntity(name = "service_avg", builder = ServiceAvgIndicator.Builder.class)
public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSupported {
@StorageEntity(name = "service_resp_time", builder = ServiceRespTimeIndicator.Builder.class)
public class ServiceRespTimeIndicator extends LongAvgIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
......@@ -71,7 +71,7 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
if (getClass() != obj.getClass())
return false;
ServiceAvgIndicator indicator = (ServiceAvgIndicator)obj;
ServiceRespTimeIndicator indicator = (ServiceRespTimeIndicator)obj;
if (entityId != indicator.entityId)
return false;
......@@ -109,12 +109,12 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("Service_Avg", Scope.Service, entityId);
return new AlarmMeta("service_resp_time", Scope.Service, entityId);
}
@Override
public Indicator toHour() {
ServiceAvgIndicator indicator = new ServiceAvgIndicator();
ServiceRespTimeIndicator indicator = new ServiceRespTimeIndicator();
indicator.setTimeBucket(toTimeBucketInHour());
indicator.setEntityId(this.getEntityId());
indicator.setSummation(this.getSummation());
......@@ -126,7 +126,7 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
@Override
public Indicator toDay() {
ServiceAvgIndicator indicator = new ServiceAvgIndicator();
ServiceRespTimeIndicator indicator = new ServiceRespTimeIndicator();
indicator.setTimeBucket(toTimeBucketInDay());
indicator.setEntityId(this.getEntityId());
indicator.setSummation(this.getSummation());
......@@ -138,7 +138,7 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
@Override
public Indicator toMonth() {
ServiceAvgIndicator indicator = new ServiceAvgIndicator();
ServiceRespTimeIndicator indicator = new ServiceRespTimeIndicator();
indicator.setTimeBucket(toTimeBucketInMonth());
indicator.setEntityId(this.getEntityId());
indicator.setSummation(this.getSummation());
......@@ -148,9 +148,9 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
return indicator;
}
public static class Builder implements StorageBuilder<ServiceAvgIndicator> {
public static class Builder implements StorageBuilder<ServiceRespTimeIndicator> {
@Override public Map<String, Object> data2Map(ServiceAvgIndicator storageData) {
@Override public Map<String, Object> data2Map(ServiceRespTimeIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("summation", storageData.getSummation());
......@@ -160,8 +160,8 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
return map;
}
@Override public ServiceAvgIndicator map2Data(Map<String, Object> dbMap) {
ServiceAvgIndicator indicator = new ServiceAvgIndicator();
@Override public ServiceRespTimeIndicator map2Data(Map<String, Object> dbMap) {
ServiceRespTimeIndicator indicator = new ServiceRespTimeIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setSummation(((Number)dbMap.get("summation")).longValue());
indicator.setCount(((Number)dbMap.get("count")).intValue());
......
/*
* 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_sla", builder = ServiceSlaIndicator.Builder.class)
public class ServiceSlaIndicator extends PercentIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceSlaIndicator indicator = (ServiceSlaIndicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTotal());
remoteBuilder.setDataLongs(1, getMatch());
remoteBuilder.setDataLongs(2, getTimeBucket());
remoteBuilder.setDataIntegers(0, getPercentage());
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTotal(remoteData.getDataLongs(0));
setMatch(remoteData.getDataLongs(1));
setTimeBucket(remoteData.getDataLongs(2));
setPercentage(remoteData.getDataIntegers(0));
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("service_sla", Scope.Service, entityId);
}
@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(this.getTimeBucket());
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(this.getTimeBucket());
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(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceSlaIndicator> {
@Override public Map<String, Object> data2Map(ServiceSlaIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("total", storageData.getTotal());
map.put("percentage", storageData.getPercentage());
map.put("match", storageData.getMatch());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceSlaIndicator map2Data(Map<String, Object> dbMap) {
ServiceSlaIndicator indicator = new ServiceSlaIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setTotal(((Number)dbMap.get("total")).longValue());
indicator.setPercentage(((Number)dbMap.get("percentage")).intValue());
indicator.setMatch(((Number)dbMap.get("match")).longValue());
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
/*
* 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.serviceinstance;
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_instance_cpm", builder = ServiceInstanceCpmIndicator.Builder.class)
public class ServiceInstanceCpmIndicator extends CPMIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_id") private int serviceId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceInstanceCpmIndicator indicator = (ServiceInstanceCpmIndicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getValue());
remoteBuilder.setDataLongs(1, getTotal());
remoteBuilder.setDataLongs(2, getTimeBucket());
remoteBuilder.setDataIntegers(0, getServiceId());
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setValue(remoteData.getDataLongs(0));
setTotal(remoteData.getDataLongs(1));
setTimeBucket(remoteData.getDataLongs(2));
setServiceId(remoteData.getDataIntegers(0));
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("service_instance_cpm", Scope.ServiceInstance, entityId);
}
@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(this.getTimeBucket());
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(this.getTimeBucket());
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(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceInstanceCpmIndicator> {
@Override public Map<String, Object> data2Map(ServiceInstanceCpmIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_id", storageData.getServiceId());
map.put("value", storageData.getValue());
map.put("total", storageData.getTotal());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceInstanceCpmIndicator map2Data(Map<String, Object> dbMap) {
ServiceInstanceCpmIndicator indicator = new ServiceInstanceCpmIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceId(((Number)dbMap.get("service_id")).intValue());
indicator.setValue(((Number)dbMap.get("value")).longValue());
indicator.setTotal(((Number)dbMap.get("total")).longValue());
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
......@@ -31,6 +31,7 @@ public class ServiceInstanceDispatcher implements SourceDispatcher<ServiceInstan
@Override public void dispatch(ServiceInstance source) {
doServiceInstanceRespTime(source);
doServiceInstanceCpm(source);
}
private void doServiceInstanceRespTime(ServiceInstance source) {
......@@ -43,4 +44,14 @@ public class ServiceInstanceDispatcher implements SourceDispatcher<ServiceInstan
indicator.combine(source.getLatency(), 1);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceInstanceCpm(ServiceInstance source) {
ServiceInstanceCpmIndicator indicator = new ServiceInstanceCpmIndicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceId(source.getServiceId());
indicator.combine(1);
IndicatorProcess.INSTANCE.in(indicator);
}
}
......@@ -38,7 +38,7 @@ import org.apache.skywalking.oap.server.core.source.Scope;
*/
@IndicatorType
@StreamData
@StorageEntity(name = "serviceinstance_resptime", builder = ServiceInstanceRespTimeIndicator.Builder.class)
@StorageEntity(name = "serviceinstance_resp_time", builder = ServiceInstanceRespTimeIndicator.Builder.class)
public class ServiceInstanceRespTimeIndicator extends LongAvgIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
......@@ -112,7 +112,7 @@ public class ServiceInstanceRespTimeIndicator extends LongAvgIndicator implement
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("ServiceInstance_RespTime", Scope.ServiceInstance, entityId);
return new AlarmMeta("serviceInstance_resp_time", Scope.ServiceInstance, entityId);
}
@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.analysis.generated.serviceinstancejvmgc;
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 = "instance_jvm_old_gc_count", builder = InstanceJvmOldGcCountIndicator.Builder.class)
public class InstanceJvmOldGcCountIndicator extends SumIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
InstanceJvmOldGcCountIndicator indicator = (InstanceJvmOldGcCountIndicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getValue());
remoteBuilder.setDataLongs(1, getTimeBucket());
remoteBuilder.setDataIntegers(0, getServiceInstanceId());
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setValue(remoteData.getDataLongs(0));
setTimeBucket(remoteData.getDataLongs(1));
setServiceInstanceId(remoteData.getDataIntegers(0));
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("instance_jvm_old_gc_count", Scope.ServiceInstanceJVMGC, entityId);
}
@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(this.getTimeBucket());
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(this.getTimeBucket());
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(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<InstanceJvmOldGcCountIndicator> {
@Override public Map<String, Object> data2Map(InstanceJvmOldGcCountIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_instance_id", storageData.getServiceInstanceId());
map.put("value", storageData.getValue());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public InstanceJvmOldGcCountIndicator map2Data(Map<String, Object> dbMap) {
InstanceJvmOldGcCountIndicator indicator = new InstanceJvmOldGcCountIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
indicator.setValue(((Number)dbMap.get("value")).longValue());
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
......@@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstancejvmmemory;
package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstancejvmgc;
import java.util.*;
import lombok.*;
......@@ -38,8 +38,8 @@ import org.apache.skywalking.oap.server.core.source.Scope;
*/
@IndicatorType
@StreamData
@StorageEntity(name = "instance_jvm_memory_max", builder = InstanceJvmMemoryMaxIndicator.Builder.class)
public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements AlarmSupported {
@StorageEntity(name = "instance_jvm_old_gc_time", builder = InstanceJvmOldGcTimeIndicator.Builder.class)
public class InstanceJvmOldGcTimeIndicator extends LongAvgIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
......@@ -72,7 +72,7 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
if (getClass() != obj.getClass())
return false;
InstanceJvmMemoryMaxIndicator indicator = (InstanceJvmMemoryMaxIndicator)obj;
InstanceJvmOldGcTimeIndicator indicator = (InstanceJvmOldGcTimeIndicator)obj;
if (entityId != indicator.entityId)
return false;
......@@ -112,12 +112,12 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("instance_jvm_memory_max", Scope.ServiceInstanceJVMMemory, entityId);
return new AlarmMeta("instance_jvm_old_gc_time", Scope.ServiceInstanceJVMGC, entityId);
}
@Override
public Indicator toHour() {
InstanceJvmMemoryMaxIndicator indicator = new InstanceJvmMemoryMaxIndicator();
InstanceJvmOldGcTimeIndicator indicator = new InstanceJvmOldGcTimeIndicator();
indicator.setTimeBucket(toTimeBucketInHour());
indicator.setEntityId(this.getEntityId());
indicator.setServiceInstanceId(this.getServiceInstanceId());
......@@ -130,7 +130,7 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
@Override
public Indicator toDay() {
InstanceJvmMemoryMaxIndicator indicator = new InstanceJvmMemoryMaxIndicator();
InstanceJvmOldGcTimeIndicator indicator = new InstanceJvmOldGcTimeIndicator();
indicator.setTimeBucket(toTimeBucketInDay());
indicator.setEntityId(this.getEntityId());
indicator.setServiceInstanceId(this.getServiceInstanceId());
......@@ -143,7 +143,7 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
@Override
public Indicator toMonth() {
InstanceJvmMemoryMaxIndicator indicator = new InstanceJvmMemoryMaxIndicator();
InstanceJvmOldGcTimeIndicator indicator = new InstanceJvmOldGcTimeIndicator();
indicator.setTimeBucket(toTimeBucketInMonth());
indicator.setEntityId(this.getEntityId());
indicator.setServiceInstanceId(this.getServiceInstanceId());
......@@ -154,9 +154,9 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
return indicator;
}
public static class Builder implements StorageBuilder<InstanceJvmMemoryMaxIndicator> {
public static class Builder implements StorageBuilder<InstanceJvmOldGcTimeIndicator> {
@Override public Map<String, Object> data2Map(InstanceJvmMemoryMaxIndicator storageData) {
@Override public Map<String, Object> data2Map(InstanceJvmOldGcTimeIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_instance_id", storageData.getServiceInstanceId());
......@@ -167,8 +167,8 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
return map;
}
@Override public InstanceJvmMemoryMaxIndicator map2Data(Map<String, Object> dbMap) {
InstanceJvmMemoryMaxIndicator indicator = new InstanceJvmMemoryMaxIndicator();
@Override public InstanceJvmOldGcTimeIndicator map2Data(Map<String, Object> dbMap) {
InstanceJvmOldGcTimeIndicator indicator = new InstanceJvmOldGcTimeIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
indicator.setSummation(((Number)dbMap.get("summation")).longValue());
......
/*
* 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.serviceinstancejvmgc;
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 = "instance_jvm_young_gc_count", builder = InstanceJvmYoungGcCountIndicator.Builder.class)
public class InstanceJvmYoungGcCountIndicator extends SumIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
InstanceJvmYoungGcCountIndicator indicator = (InstanceJvmYoungGcCountIndicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getValue());
remoteBuilder.setDataLongs(1, getTimeBucket());
remoteBuilder.setDataIntegers(0, getServiceInstanceId());
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setValue(remoteData.getDataLongs(0));
setTimeBucket(remoteData.getDataLongs(1));
setServiceInstanceId(remoteData.getDataIntegers(0));
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("instance_jvm_young_gc_count", Scope.ServiceInstanceJVMGC, entityId);
}
@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(this.getTimeBucket());
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(this.getTimeBucket());
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(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<InstanceJvmYoungGcCountIndicator> {
@Override public Map<String, Object> data2Map(InstanceJvmYoungGcCountIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_instance_id", storageData.getServiceInstanceId());
map.put("value", storageData.getValue());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public InstanceJvmYoungGcCountIndicator map2Data(Map<String, Object> dbMap) {
InstanceJvmYoungGcCountIndicator indicator = new InstanceJvmYoungGcCountIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
indicator.setValue(((Number)dbMap.get("value")).longValue());
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
......@@ -32,6 +32,9 @@ public class ServiceInstanceJVMGCDispatcher implements SourceDispatcher<ServiceI
@Override public void dispatch(ServiceInstanceJVMGC source) {
doInstanceJvmYoungGcTime(source);
doInstanceJvmOldGcTime(source);
doInstanceJvmYoungGcCount(source);
doInstanceJvmOldGcCount(source);
}
private void doInstanceJvmYoungGcTime(ServiceInstanceJVMGC source) {
......@@ -47,4 +50,43 @@ public class ServiceInstanceJVMGCDispatcher implements SourceDispatcher<ServiceI
indicator.combine(source.getTime(), 1);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doInstanceJvmOldGcTime(ServiceInstanceJVMGC source) {
InstanceJvmOldGcTimeIndicator indicator = new InstanceJvmOldGcTimeIndicator();
if (!new EqualMatch().setLeft(source.getPhrase()).setRight(GCPhrase.OLD).match()) {
return;
}
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceInstanceId(source.getServiceInstanceId());
indicator.combine(source.getTime(), 1);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doInstanceJvmYoungGcCount(ServiceInstanceJVMGC source) {
InstanceJvmYoungGcCountIndicator indicator = new InstanceJvmYoungGcCountIndicator();
if (!new EqualMatch().setLeft(source.getPhrase()).setRight(GCPhrase.NEW).match()) {
return;
}
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceInstanceId(source.getServiceInstanceId());
indicator.combine(source.getCount());
IndicatorProcess.INSTANCE.in(indicator);
}
private void doInstanceJvmOldGcCount(ServiceInstanceJVMGC source) {
InstanceJvmOldGcCountIndicator indicator = new InstanceJvmOldGcCountIndicator();
if (!new EqualMatch().setLeft(source.getPhrase()).setRight(GCPhrase.OLD).match()) {
return;
}
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceInstanceId(source.getServiceInstanceId());
indicator.combine(source.getCount());
IndicatorProcess.INSTANCE.in(indicator);
}
}
......@@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstancejvmmemorypool;
package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstancejvmmemory;
import java.util.*;
import lombok.*;
......@@ -38,8 +38,8 @@ import org.apache.skywalking.oap.server.core.source.Scope;
*/
@IndicatorType
@StreamData
@StorageEntity(name = "instance_jvm_memory_pool_max", builder = InstanceJvmMemoryPoolMaxIndicator.Builder.class)
public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implements AlarmSupported {
@StorageEntity(name = "instance_jvm_memory_heap", builder = InstanceJvmMemoryHeapIndicator.Builder.class)
public class InstanceJvmMemoryHeapIndicator extends LongAvgIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
......@@ -72,7 +72,7 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
if (getClass() != obj.getClass())
return false;
InstanceJvmMemoryPoolMaxIndicator indicator = (InstanceJvmMemoryPoolMaxIndicator)obj;
InstanceJvmMemoryHeapIndicator indicator = (InstanceJvmMemoryHeapIndicator)obj;
if (entityId != indicator.entityId)
return false;
......@@ -112,12 +112,12 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("instance_jvm_memory_pool_max", Scope.ServiceInstanceJVMMemoryPool, entityId);
return new AlarmMeta("instance_jvm_memory_heap", Scope.ServiceInstanceJVMMemory, entityId);
}
@Override
public Indicator toHour() {
InstanceJvmMemoryPoolMaxIndicator indicator = new InstanceJvmMemoryPoolMaxIndicator();
InstanceJvmMemoryHeapIndicator indicator = new InstanceJvmMemoryHeapIndicator();
indicator.setTimeBucket(toTimeBucketInHour());
indicator.setEntityId(this.getEntityId());
indicator.setServiceInstanceId(this.getServiceInstanceId());
......@@ -130,7 +130,7 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
@Override
public Indicator toDay() {
InstanceJvmMemoryPoolMaxIndicator indicator = new InstanceJvmMemoryPoolMaxIndicator();
InstanceJvmMemoryHeapIndicator indicator = new InstanceJvmMemoryHeapIndicator();
indicator.setTimeBucket(toTimeBucketInDay());
indicator.setEntityId(this.getEntityId());
indicator.setServiceInstanceId(this.getServiceInstanceId());
......@@ -143,7 +143,7 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
@Override
public Indicator toMonth() {
InstanceJvmMemoryPoolMaxIndicator indicator = new InstanceJvmMemoryPoolMaxIndicator();
InstanceJvmMemoryHeapIndicator indicator = new InstanceJvmMemoryHeapIndicator();
indicator.setTimeBucket(toTimeBucketInMonth());
indicator.setEntityId(this.getEntityId());
indicator.setServiceInstanceId(this.getServiceInstanceId());
......@@ -154,9 +154,9 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
return indicator;
}
public static class Builder implements StorageBuilder<InstanceJvmMemoryPoolMaxIndicator> {
public static class Builder implements StorageBuilder<InstanceJvmMemoryHeapIndicator> {
@Override public Map<String, Object> data2Map(InstanceJvmMemoryPoolMaxIndicator storageData) {
@Override public Map<String, Object> data2Map(InstanceJvmMemoryHeapIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_instance_id", storageData.getServiceInstanceId());
......@@ -167,8 +167,8 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
return map;
}
@Override public InstanceJvmMemoryPoolMaxIndicator map2Data(Map<String, Object> dbMap) {
InstanceJvmMemoryPoolMaxIndicator indicator = new InstanceJvmMemoryPoolMaxIndicator();
@Override public InstanceJvmMemoryHeapIndicator map2Data(Map<String, Object> dbMap) {
InstanceJvmMemoryHeapIndicator indicator = new InstanceJvmMemoryHeapIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
indicator.setSummation(((Number)dbMap.get("summation")).longValue());
......
/*
* 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.serviceinstancejvmmemory;
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 = "instance_jvm_memory_noheap", builder = InstanceJvmMemoryNoheapIndicator.Builder.class)
public class InstanceJvmMemoryNoheapIndicator extends LongAvgIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "service_instance_id") private int serviceInstanceId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
InstanceJvmMemoryNoheapIndicator indicator = (InstanceJvmMemoryNoheapIndicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getSummation());
remoteBuilder.setDataLongs(1, getValue());
remoteBuilder.setDataLongs(2, getTimeBucket());
remoteBuilder.setDataIntegers(0, getServiceInstanceId());
remoteBuilder.setDataIntegers(1, getCount());
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setSummation(remoteData.getDataLongs(0));
setValue(remoteData.getDataLongs(1));
setTimeBucket(remoteData.getDataLongs(2));
setServiceInstanceId(remoteData.getDataIntegers(0));
setCount(remoteData.getDataIntegers(1));
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("instance_jvm_memory_noheap", Scope.ServiceInstanceJVMMemory, entityId);
}
@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(this.getTimeBucket());
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(this.getTimeBucket());
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(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<InstanceJvmMemoryNoheapIndicator> {
@Override public Map<String, Object> data2Map(InstanceJvmMemoryNoheapIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("service_instance_id", storageData.getServiceInstanceId());
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 InstanceJvmMemoryNoheapIndicator map2Data(Map<String, Object> dbMap) {
InstanceJvmMemoryNoheapIndicator indicator = new InstanceJvmMemoryNoheapIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_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;
}
}
}
......@@ -20,6 +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.analysis.indicator.expression.*;
import org.apache.skywalking.oap.server.core.source.*;
/**
......@@ -30,12 +31,29 @@ import org.apache.skywalking.oap.server.core.source.*;
public class ServiceInstanceJVMMemoryDispatcher implements SourceDispatcher<ServiceInstanceJVMMemory> {
@Override public void dispatch(ServiceInstanceJVMMemory source) {
doInstanceJvmMemoryMax(source);
doInstanceJvmMemoryHeap(source);
doInstanceJvmMemoryNoheap(source);
}
private void doInstanceJvmMemoryMax(ServiceInstanceJVMMemory source) {
InstanceJvmMemoryMaxIndicator indicator = new InstanceJvmMemoryMaxIndicator();
private void doInstanceJvmMemoryHeap(ServiceInstanceJVMMemory source) {
InstanceJvmMemoryHeapIndicator indicator = new InstanceJvmMemoryHeapIndicator();
if (!new EqualMatch().setLeft(source.isHeapStatus()).setRight(true).match()) {
return;
}
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceInstanceId(source.getServiceInstanceId());
indicator.combine(source.getMax(), 1);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doInstanceJvmMemoryNoheap(ServiceInstanceJVMMemory source) {
InstanceJvmMemoryNoheapIndicator indicator = new InstanceJvmMemoryNoheapIndicator();
if (!new EqualMatch().setLeft(source.isHeapStatus()).setRight(false).match()) {
return;
}
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
......
......@@ -19,7 +19,6 @@
package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstancejvmmemorypool;
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.*;
/**
......@@ -30,17 +29,6 @@ import org.apache.skywalking.oap.server.core.source.*;
public class ServiceInstanceJVMMemoryPoolDispatcher implements SourceDispatcher<ServiceInstanceJVMMemoryPool> {
@Override public void dispatch(ServiceInstanceJVMMemoryPool source) {
doInstanceJvmMemoryPoolMax(source);
}
private void doInstanceJvmMemoryPoolMax(ServiceInstanceJVMMemoryPool source) {
InstanceJvmMemoryPoolMaxIndicator indicator = new InstanceJvmMemoryPoolMaxIndicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setServiceInstanceId(source.getServiceInstanceId());
indicator.combine(source.getMax(), 1);
IndicatorProcess.INSTANCE.in(indicator);
}
}
/*
* 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.serviceinstancerelation;
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 = "serviceinstancerelation_avg", builder = ServiceInstanceRelationAvgIndicator.Builder.class)
public class ServiceInstanceRelationAvgIndicator extends LongAvgIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
@Setter @Getter @Column(columnName = "source_service_id") private int sourceServiceId;
@Setter @Getter @Column(columnName = "destServiceId") private int destServiceId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceInstanceRelationAvgIndicator indicator = (ServiceInstanceRelationAvgIndicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getSummation());
remoteBuilder.setDataLongs(1, getValue());
remoteBuilder.setDataLongs(2, getTimeBucket());
remoteBuilder.setDataIntegers(0, getSourceServiceId());
remoteBuilder.setDataIntegers(1, getDestServiceId());
remoteBuilder.setDataIntegers(2, getCount());
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setSummation(remoteData.getDataLongs(0));
setValue(remoteData.getDataLongs(1));
setTimeBucket(remoteData.getDataLongs(2));
setSourceServiceId(remoteData.getDataIntegers(0));
setDestServiceId(remoteData.getDataIntegers(1));
setCount(remoteData.getDataIntegers(2));
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("ServiceInstanceRelation_Avg", Scope.ServiceInstanceRelation, entityId);
}
@Override
public Indicator toHour() {
ServiceInstanceRelationAvgIndicator indicator = new ServiceInstanceRelationAvgIndicator();
indicator.setTimeBucket(toTimeBucketInHour());
indicator.setEntityId(this.getEntityId());
indicator.setSourceServiceId(this.getSourceServiceId());
indicator.setDestServiceId(this.getDestServiceId());
indicator.setSummation(this.getSummation());
indicator.setCount(this.getCount());
indicator.setValue(this.getValue());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
@Override
public Indicator toDay() {
ServiceInstanceRelationAvgIndicator indicator = new ServiceInstanceRelationAvgIndicator();
indicator.setTimeBucket(toTimeBucketInDay());
indicator.setEntityId(this.getEntityId());
indicator.setSourceServiceId(this.getSourceServiceId());
indicator.setDestServiceId(this.getDestServiceId());
indicator.setSummation(this.getSummation());
indicator.setCount(this.getCount());
indicator.setValue(this.getValue());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
@Override
public Indicator toMonth() {
ServiceInstanceRelationAvgIndicator indicator = new ServiceInstanceRelationAvgIndicator();
indicator.setTimeBucket(toTimeBucketInMonth());
indicator.setEntityId(this.getEntityId());
indicator.setSourceServiceId(this.getSourceServiceId());
indicator.setDestServiceId(this.getDestServiceId());
indicator.setSummation(this.getSummation());
indicator.setCount(this.getCount());
indicator.setValue(this.getValue());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceInstanceRelationAvgIndicator> {
@Override public Map<String, Object> data2Map(ServiceInstanceRelationAvgIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("entity_id", storageData.getEntityId());
map.put("source_service_id", storageData.getSourceServiceId());
map.put("destServiceId", storageData.getDestServiceId());
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 ServiceInstanceRelationAvgIndicator map2Data(Map<String, Object> dbMap) {
ServiceInstanceRelationAvgIndicator indicator = new ServiceInstanceRelationAvgIndicator();
indicator.setEntityId((String)dbMap.get("entity_id"));
indicator.setSourceServiceId(((Number)dbMap.get("source_service_id")).intValue());
indicator.setDestServiceId(((Number)dbMap.get("destServiceId")).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;
}
}
}
......@@ -19,7 +19,6 @@
package org.apache.skywalking.oap.server.core.analysis.generated.serviceinstancerelation;
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.*;
/**
......@@ -30,18 +29,6 @@ import org.apache.skywalking.oap.server.core.source.*;
public class ServiceInstanceRelationDispatcher implements SourceDispatcher<ServiceInstanceRelation> {
@Override public void dispatch(ServiceInstanceRelation source) {
doServiceInstanceRelationAvg(source);
}
private void doServiceInstanceRelationAvg(ServiceInstanceRelation source) {
ServiceInstanceRelationAvgIndicator indicator = new ServiceInstanceRelationAvgIndicator();
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.setSourceServiceId(source.getSourceServiceId());
indicator.setDestServiceId(source.getDestServiceId());
indicator.combine(source.getLatency(), 1);
IndicatorProcess.INSTANCE.in(indicator);
}
}
/*
* 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.servicerelation;
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_relation_client_call_sla", builder = ServiceRelationClientCallSlaIndicator.Builder.class)
public class ServiceRelationClientCallSlaIndicator extends PercentIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private String entityId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceRelationClientCallSlaIndicator indicator = (ServiceRelationClientCallSlaIndicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTotal());
remoteBuilder.setDataLongs(1, getMatch());
remoteBuilder.setDataLongs(2, getTimeBucket());
remoteBuilder.setDataIntegers(0, getPercentage());
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTotal(remoteData.getDataLongs(0));
setMatch(remoteData.getDataLongs(1));
setTimeBucket(remoteData.getDataLongs(2));
setPercentage(remoteData.getDataIntegers(0));
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("service_relation_client_call_sla", Scope.ServiceRelation, entityId);
}
@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(this.getTimeBucket());
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(this.getTimeBucket());
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(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceRelationClientCallSlaIndicator> {
@Override public Map<String, Object> data2Map(ServiceRelationClientCallSlaIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("source_service_id", storageData.getEntityId());
map.put("total", storageData.getTotal());
map.put("percentage", storageData.getPercentage());
map.put("match", storageData.getMatch());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceRelationClientCallSlaIndicator map2Data(Map<String, Object> dbMap) {
ServiceRelationClientCallSlaIndicator indicator = new ServiceRelationClientCallSlaIndicator();
indicator.setEntityId((String)dbMap.get("source_service_id"));
indicator.setTotal(((Number)dbMap.get("total")).longValue());
indicator.setPercentage(((Number)dbMap.get("percentage")).intValue());
indicator.setMatch(((Number)dbMap.get("match")).longValue());
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
......@@ -38,8 +38,8 @@ import org.apache.skywalking.oap.server.core.source.Scope;
*/
@IndicatorType
@StreamData
@StorageEntity(name = "service_relation_client_calls_sum", builder = ServiceRelationClientCallsSumIndicator.Builder.class)
public class ServiceRelationClientCallsSumIndicator extends SumIndicator implements AlarmSupported {
@StorageEntity(name = "service_relation_client_cpm", builder = ServiceRelationClientCpmIndicator.Builder.class)
public class ServiceRelationClientCpmIndicator extends CPMIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private String entityId;
......@@ -71,7 +71,7 @@ public class ServiceRelationClientCallsSumIndicator extends SumIndicator impleme
if (getClass() != obj.getClass())
return false;
ServiceRelationClientCallsSumIndicator indicator = (ServiceRelationClientCallsSumIndicator)obj;
ServiceRelationClientCpmIndicator indicator = (ServiceRelationClientCpmIndicator)obj;
if (entityId != indicator.entityId)
return false;
......@@ -86,7 +86,8 @@ public class ServiceRelationClientCallsSumIndicator extends SumIndicator impleme
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getValue());
remoteBuilder.setDataLongs(1, getTimeBucket());
remoteBuilder.setDataLongs(1, getTotal());
remoteBuilder.setDataLongs(2, getTimeBucket());
......@@ -97,7 +98,8 @@ public class ServiceRelationClientCallsSumIndicator extends SumIndicator impleme
setEntityId(remoteData.getDataStrings(0));
setValue(remoteData.getDataLongs(0));
setTimeBucket(remoteData.getDataLongs(1));
setTotal(remoteData.getDataLongs(1));
setTimeBucket(remoteData.getDataLongs(2));
......@@ -105,53 +107,58 @@ public class ServiceRelationClientCallsSumIndicator extends SumIndicator impleme
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("Service_Relation_Client_Calls_Sum", Scope.ServiceRelation, entityId);
return new AlarmMeta("service_relation_client_cpm", Scope.ServiceRelation, entityId);
}
@Override
public Indicator toHour() {
ServiceRelationClientCallsSumIndicator indicator = new ServiceRelationClientCallsSumIndicator();
ServiceRelationClientCpmIndicator indicator = new ServiceRelationClientCpmIndicator();
indicator.setTimeBucket(toTimeBucketInHour());
indicator.setEntityId(this.getEntityId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
@Override
public Indicator toDay() {
ServiceRelationClientCallsSumIndicator indicator = new ServiceRelationClientCallsSumIndicator();
ServiceRelationClientCpmIndicator indicator = new ServiceRelationClientCpmIndicator();
indicator.setTimeBucket(toTimeBucketInDay());
indicator.setEntityId(this.getEntityId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
@Override
public Indicator toMonth() {
ServiceRelationClientCallsSumIndicator indicator = new ServiceRelationClientCallsSumIndicator();
ServiceRelationClientCpmIndicator indicator = new ServiceRelationClientCpmIndicator();
indicator.setTimeBucket(toTimeBucketInMonth());
indicator.setEntityId(this.getEntityId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceRelationClientCallsSumIndicator> {
public static class Builder implements StorageBuilder<ServiceRelationClientCpmIndicator> {
@Override public Map<String, Object> data2Map(ServiceRelationClientCallsSumIndicator storageData) {
@Override public Map<String, Object> data2Map(ServiceRelationClientCpmIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("source_service_id", storageData.getEntityId());
map.put("value", storageData.getValue());
map.put("total", storageData.getTotal());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceRelationClientCallsSumIndicator map2Data(Map<String, Object> dbMap) {
ServiceRelationClientCallsSumIndicator indicator = new ServiceRelationClientCallsSumIndicator();
@Override public ServiceRelationClientCpmIndicator map2Data(Map<String, Object> dbMap) {
ServiceRelationClientCpmIndicator indicator = new ServiceRelationClientCpmIndicator();
indicator.setEntityId((String)dbMap.get("source_service_id"));
indicator.setValue(((Number)dbMap.get("value")).longValue());
indicator.setTotal(((Number)dbMap.get("total")).longValue());
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
......
......@@ -38,8 +38,8 @@ import org.apache.skywalking.oap.server.core.source.Scope;
*/
@IndicatorType
@StreamData
@StorageEntity(name = "servicerelation_avg", builder = ServiceRelationAvgIndicator.Builder.class)
public class ServiceRelationAvgIndicator extends LongAvgIndicator implements AlarmSupported {
@StorageEntity(name = "service_relation_client_resp_time", builder = ServiceRelationClientRespTimeIndicator.Builder.class)
public class ServiceRelationClientRespTimeIndicator extends LongAvgIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private String entityId;
......@@ -71,7 +71,7 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
if (getClass() != obj.getClass())
return false;
ServiceRelationAvgIndicator indicator = (ServiceRelationAvgIndicator)obj;
ServiceRelationClientRespTimeIndicator indicator = (ServiceRelationClientRespTimeIndicator)obj;
if (entityId != indicator.entityId)
return false;
......@@ -109,12 +109,12 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("ServiceRelation_Avg", Scope.ServiceRelation, entityId);
return new AlarmMeta("service_relation_client_resp_time", Scope.ServiceRelation, entityId);
}
@Override
public Indicator toHour() {
ServiceRelationAvgIndicator indicator = new ServiceRelationAvgIndicator();
ServiceRelationClientRespTimeIndicator indicator = new ServiceRelationClientRespTimeIndicator();
indicator.setTimeBucket(toTimeBucketInHour());
indicator.setEntityId(this.getEntityId());
indicator.setSummation(this.getSummation());
......@@ -126,7 +126,7 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
@Override
public Indicator toDay() {
ServiceRelationAvgIndicator indicator = new ServiceRelationAvgIndicator();
ServiceRelationClientRespTimeIndicator indicator = new ServiceRelationClientRespTimeIndicator();
indicator.setTimeBucket(toTimeBucketInDay());
indicator.setEntityId(this.getEntityId());
indicator.setSummation(this.getSummation());
......@@ -138,7 +138,7 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
@Override
public Indicator toMonth() {
ServiceRelationAvgIndicator indicator = new ServiceRelationAvgIndicator();
ServiceRelationClientRespTimeIndicator indicator = new ServiceRelationClientRespTimeIndicator();
indicator.setTimeBucket(toTimeBucketInMonth());
indicator.setEntityId(this.getEntityId());
indicator.setSummation(this.getSummation());
......@@ -148,9 +148,9 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
return indicator;
}
public static class Builder implements StorageBuilder<ServiceRelationAvgIndicator> {
public static class Builder implements StorageBuilder<ServiceRelationClientRespTimeIndicator> {
@Override public Map<String, Object> data2Map(ServiceRelationAvgIndicator storageData) {
@Override public Map<String, Object> data2Map(ServiceRelationClientRespTimeIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("source_service_id", storageData.getEntityId());
map.put("summation", storageData.getSummation());
......@@ -160,8 +160,8 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
return map;
}
@Override public ServiceRelationAvgIndicator map2Data(Map<String, Object> dbMap) {
ServiceRelationAvgIndicator indicator = new ServiceRelationAvgIndicator();
@Override public ServiceRelationClientRespTimeIndicator map2Data(Map<String, Object> dbMap) {
ServiceRelationClientRespTimeIndicator indicator = new ServiceRelationClientRespTimeIndicator();
indicator.setEntityId((String)dbMap.get("source_service_id"));
indicator.setSummation(((Number)dbMap.get("summation")).longValue());
indicator.setCount(((Number)dbMap.get("count")).intValue());
......
......@@ -31,13 +31,16 @@ import org.apache.skywalking.oap.server.core.source.*;
public class ServiceRelationDispatcher implements SourceDispatcher<ServiceRelation> {
@Override public void dispatch(ServiceRelation source) {
doServiceRelationClientCallsSum(source);
doServiceRelationServerCallsSum(source);
doServiceRelationAvg(source);
doServiceRelationClientCpm(source);
doServiceRelationServerCpm(source);
doServiceRelationClientCallSla(source);
doServiceRelationServerCallSla(source);
doServiceRelationClientRespTime(source);
doServiceRelationServerRespTime(source);
}
private void doServiceRelationClientCallsSum(ServiceRelation source) {
ServiceRelationClientCallsSumIndicator indicator = new ServiceRelationClientCallsSumIndicator();
private void doServiceRelationClientCpm(ServiceRelation source) {
ServiceRelationClientCpmIndicator indicator = new ServiceRelationClientCpmIndicator();
if (!new EqualMatch().setLeft(source.getDetectPoint()).setRight(DetectPoint.CLIENT).match()) {
return;
......@@ -48,8 +51,8 @@ public class ServiceRelationDispatcher implements SourceDispatcher<ServiceRelati
indicator.combine(1);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceRelationServerCallsSum(ServiceRelation source) {
ServiceRelationServerCallsSumIndicator indicator = new ServiceRelationServerCallsSumIndicator();
private void doServiceRelationServerCpm(ServiceRelation source) {
ServiceRelationServerCpmIndicator indicator = new ServiceRelationServerCpmIndicator();
if (!new EqualMatch().setLeft(source.getDetectPoint()).setRight(DetectPoint.SERVER).match()) {
return;
......@@ -60,9 +63,48 @@ public class ServiceRelationDispatcher implements SourceDispatcher<ServiceRelati
indicator.combine(1);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceRelationAvg(ServiceRelation source) {
ServiceRelationAvgIndicator indicator = new ServiceRelationAvgIndicator();
private void doServiceRelationClientCallSla(ServiceRelation source) {
ServiceRelationClientCallSlaIndicator indicator = new ServiceRelationClientCallSlaIndicator();
if (!new EqualMatch().setLeft(source.getDetectPoint()).setRight(DetectPoint.CLIENT).match()) {
return;
}
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.combine(new org.apache.skywalking.oap.server.core.analysis.indicator.expression.EqualMatch(), source.isStatus(), true);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceRelationServerCallSla(ServiceRelation source) {
ServiceRelationServerCallSlaIndicator indicator = new ServiceRelationServerCallSlaIndicator();
if (!new EqualMatch().setLeft(source.getDetectPoint()).setRight(DetectPoint.SERVER).match()) {
return;
}
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.combine(new org.apache.skywalking.oap.server.core.analysis.indicator.expression.EqualMatch(), source.isStatus(), true);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceRelationClientRespTime(ServiceRelation source) {
ServiceRelationClientRespTimeIndicator indicator = new ServiceRelationClientRespTimeIndicator();
if (!new EqualMatch().setLeft(source.getDetectPoint()).setRight(DetectPoint.CLIENT).match()) {
return;
}
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
indicator.combine(source.getLatency(), 1);
IndicatorProcess.INSTANCE.in(indicator);
}
private void doServiceRelationServerRespTime(ServiceRelation source) {
ServiceRelationServerRespTimeIndicator indicator = new ServiceRelationServerRespTimeIndicator();
if (!new EqualMatch().setLeft(source.getDetectPoint()).setRight(DetectPoint.SERVER).match()) {
return;
}
indicator.setTimeBucket(source.getTimeBucket());
indicator.setEntityId(source.getEntityId());
......
/*
* 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.servicerelation;
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_relation_server_call_sla", builder = ServiceRelationServerCallSlaIndicator.Builder.class)
public class ServiceRelationServerCallSlaIndicator extends PercentIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private String entityId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceRelationServerCallSlaIndicator indicator = (ServiceRelationServerCallSlaIndicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getTotal());
remoteBuilder.setDataLongs(1, getMatch());
remoteBuilder.setDataLongs(2, getTimeBucket());
remoteBuilder.setDataIntegers(0, getPercentage());
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setTotal(remoteData.getDataLongs(0));
setMatch(remoteData.getDataLongs(1));
setTimeBucket(remoteData.getDataLongs(2));
setPercentage(remoteData.getDataIntegers(0));
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("service_relation_server_call_sla", Scope.ServiceRelation, entityId);
}
@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(this.getTimeBucket());
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(this.getTimeBucket());
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(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceRelationServerCallSlaIndicator> {
@Override public Map<String, Object> data2Map(ServiceRelationServerCallSlaIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("source_service_id", storageData.getEntityId());
map.put("total", storageData.getTotal());
map.put("percentage", storageData.getPercentage());
map.put("match", storageData.getMatch());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceRelationServerCallSlaIndicator map2Data(Map<String, Object> dbMap) {
ServiceRelationServerCallSlaIndicator indicator = new ServiceRelationServerCallSlaIndicator();
indicator.setEntityId((String)dbMap.get("source_service_id"));
indicator.setTotal(((Number)dbMap.get("total")).longValue());
indicator.setPercentage(((Number)dbMap.get("percentage")).intValue());
indicator.setMatch(((Number)dbMap.get("match")).longValue());
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
}
}
......@@ -38,8 +38,8 @@ import org.apache.skywalking.oap.server.core.source.Scope;
*/
@IndicatorType
@StreamData
@StorageEntity(name = "service_relation_server_calls_sum", builder = ServiceRelationServerCallsSumIndicator.Builder.class)
public class ServiceRelationServerCallsSumIndicator extends SumIndicator implements AlarmSupported {
@StorageEntity(name = "service_relation_server_cpm", builder = ServiceRelationServerCpmIndicator.Builder.class)
public class ServiceRelationServerCpmIndicator extends CPMIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private String entityId;
......@@ -71,7 +71,7 @@ public class ServiceRelationServerCallsSumIndicator extends SumIndicator impleme
if (getClass() != obj.getClass())
return false;
ServiceRelationServerCallsSumIndicator indicator = (ServiceRelationServerCallsSumIndicator)obj;
ServiceRelationServerCpmIndicator indicator = (ServiceRelationServerCpmIndicator)obj;
if (entityId != indicator.entityId)
return false;
......@@ -86,7 +86,8 @@ public class ServiceRelationServerCallsSumIndicator extends SumIndicator impleme
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getValue());
remoteBuilder.setDataLongs(1, getTimeBucket());
remoteBuilder.setDataLongs(1, getTotal());
remoteBuilder.setDataLongs(2, getTimeBucket());
......@@ -97,7 +98,8 @@ public class ServiceRelationServerCallsSumIndicator extends SumIndicator impleme
setEntityId(remoteData.getDataStrings(0));
setValue(remoteData.getDataLongs(0));
setTimeBucket(remoteData.getDataLongs(1));
setTotal(remoteData.getDataLongs(1));
setTimeBucket(remoteData.getDataLongs(2));
......@@ -105,53 +107,58 @@ public class ServiceRelationServerCallsSumIndicator extends SumIndicator impleme
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("Service_Relation_Server_Calls_Sum", Scope.ServiceRelation, entityId);
return new AlarmMeta("service_relation_server_cpm", Scope.ServiceRelation, entityId);
}
@Override
public Indicator toHour() {
ServiceRelationServerCallsSumIndicator indicator = new ServiceRelationServerCallsSumIndicator();
ServiceRelationServerCpmIndicator indicator = new ServiceRelationServerCpmIndicator();
indicator.setTimeBucket(toTimeBucketInHour());
indicator.setEntityId(this.getEntityId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
@Override
public Indicator toDay() {
ServiceRelationServerCallsSumIndicator indicator = new ServiceRelationServerCallsSumIndicator();
ServiceRelationServerCpmIndicator indicator = new ServiceRelationServerCpmIndicator();
indicator.setTimeBucket(toTimeBucketInDay());
indicator.setEntityId(this.getEntityId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
@Override
public Indicator toMonth() {
ServiceRelationServerCallsSumIndicator indicator = new ServiceRelationServerCallsSumIndicator();
ServiceRelationServerCpmIndicator indicator = new ServiceRelationServerCpmIndicator();
indicator.setTimeBucket(toTimeBucketInMonth());
indicator.setEntityId(this.getEntityId());
indicator.setValue(this.getValue());
indicator.setTotal(this.getTotal());
indicator.setTimeBucket(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceRelationServerCallsSumIndicator> {
public static class Builder implements StorageBuilder<ServiceRelationServerCpmIndicator> {
@Override public Map<String, Object> data2Map(ServiceRelationServerCallsSumIndicator storageData) {
@Override public Map<String, Object> data2Map(ServiceRelationServerCpmIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("source_service_id", storageData.getEntityId());
map.put("value", storageData.getValue());
map.put("total", storageData.getTotal());
map.put("time_bucket", storageData.getTimeBucket());
return map;
}
@Override public ServiceRelationServerCallsSumIndicator map2Data(Map<String, Object> dbMap) {
ServiceRelationServerCallsSumIndicator indicator = new ServiceRelationServerCallsSumIndicator();
@Override public ServiceRelationServerCpmIndicator map2Data(Map<String, Object> dbMap) {
ServiceRelationServerCpmIndicator indicator = new ServiceRelationServerCpmIndicator();
indicator.setEntityId((String)dbMap.get("source_service_id"));
indicator.setValue(((Number)dbMap.get("value")).longValue());
indicator.setTotal(((Number)dbMap.get("total")).longValue());
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
return indicator;
}
......
/*
* 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.servicerelation;
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_relation_server_resp_time", builder = ServiceRelationServerRespTimeIndicator.Builder.class)
public class ServiceRelationServerRespTimeIndicator extends LongAvgIndicator implements AlarmSupported {
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private String entityId;
@Override public String id() {
String splitJointId = String.valueOf(getTimeBucket());
splitJointId += Const.ID_SPLIT + entityId;
return splitJointId;
}
@Override public int hashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
result = 31 * result + (int)getTimeBucket();
return result;
}
@Override public int remoteHashCode() {
int result = 17;
result = 31 * result + entityId.hashCode();
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceRelationServerRespTimeIndicator indicator = (ServiceRelationServerRespTimeIndicator)obj;
if (entityId != indicator.entityId)
return false;
if (getTimeBucket() != indicator.getTimeBucket())
return false;
return true;
}
@Override public RemoteData.Builder serialize() {
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
remoteBuilder.setDataStrings(0, getEntityId());
remoteBuilder.setDataLongs(0, getSummation());
remoteBuilder.setDataLongs(1, getValue());
remoteBuilder.setDataLongs(2, getTimeBucket());
remoteBuilder.setDataIntegers(0, getCount());
return remoteBuilder;
}
@Override public void deserialize(RemoteData remoteData) {
setEntityId(remoteData.getDataStrings(0));
setSummation(remoteData.getDataLongs(0));
setValue(remoteData.getDataLongs(1));
setTimeBucket(remoteData.getDataLongs(2));
setCount(remoteData.getDataIntegers(0));
}
@Override public AlarmMeta getAlarmMeta() {
return new AlarmMeta("service_relation_server_resp_time", Scope.ServiceRelation, entityId);
}
@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(this.getTimeBucket());
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(this.getTimeBucket());
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(this.getTimeBucket());
return indicator;
}
public static class Builder implements StorageBuilder<ServiceRelationServerRespTimeIndicator> {
@Override public Map<String, Object> data2Map(ServiceRelationServerRespTimeIndicator storageData) {
Map<String, Object> map = new HashMap<>();
map.put("source_service_id", storageData.getEntityId());
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 ServiceRelationServerRespTimeIndicator map2Data(Map<String, Object> dbMap) {
ServiceRelationServerRespTimeIndicator indicator = new ServiceRelationServerRespTimeIndicator();
indicator.setEntityId((String)dbMap.get("source_service_id"));
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;
}
}
}
......@@ -36,7 +36,7 @@ public class ServiceInstanceJVMMemory extends Source {
@Getter @Setter private String name;
@Getter @Setter private String serviceName;
@Getter @Setter private int serviceInstanceId;
@Getter @Setter private boolean isHeap;
@Getter @Setter private boolean heapStatus;
@Getter @Setter private long init;
@Getter @Setter private long max;
@Getter @Setter private long used;
......
......@@ -102,7 +102,7 @@ public class JVMMetricsServiceHandler extends JVMMetricsServiceGrpc.JVMMetricsSe
serviceInstanceJVMMemory.setName(Const.EMPTY_STRING);
serviceInstanceJVMMemory.setServiceInstanceId(serviceInstanceId);
serviceInstanceJVMMemory.setServiceName(Const.EMPTY_STRING);
serviceInstanceJVMMemory.setHeap(memory.getIsHeap());
serviceInstanceJVMMemory.setHeapStatus(memory.getIsHeap());
serviceInstanceJVMMemory.setInit(memory.getInit());
serviceInstanceJVMMemory.setMax(memory.getMax());
serviceInstanceJVMMemory.setUsed(memory.getUsed());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册