Support new indicator core. (#1669)
* Support new indicator core. * Block 2 unaccessible methods. * Add service call as manual indicator and refactor the core DIspatcherManager
This commit is contained in:
parent
83cef89af1
commit
fd83aa55af
|
|
@ -267,5 +267,9 @@ public class RunningRuleTest {
|
|||
public void setValue(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class AlarmEntrance {
|
|||
MetaInAlarm metaInAlarm = null;
|
||||
switch (alarmMeta.getScope()) {
|
||||
case Service:
|
||||
int serviceId = alarmMeta.getIds().getID(0);
|
||||
int serviceId = Integer.parseInt(alarmMeta.getId());
|
||||
ServiceInventory serviceInventory = serviceInventoryCache.get(serviceId);
|
||||
ServiceMetaInAlarm serviceMetaInAlarm = new ServiceMetaInAlarm();
|
||||
serviceMetaInAlarm.setIndicatorName(alarmMeta.getIndicatorName());
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
package org.apache.skywalking.oap.server.core.alarm;
|
||||
|
||||
import java.util.Objects;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.skywalking.oap.server.core.source.Scope;
|
||||
|
|
@ -29,25 +28,25 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
public class AlarmMeta {
|
||||
@Setter @Getter private String indicatorName;
|
||||
@Setter @Getter private Scope scope;
|
||||
@Setter @Getter private ScopeIDs ids;
|
||||
@Setter @Getter private String id;
|
||||
|
||||
public AlarmMeta(String indicatorName, Scope scope, int... ids) {
|
||||
public AlarmMeta(String indicatorName, Scope scope) {
|
||||
this.indicatorName = indicatorName;
|
||||
this.scope = scope;
|
||||
this.ids = new ScopeIDs(ids);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
AlarmMeta meta = (AlarmMeta)o;
|
||||
return Objects.equals(ids, meta.ids);
|
||||
public AlarmMeta(String indicatorName, Scope scope, String id) {
|
||||
this.indicatorName = indicatorName;
|
||||
this.scope = scope;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
return Objects.hash(ids);
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.oap.server.core.alarm;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Scope IDs represent IDs of this scope.
|
||||
* Such as:
|
||||
* 1. Service, Endpoint have a single int ID.
|
||||
* 2. Service Relation ID is combined by two INTs.
|
||||
*/
|
||||
public class ScopeIDs {
|
||||
private int[] ids;
|
||||
|
||||
public ScopeIDs(int... ids) {
|
||||
this.ids = ids;
|
||||
}
|
||||
|
||||
public int getID(int idx) {
|
||||
return ids[idx];
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
ScopeIDs ds = (ScopeIDs)o;
|
||||
return Arrays.equals(ids, ds.ids);
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
return Arrays.hashCode(ids);
|
||||
}
|
||||
}
|
||||
|
|
@ -31,7 +31,9 @@ import org.apache.skywalking.oap.server.core.analysis.generated.serviceinstancej
|
|||
import org.apache.skywalking.oap.server.core.analysis.generated.serviceinstancerelation.ServiceInstanceRelationDispatcher;
|
||||
import org.apache.skywalking.oap.server.core.analysis.generated.servicerelation.ServiceRelationDispatcher;
|
||||
import org.apache.skywalking.oap.server.core.analysis.manual.service.*;
|
||||
import org.apache.skywalking.oap.server.core.analysis.manual.servicerelation.ServiceCallRelationDispatcher;
|
||||
import org.apache.skywalking.oap.server.core.source.Scope;
|
||||
import org.apache.skywalking.oap.server.core.source.Source;
|
||||
import org.slf4j.*;
|
||||
|
||||
/**
|
||||
|
|
@ -41,31 +43,33 @@ public class DispatcherManager {
|
|||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DispatcherManager.class);
|
||||
|
||||
private Map<Scope, SourceDispatcher> dispatcherMap;
|
||||
private Map<Scope, SourceDispatcher[]> dispatcherMap;
|
||||
|
||||
public DispatcherManager() {
|
||||
this.dispatcherMap = new HashMap<>();
|
||||
|
||||
this.dispatcherMap.put(Scope.All, new AllDispatcher());
|
||||
this.dispatcherMap.put(Scope.All, new SourceDispatcher[] {new AllDispatcher()});
|
||||
|
||||
this.dispatcherMap.put(Scope.Service, new ServiceDispatcher());
|
||||
this.dispatcherMap.put(Scope.ServiceInstance, new ServiceInstanceDispatcher());
|
||||
this.dispatcherMap.put(Scope.Endpoint, new EndpointDispatcher());
|
||||
this.dispatcherMap.put(Scope.Service, new SourceDispatcher[] {new ServiceDispatcher()});
|
||||
this.dispatcherMap.put(Scope.ServiceInstance, new SourceDispatcher[] {new ServiceInstanceDispatcher()});
|
||||
this.dispatcherMap.put(Scope.Endpoint, new SourceDispatcher[] {new EndpointDispatcher()});
|
||||
|
||||
this.dispatcherMap.put(Scope.ServiceComponent, new ServiceComponentDispatcher());
|
||||
this.dispatcherMap.put(Scope.ServiceMapping, new ServiceMappingDispatcher());
|
||||
this.dispatcherMap.put(Scope.ServiceComponent, new SourceDispatcher[] {new ServiceComponentDispatcher()});
|
||||
this.dispatcherMap.put(Scope.ServiceMapping, new SourceDispatcher[] {new ServiceMappingDispatcher()});
|
||||
|
||||
this.dispatcherMap.put(Scope.ServiceRelation, new ServiceRelationDispatcher());
|
||||
this.dispatcherMap.put(Scope.ServiceInstanceRelation, new ServiceInstanceRelationDispatcher());
|
||||
this.dispatcherMap.put(Scope.EndpointRelation, new EndpointRelationDispatcher());
|
||||
this.dispatcherMap.put(Scope.ServiceRelation, new SourceDispatcher[] {new ServiceRelationDispatcher(), new ServiceCallRelationDispatcher()});
|
||||
this.dispatcherMap.put(Scope.ServiceInstanceRelation, new SourceDispatcher[] {new ServiceInstanceRelationDispatcher()});
|
||||
this.dispatcherMap.put(Scope.EndpointRelation, new SourceDispatcher[] {new EndpointRelationDispatcher()});
|
||||
|
||||
this.dispatcherMap.put(Scope.ServiceInstanceJVMCPU, new ServiceInstanceJVMCPUDispatcher());
|
||||
this.dispatcherMap.put(Scope.ServiceInstanceJVMGC, new ServiceInstanceJVMGCDispatcher());
|
||||
this.dispatcherMap.put(Scope.ServiceInstanceJVMMemory, new ServiceInstanceJVMMemoryDispatcher());
|
||||
this.dispatcherMap.put(Scope.ServiceInstanceJVMMemoryPool, new ServiceInstanceJVMMemoryPoolDispatcher());
|
||||
this.dispatcherMap.put(Scope.ServiceInstanceJVMCPU, new SourceDispatcher[] {new ServiceInstanceJVMCPUDispatcher()});
|
||||
this.dispatcherMap.put(Scope.ServiceInstanceJVMGC, new SourceDispatcher[] {new ServiceInstanceJVMGCDispatcher()});
|
||||
this.dispatcherMap.put(Scope.ServiceInstanceJVMMemory, new SourceDispatcher[] {new ServiceInstanceJVMMemoryDispatcher()});
|
||||
this.dispatcherMap.put(Scope.ServiceInstanceJVMMemoryPool, new SourceDispatcher[] {new ServiceInstanceJVMMemoryPoolDispatcher()});
|
||||
}
|
||||
|
||||
public SourceDispatcher getDispatcher(Scope scope) {
|
||||
return dispatcherMap.get(scope);
|
||||
public void forward(Source source) {
|
||||
for (SourceDispatcher dispatcher : dispatcherMap.get(source.scope())) {
|
||||
dispatcher.dispatch(source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@ public class AllHeatmapIndicator extends ThermodynamicIndicator implements Alarm
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
int result = 17;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@ public class AllP50Indicator extends P50Indicator implements AlarmSupported {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
int result = 17;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@ public class AllP75Indicator extends P75Indicator implements AlarmSupported {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
int result = 17;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@ public class AllP90Indicator extends P90Indicator implements AlarmSupported {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
int result = 17;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@ public class AllP95Indicator extends P95Indicator implements AlarmSupported {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
int result = 17;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@ public class AllP99Indicator extends P99Indicator implements AlarmSupported {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
int result = 17;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -41,23 +41,30 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "endpoint_avg", builder = EndpointAvgIndicator.Builder.class)
|
||||
public class EndpointAvgIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") @IDColumn private int id;
|
||||
@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 + String.valueOf(id);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + id;
|
||||
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;
|
||||
|
|
@ -67,7 +74,7 @@ public class EndpointAvgIndicator extends LongAvgIndicator implements AlarmSuppo
|
|||
return false;
|
||||
|
||||
EndpointAvgIndicator indicator = (EndpointAvgIndicator)obj;
|
||||
if (id != indicator.id)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -78,44 +85,44 @@ public class EndpointAvgIndicator extends LongAvgIndicator implements AlarmSuppo
|
|||
|
||||
@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, getId());
|
||||
remoteBuilder.setDataIntegers(1, getServiceId());
|
||||
remoteBuilder.setDataIntegers(2, getServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(3, getCount());
|
||||
remoteBuilder.setDataIntegers(0, getServiceId());
|
||||
remoteBuilder.setDataIntegers(1, getServiceInstanceId());
|
||||
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));
|
||||
|
||||
|
||||
setId(remoteData.getDataIntegers(0));
|
||||
setServiceId(remoteData.getDataIntegers(1));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(2));
|
||||
setCount(remoteData.getDataIntegers(3));
|
||||
setServiceId(remoteData.getDataIntegers(0));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(1));
|
||||
setCount(remoteData.getDataIntegers(2));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("endpoint_Avg", Scope.Endpoint, id, serviceId, serviceInstanceId);
|
||||
return new AlarmMeta("endpoint_Avg", Scope.Endpoint, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
EndpointAvgIndicator indicator = new EndpointAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
|
|
@ -129,7 +136,7 @@ public class EndpointAvgIndicator extends LongAvgIndicator implements AlarmSuppo
|
|||
public Indicator toDay() {
|
||||
EndpointAvgIndicator indicator = new EndpointAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
|
|
@ -143,7 +150,7 @@ public class EndpointAvgIndicator extends LongAvgIndicator implements AlarmSuppo
|
|||
public Indicator toMonth() {
|
||||
EndpointAvgIndicator indicator = new EndpointAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
|
|
@ -157,7 +164,7 @@ public class EndpointAvgIndicator extends LongAvgIndicator implements AlarmSuppo
|
|||
|
||||
@Override public Map<String, Object> data2Map(EndpointAvgIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", storageData.getId());
|
||||
map.put("entity_id", storageData.getEntityId());
|
||||
map.put("service_id", storageData.getServiceId());
|
||||
map.put("service_instance_id", storageData.getServiceInstanceId());
|
||||
map.put("summation", storageData.getSummation());
|
||||
|
|
@ -169,7 +176,7 @@ public class EndpointAvgIndicator extends LongAvgIndicator implements AlarmSuppo
|
|||
|
||||
@Override public EndpointAvgIndicator map2Data(Map<String, Object> dbMap) {
|
||||
EndpointAvgIndicator indicator = new EndpointAvgIndicator();
|
||||
indicator.setId(((Number)dbMap.get("id")).intValue());
|
||||
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.setSummation(((Number)dbMap.get("summation")).longValue());
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class EndpointDispatcher implements SourceDispatcher<Endpoint> {
|
|||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.setServiceId(source.getServiceId());
|
||||
indicator.setServiceInstanceId(source.getServiceInstanceId());
|
||||
indicator.combine(source.getLatency(), 1);
|
||||
|
|
@ -51,7 +51,7 @@ public class EndpointDispatcher implements SourceDispatcher<Endpoint> {
|
|||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.setServiceId(source.getServiceId());
|
||||
indicator.setServiceInstanceId(source.getServiceInstanceId());
|
||||
indicator.combine(new org.apache.skywalking.oap.server.core.analysis.indicator.expression.EqualMatch(), source.isStatus(), true);
|
||||
|
|
|
|||
|
|
@ -41,23 +41,30 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "endpoint_percent", builder = EndpointPercentIndicator.Builder.class)
|
||||
public class EndpointPercentIndicator extends PercentIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") @IDColumn private int id;
|
||||
@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 + String.valueOf(id);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + id;
|
||||
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;
|
||||
|
|
@ -67,7 +74,7 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
|
|||
return false;
|
||||
|
||||
EndpointPercentIndicator indicator = (EndpointPercentIndicator)obj;
|
||||
if (id != indicator.id)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -78,44 +85,44 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
|
|||
|
||||
@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, getId());
|
||||
remoteBuilder.setDataIntegers(1, getServiceId());
|
||||
remoteBuilder.setDataIntegers(2, getServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(3, getPercentage());
|
||||
remoteBuilder.setDataIntegers(0, getServiceId());
|
||||
remoteBuilder.setDataIntegers(1, getServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(2, 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));
|
||||
|
||||
|
||||
setId(remoteData.getDataIntegers(0));
|
||||
setServiceId(remoteData.getDataIntegers(1));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(2));
|
||||
setPercentage(remoteData.getDataIntegers(3));
|
||||
setServiceId(remoteData.getDataIntegers(0));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(1));
|
||||
setPercentage(remoteData.getDataIntegers(2));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("endpoint_percent", Scope.Endpoint, id, serviceId, serviceInstanceId);
|
||||
return new AlarmMeta("endpoint_percent", Scope.Endpoint, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
EndpointPercentIndicator indicator = new EndpointPercentIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setTotal(this.getTotal());
|
||||
|
|
@ -129,7 +136,7 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
|
|||
public Indicator toDay() {
|
||||
EndpointPercentIndicator indicator = new EndpointPercentIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setTotal(this.getTotal());
|
||||
|
|
@ -143,7 +150,7 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
|
|||
public Indicator toMonth() {
|
||||
EndpointPercentIndicator indicator = new EndpointPercentIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setTotal(this.getTotal());
|
||||
|
|
@ -157,7 +164,7 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
|
|||
|
||||
@Override public Map<String, Object> data2Map(EndpointPercentIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", storageData.getId());
|
||||
map.put("entity_id", storageData.getEntityId());
|
||||
map.put("service_id", storageData.getServiceId());
|
||||
map.put("service_instance_id", storageData.getServiceInstanceId());
|
||||
map.put("total", storageData.getTotal());
|
||||
|
|
@ -169,7 +176,7 @@ public class EndpointPercentIndicator extends PercentIndicator implements AlarmS
|
|||
|
||||
@Override public EndpointPercentIndicator map2Data(Map<String, Object> dbMap) {
|
||||
EndpointPercentIndicator indicator = new EndpointPercentIndicator();
|
||||
indicator.setId(((Number)dbMap.get("id")).intValue());
|
||||
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.setTotal(((Number)dbMap.get("total")).longValue());
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "endpointrelation_avg", builder = EndpointRelationAvgIndicator.Builder.class)
|
||||
public class EndpointRelationAvgIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "endpoint_id") @IDColumn private int endpointId;
|
||||
@Setter @Getter @Column(columnName = "child_endpoint_id") @IDColumn private int childEndpointId;
|
||||
@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;
|
||||
|
|
@ -50,19 +49,24 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
|
|||
|
||||
@Override public String id() {
|
||||
String splitJointId = String.valueOf(getTimeBucket());
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(endpointId);
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(childEndpointId);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + endpointId;
|
||||
result = 31 * result + childEndpointId;
|
||||
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;
|
||||
|
|
@ -72,9 +76,7 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
|
|||
return false;
|
||||
|
||||
EndpointRelationAvgIndicator indicator = (EndpointRelationAvgIndicator)obj;
|
||||
if (endpointId != indicator.endpointId)
|
||||
return false;
|
||||
if (childEndpointId != indicator.childEndpointId)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -85,51 +87,48 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
|
|||
|
||||
@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, getEndpointId());
|
||||
remoteBuilder.setDataIntegers(1, getChildEndpointId());
|
||||
remoteBuilder.setDataIntegers(2, getServiceId());
|
||||
remoteBuilder.setDataIntegers(3, getChildServiceId());
|
||||
remoteBuilder.setDataIntegers(4, getServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(5, getChildServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(6, getCount());
|
||||
remoteBuilder.setDataIntegers(0, getServiceId());
|
||||
remoteBuilder.setDataIntegers(1, getChildServiceId());
|
||||
remoteBuilder.setDataIntegers(2, getServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(3, getChildServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(4, 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));
|
||||
|
||||
|
||||
setEndpointId(remoteData.getDataIntegers(0));
|
||||
setChildEndpointId(remoteData.getDataIntegers(1));
|
||||
setServiceId(remoteData.getDataIntegers(2));
|
||||
setChildServiceId(remoteData.getDataIntegers(3));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(4));
|
||||
setChildServiceInstanceId(remoteData.getDataIntegers(5));
|
||||
setCount(remoteData.getDataIntegers(6));
|
||||
setServiceId(remoteData.getDataIntegers(0));
|
||||
setChildServiceId(remoteData.getDataIntegers(1));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(2));
|
||||
setChildServiceInstanceId(remoteData.getDataIntegers(3));
|
||||
setCount(remoteData.getDataIntegers(4));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("EndpointRelation_Avg", Scope.EndpointRelation, endpointId, childEndpointId, serviceId, childServiceId, serviceInstanceId, childServiceInstanceId);
|
||||
return new AlarmMeta("EndpointRelation_Avg", Scope.EndpointRelation, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
EndpointRelationAvgIndicator indicator = new EndpointRelationAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setEndpointId(this.getEndpointId());
|
||||
indicator.setChildEndpointId(this.getChildEndpointId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setChildServiceId(this.getChildServiceId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
|
|
@ -145,8 +144,7 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
|
|||
public Indicator toDay() {
|
||||
EndpointRelationAvgIndicator indicator = new EndpointRelationAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setEndpointId(this.getEndpointId());
|
||||
indicator.setChildEndpointId(this.getChildEndpointId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setChildServiceId(this.getChildServiceId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
|
|
@ -162,8 +160,7 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
|
|||
public Indicator toMonth() {
|
||||
EndpointRelationAvgIndicator indicator = new EndpointRelationAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setEndpointId(this.getEndpointId());
|
||||
indicator.setChildEndpointId(this.getChildEndpointId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setChildServiceId(this.getChildServiceId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
|
|
@ -179,8 +176,7 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
|
|||
|
||||
@Override public Map<String, Object> data2Map(EndpointRelationAvgIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("endpoint_id", storageData.getEndpointId());
|
||||
map.put("child_endpoint_id", storageData.getChildEndpointId());
|
||||
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());
|
||||
|
|
@ -194,8 +190,7 @@ public class EndpointRelationAvgIndicator extends LongAvgIndicator implements Al
|
|||
|
||||
@Override public EndpointRelationAvgIndicator map2Data(Map<String, Object> dbMap) {
|
||||
EndpointRelationAvgIndicator indicator = new EndpointRelationAvgIndicator();
|
||||
indicator.setEndpointId(((Number)dbMap.get("endpoint_id")).intValue());
|
||||
indicator.setChildEndpointId(((Number)dbMap.get("child_endpoint_id")).intValue());
|
||||
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());
|
||||
|
|
|
|||
|
|
@ -38,8 +38,7 @@ public class EndpointRelationDispatcher implements SourceDispatcher<EndpointRela
|
|||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setEndpointId(source.getEndpointId());
|
||||
indicator.setChildEndpointId(source.getChildEndpointId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.setServiceId(source.getServiceId());
|
||||
indicator.setChildServiceId(source.getChildServiceId());
|
||||
indicator.setServiceInstanceId(source.getServiceInstanceId());
|
||||
|
|
|
|||
|
|
@ -41,21 +41,28 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "service_avg", builder = ServiceAvgIndicator.Builder.class)
|
||||
public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") @IDColumn private int id;
|
||||
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
|
||||
|
||||
@Override public String id() {
|
||||
String splitJointId = String.valueOf(getTimeBucket());
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(id);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + id;
|
||||
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;
|
||||
|
|
@ -65,7 +72,7 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
|
|||
return false;
|
||||
|
||||
ServiceAvgIndicator indicator = (ServiceAvgIndicator)obj;
|
||||
if (id != indicator.id)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -76,40 +83,40 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
|
|||
|
||||
@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, getId());
|
||||
remoteBuilder.setDataIntegers(1, getCount());
|
||||
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));
|
||||
|
||||
|
||||
setId(remoteData.getDataIntegers(0));
|
||||
setCount(remoteData.getDataIntegers(1));
|
||||
setCount(remoteData.getDataIntegers(0));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("Service_Avg", Scope.Service, id);
|
||||
return new AlarmMeta("Service_Avg", Scope.Service, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
ServiceAvgIndicator indicator = new ServiceAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
indicator.setValue(this.getValue());
|
||||
|
|
@ -121,7 +128,7 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
|
|||
public Indicator toDay() {
|
||||
ServiceAvgIndicator indicator = new ServiceAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
indicator.setValue(this.getValue());
|
||||
|
|
@ -133,7 +140,7 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
|
|||
public Indicator toMonth() {
|
||||
ServiceAvgIndicator indicator = new ServiceAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
indicator.setValue(this.getValue());
|
||||
|
|
@ -145,7 +152,7 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
|
|||
|
||||
@Override public Map<String, Object> data2Map(ServiceAvgIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", storageData.getId());
|
||||
map.put("entity_id", storageData.getEntityId());
|
||||
map.put("summation", storageData.getSummation());
|
||||
map.put("count", storageData.getCount());
|
||||
map.put("value", storageData.getValue());
|
||||
|
|
@ -155,7 +162,7 @@ public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSuppor
|
|||
|
||||
@Override public ServiceAvgIndicator map2Data(Map<String, Object> dbMap) {
|
||||
ServiceAvgIndicator indicator = new ServiceAvgIndicator();
|
||||
indicator.setId(((Number)dbMap.get("id")).intValue());
|
||||
indicator.setEntityId((String)dbMap.get("entity_id"));
|
||||
indicator.setSummation(((Number)dbMap.get("summation")).longValue());
|
||||
indicator.setCount(((Number)dbMap.get("count")).intValue());
|
||||
indicator.setValue(((Number)dbMap.get("value")).longValue());
|
||||
|
|
|
|||
|
|
@ -41,21 +41,28 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "service_calls_sum", builder = ServiceCallsSumIndicator.Builder.class)
|
||||
public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") @IDColumn private int id;
|
||||
@Setter @Getter @Column(columnName = "entity_id") @IDColumn private String entityId;
|
||||
|
||||
@Override public String id() {
|
||||
String splitJointId = String.valueOf(getTimeBucket());
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(id);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + id;
|
||||
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;
|
||||
|
|
@ -65,7 +72,7 @@ public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSuppo
|
|||
return false;
|
||||
|
||||
ServiceCallsSumIndicator indicator = (ServiceCallsSumIndicator)obj;
|
||||
if (id != indicator.id)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -76,36 +83,36 @@ public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSuppo
|
|||
|
||||
@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, getId());
|
||||
|
||||
return remoteBuilder;
|
||||
}
|
||||
|
||||
@Override public void deserialize(RemoteData remoteData) {
|
||||
setEntityId(remoteData.getDataStrings(0));
|
||||
|
||||
setValue(remoteData.getDataLongs(0));
|
||||
setTimeBucket(remoteData.getDataLongs(1));
|
||||
|
||||
|
||||
setId(remoteData.getDataIntegers(0));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("Service_Calls_Sum", Scope.Service, id);
|
||||
return new AlarmMeta("Service_Calls_Sum", Scope.Service, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
ServiceCallsSumIndicator indicator = new ServiceCallsSumIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setValue(this.getValue());
|
||||
indicator.setTimeBucket(this.getTimeBucket());
|
||||
return indicator;
|
||||
|
|
@ -115,7 +122,7 @@ public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSuppo
|
|||
public Indicator toDay() {
|
||||
ServiceCallsSumIndicator indicator = new ServiceCallsSumIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setValue(this.getValue());
|
||||
indicator.setTimeBucket(this.getTimeBucket());
|
||||
return indicator;
|
||||
|
|
@ -125,7 +132,7 @@ public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSuppo
|
|||
public Indicator toMonth() {
|
||||
ServiceCallsSumIndicator indicator = new ServiceCallsSumIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setValue(this.getValue());
|
||||
indicator.setTimeBucket(this.getTimeBucket());
|
||||
return indicator;
|
||||
|
|
@ -135,7 +142,7 @@ public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSuppo
|
|||
|
||||
@Override public Map<String, Object> data2Map(ServiceCallsSumIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", storageData.getId());
|
||||
map.put("entity_id", storageData.getEntityId());
|
||||
map.put("value", storageData.getValue());
|
||||
map.put("time_bucket", storageData.getTimeBucket());
|
||||
return map;
|
||||
|
|
@ -143,7 +150,7 @@ public class ServiceCallsSumIndicator extends SumIndicator implements AlarmSuppo
|
|||
|
||||
@Override public ServiceCallsSumIndicator map2Data(Map<String, Object> dbMap) {
|
||||
ServiceCallsSumIndicator indicator = new ServiceCallsSumIndicator();
|
||||
indicator.setId(((Number)dbMap.get("id")).intValue());
|
||||
indicator.setEntityId((String)dbMap.get("entity_id"));
|
||||
indicator.setValue(((Number)dbMap.get("value")).longValue());
|
||||
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
|
||||
return indicator;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class ServiceDispatcher implements SourceDispatcher<Service> {
|
|||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.combine(source.getLatency(), 1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ public class ServiceDispatcher implements SourceDispatcher<Service> {
|
|||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.combine(1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class ServiceInstanceDispatcher implements SourceDispatcher<ServiceInstan
|
|||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.setServiceId(source.getServiceId());
|
||||
indicator.combine(source.getLatency(), 1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
|
|
|
|||
|
|
@ -41,22 +41,29 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "serviceinstance_resptime", builder = ServiceInstanceRespTimeIndicator.Builder.class)
|
||||
public class ServiceInstanceRespTimeIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") @IDColumn private int id;
|
||||
@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 + String.valueOf(id);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + id;
|
||||
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;
|
||||
|
|
@ -66,7 +73,7 @@ public class ServiceInstanceRespTimeIndicator extends LongAvgIndicator implement
|
|||
return false;
|
||||
|
||||
ServiceInstanceRespTimeIndicator indicator = (ServiceInstanceRespTimeIndicator)obj;
|
||||
if (id != indicator.id)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -77,42 +84,42 @@ public class ServiceInstanceRespTimeIndicator extends LongAvgIndicator implement
|
|||
|
||||
@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, getId());
|
||||
remoteBuilder.setDataIntegers(1, getServiceId());
|
||||
remoteBuilder.setDataIntegers(2, getCount());
|
||||
remoteBuilder.setDataIntegers(0, getServiceId());
|
||||
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));
|
||||
|
||||
|
||||
setId(remoteData.getDataIntegers(0));
|
||||
setServiceId(remoteData.getDataIntegers(1));
|
||||
setCount(remoteData.getDataIntegers(2));
|
||||
setServiceId(remoteData.getDataIntegers(0));
|
||||
setCount(remoteData.getDataIntegers(1));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("ServiceInstance_RespTime", Scope.ServiceInstance, id, serviceId);
|
||||
return new AlarmMeta("ServiceInstance_RespTime", Scope.ServiceInstance, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
ServiceInstanceRespTimeIndicator indicator = new ServiceInstanceRespTimeIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -125,7 +132,7 @@ public class ServiceInstanceRespTimeIndicator extends LongAvgIndicator implement
|
|||
public Indicator toDay() {
|
||||
ServiceInstanceRespTimeIndicator indicator = new ServiceInstanceRespTimeIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -138,7 +145,7 @@ public class ServiceInstanceRespTimeIndicator extends LongAvgIndicator implement
|
|||
public Indicator toMonth() {
|
||||
ServiceInstanceRespTimeIndicator indicator = new ServiceInstanceRespTimeIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceId(this.getServiceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -151,7 +158,7 @@ public class ServiceInstanceRespTimeIndicator extends LongAvgIndicator implement
|
|||
|
||||
@Override public Map<String, Object> data2Map(ServiceInstanceRespTimeIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", storageData.getId());
|
||||
map.put("entity_id", storageData.getEntityId());
|
||||
map.put("service_id", storageData.getServiceId());
|
||||
map.put("summation", storageData.getSummation());
|
||||
map.put("count", storageData.getCount());
|
||||
|
|
@ -162,7 +169,7 @@ public class ServiceInstanceRespTimeIndicator extends LongAvgIndicator implement
|
|||
|
||||
@Override public ServiceInstanceRespTimeIndicator map2Data(Map<String, Object> dbMap) {
|
||||
ServiceInstanceRespTimeIndicator indicator = new ServiceInstanceRespTimeIndicator();
|
||||
indicator.setId(((Number)dbMap.get("id")).intValue());
|
||||
indicator.setEntityId((String)dbMap.get("entity_id"));
|
||||
indicator.setServiceId(((Number)dbMap.get("service_id")).intValue());
|
||||
indicator.setSummation(((Number)dbMap.get("summation")).longValue());
|
||||
indicator.setCount(((Number)dbMap.get("count")).intValue());
|
||||
|
|
|
|||
|
|
@ -41,22 +41,29 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "instance_jvm_cpu", builder = InstanceJvmCpuIndicator.Builder.class)
|
||||
public class InstanceJvmCpuIndicator extends DoubleAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") @IDColumn private int id;
|
||||
@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 + String.valueOf(id);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + id;
|
||||
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;
|
||||
|
|
@ -66,7 +73,7 @@ public class InstanceJvmCpuIndicator extends DoubleAvgIndicator implements Alarm
|
|||
return false;
|
||||
|
||||
InstanceJvmCpuIndicator indicator = (InstanceJvmCpuIndicator)obj;
|
||||
if (id != indicator.id)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -77,42 +84,42 @@ public class InstanceJvmCpuIndicator extends DoubleAvgIndicator implements Alarm
|
|||
|
||||
@Override public RemoteData.Builder serialize() {
|
||||
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
|
||||
remoteBuilder.setDataStrings(0, getEntityId());
|
||||
|
||||
remoteBuilder.setDataLongs(0, getTimeBucket());
|
||||
|
||||
remoteBuilder.setDataDoubles(0, getSummation());
|
||||
remoteBuilder.setDataDoubles(1, getValue());
|
||||
|
||||
remoteBuilder.setDataIntegers(0, getId());
|
||||
remoteBuilder.setDataIntegers(1, getServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(2, getCount());
|
||||
remoteBuilder.setDataIntegers(0, getServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(1, getCount());
|
||||
|
||||
return remoteBuilder;
|
||||
}
|
||||
|
||||
@Override public void deserialize(RemoteData remoteData) {
|
||||
setEntityId(remoteData.getDataStrings(0));
|
||||
|
||||
setTimeBucket(remoteData.getDataLongs(0));
|
||||
|
||||
setSummation(remoteData.getDataDoubles(0));
|
||||
setValue(remoteData.getDataDoubles(1));
|
||||
|
||||
setId(remoteData.getDataIntegers(0));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(1));
|
||||
setCount(remoteData.getDataIntegers(2));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(0));
|
||||
setCount(remoteData.getDataIntegers(1));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("instance_jvm_cpu", Scope.ServiceInstanceJVMCPU, id, serviceInstanceId);
|
||||
return new AlarmMeta("instance_jvm_cpu", Scope.ServiceInstanceJVMCPU, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
InstanceJvmCpuIndicator indicator = new InstanceJvmCpuIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -125,7 +132,7 @@ public class InstanceJvmCpuIndicator extends DoubleAvgIndicator implements Alarm
|
|||
public Indicator toDay() {
|
||||
InstanceJvmCpuIndicator indicator = new InstanceJvmCpuIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -138,7 +145,7 @@ public class InstanceJvmCpuIndicator extends DoubleAvgIndicator implements Alarm
|
|||
public Indicator toMonth() {
|
||||
InstanceJvmCpuIndicator indicator = new InstanceJvmCpuIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -151,7 +158,7 @@ public class InstanceJvmCpuIndicator extends DoubleAvgIndicator implements Alarm
|
|||
|
||||
@Override public Map<String, Object> data2Map(InstanceJvmCpuIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", storageData.getId());
|
||||
map.put("entity_id", storageData.getEntityId());
|
||||
map.put("service_instance_id", storageData.getServiceInstanceId());
|
||||
map.put("summation", storageData.getSummation());
|
||||
map.put("count", storageData.getCount());
|
||||
|
|
@ -162,7 +169,7 @@ public class InstanceJvmCpuIndicator extends DoubleAvgIndicator implements Alarm
|
|||
|
||||
@Override public InstanceJvmCpuIndicator map2Data(Map<String, Object> dbMap) {
|
||||
InstanceJvmCpuIndicator indicator = new InstanceJvmCpuIndicator();
|
||||
indicator.setId(((Number)dbMap.get("id")).intValue());
|
||||
indicator.setEntityId((String)dbMap.get("entity_id"));
|
||||
indicator.setServiceInstanceId(((Number)dbMap.get("service_instance_id")).intValue());
|
||||
indicator.setSummation(((Number)dbMap.get("summation")).doubleValue());
|
||||
indicator.setCount(((Number)dbMap.get("count")).intValue());
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class ServiceInstanceJVMCPUDispatcher implements SourceDispatcher<Service
|
|||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.setServiceInstanceId(source.getServiceInstanceId());
|
||||
indicator.combine(source.getUsePercent(), 1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
|
|
|
|||
|
|
@ -41,22 +41,29 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "instance_jvm_young_gc_time", builder = InstanceJvmYoungGcTimeIndicator.Builder.class)
|
||||
public class InstanceJvmYoungGcTimeIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") @IDColumn private int id;
|
||||
@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 + String.valueOf(id);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + id;
|
||||
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;
|
||||
|
|
@ -66,7 +73,7 @@ public class InstanceJvmYoungGcTimeIndicator extends LongAvgIndicator implements
|
|||
return false;
|
||||
|
||||
InstanceJvmYoungGcTimeIndicator indicator = (InstanceJvmYoungGcTimeIndicator)obj;
|
||||
if (id != indicator.id)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -77,42 +84,42 @@ public class InstanceJvmYoungGcTimeIndicator extends LongAvgIndicator implements
|
|||
|
||||
@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, getId());
|
||||
remoteBuilder.setDataIntegers(1, getServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(2, getCount());
|
||||
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));
|
||||
|
||||
|
||||
setId(remoteData.getDataIntegers(0));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(1));
|
||||
setCount(remoteData.getDataIntegers(2));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(0));
|
||||
setCount(remoteData.getDataIntegers(1));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("instance_jvm_young_gc_time", Scope.ServiceInstanceJVMGC, id, serviceInstanceId);
|
||||
return new AlarmMeta("instance_jvm_young_gc_time", Scope.ServiceInstanceJVMGC, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
InstanceJvmYoungGcTimeIndicator indicator = new InstanceJvmYoungGcTimeIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -125,7 +132,7 @@ public class InstanceJvmYoungGcTimeIndicator extends LongAvgIndicator implements
|
|||
public Indicator toDay() {
|
||||
InstanceJvmYoungGcTimeIndicator indicator = new InstanceJvmYoungGcTimeIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -138,7 +145,7 @@ public class InstanceJvmYoungGcTimeIndicator extends LongAvgIndicator implements
|
|||
public Indicator toMonth() {
|
||||
InstanceJvmYoungGcTimeIndicator indicator = new InstanceJvmYoungGcTimeIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -151,7 +158,7 @@ public class InstanceJvmYoungGcTimeIndicator extends LongAvgIndicator implements
|
|||
|
||||
@Override public Map<String, Object> data2Map(InstanceJvmYoungGcTimeIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", storageData.getId());
|
||||
map.put("entity_id", storageData.getEntityId());
|
||||
map.put("service_instance_id", storageData.getServiceInstanceId());
|
||||
map.put("summation", storageData.getSummation());
|
||||
map.put("count", storageData.getCount());
|
||||
|
|
@ -162,7 +169,7 @@ public class InstanceJvmYoungGcTimeIndicator extends LongAvgIndicator implements
|
|||
|
||||
@Override public InstanceJvmYoungGcTimeIndicator map2Data(Map<String, Object> dbMap) {
|
||||
InstanceJvmYoungGcTimeIndicator indicator = new InstanceJvmYoungGcTimeIndicator();
|
||||
indicator.setId(((Number)dbMap.get("id")).intValue());
|
||||
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());
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class ServiceInstanceJVMGCDispatcher implements SourceDispatcher<ServiceI
|
|||
}
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.setServiceInstanceId(source.getServiceInstanceId());
|
||||
indicator.combine(source.getTime(), 1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
|
|
|
|||
|
|
@ -41,22 +41,29 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "instance_jvm_memory_max", builder = InstanceJvmMemoryMaxIndicator.Builder.class)
|
||||
public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") @IDColumn private int id;
|
||||
@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 + String.valueOf(id);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + id;
|
||||
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;
|
||||
|
|
@ -66,7 +73,7 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
|
|||
return false;
|
||||
|
||||
InstanceJvmMemoryMaxIndicator indicator = (InstanceJvmMemoryMaxIndicator)obj;
|
||||
if (id != indicator.id)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -77,42 +84,42 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
|
|||
|
||||
@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, getId());
|
||||
remoteBuilder.setDataIntegers(1, getServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(2, getCount());
|
||||
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));
|
||||
|
||||
|
||||
setId(remoteData.getDataIntegers(0));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(1));
|
||||
setCount(remoteData.getDataIntegers(2));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(0));
|
||||
setCount(remoteData.getDataIntegers(1));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("instance_jvm_memory_max", Scope.ServiceInstanceJVMMemory, id, serviceInstanceId);
|
||||
return new AlarmMeta("instance_jvm_memory_max", Scope.ServiceInstanceJVMMemory, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
InstanceJvmMemoryMaxIndicator indicator = new InstanceJvmMemoryMaxIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -125,7 +132,7 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
|
|||
public Indicator toDay() {
|
||||
InstanceJvmMemoryMaxIndicator indicator = new InstanceJvmMemoryMaxIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -138,7 +145,7 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
|
|||
public Indicator toMonth() {
|
||||
InstanceJvmMemoryMaxIndicator indicator = new InstanceJvmMemoryMaxIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -151,7 +158,7 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
|
|||
|
||||
@Override public Map<String, Object> data2Map(InstanceJvmMemoryMaxIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", storageData.getId());
|
||||
map.put("entity_id", storageData.getEntityId());
|
||||
map.put("service_instance_id", storageData.getServiceInstanceId());
|
||||
map.put("summation", storageData.getSummation());
|
||||
map.put("count", storageData.getCount());
|
||||
|
|
@ -162,7 +169,7 @@ public class InstanceJvmMemoryMaxIndicator extends LongAvgIndicator implements A
|
|||
|
||||
@Override public InstanceJvmMemoryMaxIndicator map2Data(Map<String, Object> dbMap) {
|
||||
InstanceJvmMemoryMaxIndicator indicator = new InstanceJvmMemoryMaxIndicator();
|
||||
indicator.setId(((Number)dbMap.get("id")).intValue());
|
||||
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());
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class ServiceInstanceJVMMemoryDispatcher implements SourceDispatcher<Serv
|
|||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.setServiceInstanceId(source.getServiceInstanceId());
|
||||
indicator.combine(source.getMax(), 1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
|
|
|
|||
|
|
@ -41,22 +41,29 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "instance_jvm_memory_pool_max", builder = InstanceJvmMemoryPoolMaxIndicator.Builder.class)
|
||||
public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "id") @IDColumn private int id;
|
||||
@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 + String.valueOf(id);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + id;
|
||||
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;
|
||||
|
|
@ -66,7 +73,7 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
|
|||
return false;
|
||||
|
||||
InstanceJvmMemoryPoolMaxIndicator indicator = (InstanceJvmMemoryPoolMaxIndicator)obj;
|
||||
if (id != indicator.id)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -77,42 +84,42 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
|
|||
|
||||
@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, getId());
|
||||
remoteBuilder.setDataIntegers(1, getServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(2, getCount());
|
||||
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));
|
||||
|
||||
|
||||
setId(remoteData.getDataIntegers(0));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(1));
|
||||
setCount(remoteData.getDataIntegers(2));
|
||||
setServiceInstanceId(remoteData.getDataIntegers(0));
|
||||
setCount(remoteData.getDataIntegers(1));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("instance_jvm_memory_pool_max", Scope.ServiceInstanceJVMMemoryPool, id, serviceInstanceId);
|
||||
return new AlarmMeta("instance_jvm_memory_pool_max", Scope.ServiceInstanceJVMMemoryPool, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
InstanceJvmMemoryPoolMaxIndicator indicator = new InstanceJvmMemoryPoolMaxIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -125,7 +132,7 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
|
|||
public Indicator toDay() {
|
||||
InstanceJvmMemoryPoolMaxIndicator indicator = new InstanceJvmMemoryPoolMaxIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -138,7 +145,7 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
|
|||
public Indicator toMonth() {
|
||||
InstanceJvmMemoryPoolMaxIndicator indicator = new InstanceJvmMemoryPoolMaxIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setId(this.getId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setServiceInstanceId(this.getServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
|
|
@ -151,7 +158,7 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
|
|||
|
||||
@Override public Map<String, Object> data2Map(InstanceJvmMemoryPoolMaxIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", storageData.getId());
|
||||
map.put("entity_id", storageData.getEntityId());
|
||||
map.put("service_instance_id", storageData.getServiceInstanceId());
|
||||
map.put("summation", storageData.getSummation());
|
||||
map.put("count", storageData.getCount());
|
||||
|
|
@ -162,7 +169,7 @@ public class InstanceJvmMemoryPoolMaxIndicator extends LongAvgIndicator implemen
|
|||
|
||||
@Override public InstanceJvmMemoryPoolMaxIndicator map2Data(Map<String, Object> dbMap) {
|
||||
InstanceJvmMemoryPoolMaxIndicator indicator = new InstanceJvmMemoryPoolMaxIndicator();
|
||||
indicator.setId(((Number)dbMap.get("id")).intValue());
|
||||
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());
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class ServiceInstanceJVMMemoryPoolDispatcher implements SourceDispatcher<
|
|||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setId(source.getId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.setServiceInstanceId(source.getServiceInstanceId());
|
||||
indicator.combine(source.getMax(), 1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
|
|
|
|||
|
|
@ -41,26 +41,30 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@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 = "dest_service_id") private int destServiceId;
|
||||
@Setter @Getter @Column(columnName = "source_service_instance_id") @IDColumn private int sourceServiceInstanceId;
|
||||
@Setter @Getter @Column(columnName = "dest_service_instance_id") @IDColumn private int destServiceInstanceId;
|
||||
@Setter @Getter @Column(columnName = "destServiceId") private int destServiceId;
|
||||
|
||||
@Override public String id() {
|
||||
String splitJointId = String.valueOf(getTimeBucket());
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(sourceServiceInstanceId);
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(destServiceInstanceId);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + sourceServiceInstanceId;
|
||||
result = 31 * result + destServiceInstanceId;
|
||||
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;
|
||||
|
|
@ -70,9 +74,7 @@ public class ServiceInstanceRelationAvgIndicator extends LongAvgIndicator implem
|
|||
return false;
|
||||
|
||||
ServiceInstanceRelationAvgIndicator indicator = (ServiceInstanceRelationAvgIndicator)obj;
|
||||
if (sourceServiceInstanceId != indicator.sourceServiceInstanceId)
|
||||
return false;
|
||||
if (destServiceInstanceId != indicator.destServiceInstanceId)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -83,6 +85,7 @@ public class ServiceInstanceRelationAvgIndicator extends LongAvgIndicator implem
|
|||
|
||||
@Override public RemoteData.Builder serialize() {
|
||||
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
|
||||
remoteBuilder.setDataStrings(0, getEntityId());
|
||||
|
||||
remoteBuilder.setDataLongs(0, getSummation());
|
||||
remoteBuilder.setDataLongs(1, getValue());
|
||||
|
|
@ -91,14 +94,13 @@ public class ServiceInstanceRelationAvgIndicator extends LongAvgIndicator implem
|
|||
|
||||
remoteBuilder.setDataIntegers(0, getSourceServiceId());
|
||||
remoteBuilder.setDataIntegers(1, getDestServiceId());
|
||||
remoteBuilder.setDataIntegers(2, getSourceServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(3, getDestServiceInstanceId());
|
||||
remoteBuilder.setDataIntegers(4, getCount());
|
||||
remoteBuilder.setDataIntegers(2, getCount());
|
||||
|
||||
return remoteBuilder;
|
||||
}
|
||||
|
||||
@Override public void deserialize(RemoteData remoteData) {
|
||||
setEntityId(remoteData.getDataStrings(0));
|
||||
|
||||
setSummation(remoteData.getDataLongs(0));
|
||||
setValue(remoteData.getDataLongs(1));
|
||||
|
|
@ -107,25 +109,22 @@ public class ServiceInstanceRelationAvgIndicator extends LongAvgIndicator implem
|
|||
|
||||
setSourceServiceId(remoteData.getDataIntegers(0));
|
||||
setDestServiceId(remoteData.getDataIntegers(1));
|
||||
setSourceServiceInstanceId(remoteData.getDataIntegers(2));
|
||||
setDestServiceInstanceId(remoteData.getDataIntegers(3));
|
||||
setCount(remoteData.getDataIntegers(4));
|
||||
setCount(remoteData.getDataIntegers(2));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("ServiceInstanceRelation_Avg", Scope.ServiceInstanceRelation, sourceServiceId, destServiceId, sourceServiceInstanceId, destServiceInstanceId);
|
||||
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.setSourceServiceInstanceId(this.getSourceServiceInstanceId());
|
||||
indicator.setDestServiceInstanceId(this.getDestServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
indicator.setValue(this.getValue());
|
||||
|
|
@ -137,10 +136,9 @@ public class ServiceInstanceRelationAvgIndicator extends LongAvgIndicator implem
|
|||
public Indicator toDay() {
|
||||
ServiceInstanceRelationAvgIndicator indicator = new ServiceInstanceRelationAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setSourceServiceId(this.getSourceServiceId());
|
||||
indicator.setDestServiceId(this.getDestServiceId());
|
||||
indicator.setSourceServiceInstanceId(this.getSourceServiceInstanceId());
|
||||
indicator.setDestServiceInstanceId(this.getDestServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
indicator.setValue(this.getValue());
|
||||
|
|
@ -152,10 +150,9 @@ public class ServiceInstanceRelationAvgIndicator extends LongAvgIndicator implem
|
|||
public Indicator toMonth() {
|
||||
ServiceInstanceRelationAvgIndicator indicator = new ServiceInstanceRelationAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setSourceServiceId(this.getSourceServiceId());
|
||||
indicator.setDestServiceId(this.getDestServiceId());
|
||||
indicator.setSourceServiceInstanceId(this.getSourceServiceInstanceId());
|
||||
indicator.setDestServiceInstanceId(this.getDestServiceInstanceId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
indicator.setValue(this.getValue());
|
||||
|
|
@ -167,10 +164,9 @@ public class ServiceInstanceRelationAvgIndicator extends LongAvgIndicator implem
|
|||
|
||||
@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("dest_service_id", storageData.getDestServiceId());
|
||||
map.put("source_service_instance_id", storageData.getSourceServiceInstanceId());
|
||||
map.put("dest_service_instance_id", storageData.getDestServiceInstanceId());
|
||||
map.put("destServiceId", storageData.getDestServiceId());
|
||||
map.put("summation", storageData.getSummation());
|
||||
map.put("count", storageData.getCount());
|
||||
map.put("value", storageData.getValue());
|
||||
|
|
@ -180,10 +176,9 @@ public class ServiceInstanceRelationAvgIndicator extends LongAvgIndicator implem
|
|||
|
||||
@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("dest_service_id")).intValue());
|
||||
indicator.setSourceServiceInstanceId(((Number)dbMap.get("source_service_instance_id")).intValue());
|
||||
indicator.setDestServiceInstanceId(((Number)dbMap.get("dest_service_instance_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());
|
||||
|
|
|
|||
|
|
@ -38,10 +38,9 @@ public class ServiceInstanceRelationDispatcher implements SourceDispatcher<Servi
|
|||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.setSourceServiceId(source.getSourceServiceId());
|
||||
indicator.setDestServiceId(source.getDestServiceId());
|
||||
indicator.setSourceServiceInstanceId(source.getSourceServiceInstanceId());
|
||||
indicator.setDestServiceInstanceId(source.getDestServiceInstanceId());
|
||||
indicator.combine(source.getLatency(), 1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,24 +41,28 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "servicerelation_avg", builder = ServiceRelationAvgIndicator.Builder.class)
|
||||
public class ServiceRelationAvgIndicator extends LongAvgIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private int sourceServiceId;
|
||||
@Setter @Getter @Column(columnName = "dest_service_id") @IDColumn private int destServiceId;
|
||||
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private String entityId;
|
||||
|
||||
@Override public String id() {
|
||||
String splitJointId = String.valueOf(getTimeBucket());
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(sourceServiceId);
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(destServiceId);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + sourceServiceId;
|
||||
result = 31 * result + destServiceId;
|
||||
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;
|
||||
|
|
@ -68,9 +72,7 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
|
|||
return false;
|
||||
|
||||
ServiceRelationAvgIndicator indicator = (ServiceRelationAvgIndicator)obj;
|
||||
if (sourceServiceId != indicator.sourceServiceId)
|
||||
return false;
|
||||
if (destServiceId != indicator.destServiceId)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -81,43 +83,40 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
|
|||
|
||||
@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());
|
||||
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));
|
||||
|
||||
|
||||
setSourceServiceId(remoteData.getDataIntegers(0));
|
||||
setDestServiceId(remoteData.getDataIntegers(1));
|
||||
setCount(remoteData.getDataIntegers(2));
|
||||
setCount(remoteData.getDataIntegers(0));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("ServiceRelation_Avg", Scope.ServiceRelation, sourceServiceId, destServiceId);
|
||||
return new AlarmMeta("ServiceRelation_Avg", Scope.ServiceRelation, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
ServiceRelationAvgIndicator indicator = new ServiceRelationAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setSourceServiceId(this.getSourceServiceId());
|
||||
indicator.setDestServiceId(this.getDestServiceId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
indicator.setValue(this.getValue());
|
||||
|
|
@ -129,8 +128,7 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
|
|||
public Indicator toDay() {
|
||||
ServiceRelationAvgIndicator indicator = new ServiceRelationAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setSourceServiceId(this.getSourceServiceId());
|
||||
indicator.setDestServiceId(this.getDestServiceId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
indicator.setValue(this.getValue());
|
||||
|
|
@ -142,8 +140,7 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
|
|||
public Indicator toMonth() {
|
||||
ServiceRelationAvgIndicator indicator = new ServiceRelationAvgIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setSourceServiceId(this.getSourceServiceId());
|
||||
indicator.setDestServiceId(this.getDestServiceId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setSummation(this.getSummation());
|
||||
indicator.setCount(this.getCount());
|
||||
indicator.setValue(this.getValue());
|
||||
|
|
@ -155,8 +152,7 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
|
|||
|
||||
@Override public Map<String, Object> data2Map(ServiceRelationAvgIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("source_service_id", storageData.getSourceServiceId());
|
||||
map.put("dest_service_id", storageData.getDestServiceId());
|
||||
map.put("source_service_id", storageData.getEntityId());
|
||||
map.put("summation", storageData.getSummation());
|
||||
map.put("count", storageData.getCount());
|
||||
map.put("value", storageData.getValue());
|
||||
|
|
@ -166,8 +162,7 @@ public class ServiceRelationAvgIndicator extends LongAvgIndicator implements Ala
|
|||
|
||||
@Override public ServiceRelationAvgIndicator map2Data(Map<String, Object> dbMap) {
|
||||
ServiceRelationAvgIndicator indicator = new ServiceRelationAvgIndicator();
|
||||
indicator.setSourceServiceId(((Number)dbMap.get("source_service_id")).intValue());
|
||||
indicator.setDestServiceId(((Number)dbMap.get("dest_service_id")).intValue());
|
||||
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());
|
||||
|
|
|
|||
|
|
@ -41,24 +41,28 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "service_relation_client_calls_sum", builder = ServiceRelationClientCallsSumIndicator.Builder.class)
|
||||
public class ServiceRelationClientCallsSumIndicator extends SumIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private int sourceServiceId;
|
||||
@Setter @Getter @Column(columnName = "dest_service_id") @IDColumn private int destServiceId;
|
||||
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private String entityId;
|
||||
|
||||
@Override public String id() {
|
||||
String splitJointId = String.valueOf(getTimeBucket());
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(sourceServiceId);
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(destServiceId);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + sourceServiceId;
|
||||
result = 31 * result + destServiceId;
|
||||
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;
|
||||
|
|
@ -68,9 +72,7 @@ public class ServiceRelationClientCallsSumIndicator extends SumIndicator impleme
|
|||
return false;
|
||||
|
||||
ServiceRelationClientCallsSumIndicator indicator = (ServiceRelationClientCallsSumIndicator)obj;
|
||||
if (sourceServiceId != indicator.sourceServiceId)
|
||||
return false;
|
||||
if (destServiceId != indicator.destServiceId)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -81,39 +83,36 @@ public class ServiceRelationClientCallsSumIndicator extends SumIndicator impleme
|
|||
|
||||
@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, getSourceServiceId());
|
||||
remoteBuilder.setDataIntegers(1, getDestServiceId());
|
||||
|
||||
return remoteBuilder;
|
||||
}
|
||||
|
||||
@Override public void deserialize(RemoteData remoteData) {
|
||||
setEntityId(remoteData.getDataStrings(0));
|
||||
|
||||
setValue(remoteData.getDataLongs(0));
|
||||
setTimeBucket(remoteData.getDataLongs(1));
|
||||
|
||||
|
||||
setSourceServiceId(remoteData.getDataIntegers(0));
|
||||
setDestServiceId(remoteData.getDataIntegers(1));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("Service_Relation_Client_Calls_Sum", Scope.ServiceRelation, sourceServiceId, destServiceId);
|
||||
return new AlarmMeta("Service_Relation_Client_Calls_Sum", Scope.ServiceRelation, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
ServiceRelationClientCallsSumIndicator indicator = new ServiceRelationClientCallsSumIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setSourceServiceId(this.getSourceServiceId());
|
||||
indicator.setDestServiceId(this.getDestServiceId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setValue(this.getValue());
|
||||
indicator.setTimeBucket(this.getTimeBucket());
|
||||
return indicator;
|
||||
|
|
@ -123,8 +122,7 @@ public class ServiceRelationClientCallsSumIndicator extends SumIndicator impleme
|
|||
public Indicator toDay() {
|
||||
ServiceRelationClientCallsSumIndicator indicator = new ServiceRelationClientCallsSumIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setSourceServiceId(this.getSourceServiceId());
|
||||
indicator.setDestServiceId(this.getDestServiceId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setValue(this.getValue());
|
||||
indicator.setTimeBucket(this.getTimeBucket());
|
||||
return indicator;
|
||||
|
|
@ -134,8 +132,7 @@ public class ServiceRelationClientCallsSumIndicator extends SumIndicator impleme
|
|||
public Indicator toMonth() {
|
||||
ServiceRelationClientCallsSumIndicator indicator = new ServiceRelationClientCallsSumIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setSourceServiceId(this.getSourceServiceId());
|
||||
indicator.setDestServiceId(this.getDestServiceId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setValue(this.getValue());
|
||||
indicator.setTimeBucket(this.getTimeBucket());
|
||||
return indicator;
|
||||
|
|
@ -145,8 +142,7 @@ public class ServiceRelationClientCallsSumIndicator extends SumIndicator impleme
|
|||
|
||||
@Override public Map<String, Object> data2Map(ServiceRelationClientCallsSumIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("source_service_id", storageData.getSourceServiceId());
|
||||
map.put("dest_service_id", storageData.getDestServiceId());
|
||||
map.put("source_service_id", storageData.getEntityId());
|
||||
map.put("value", storageData.getValue());
|
||||
map.put("time_bucket", storageData.getTimeBucket());
|
||||
return map;
|
||||
|
|
@ -154,8 +150,7 @@ public class ServiceRelationClientCallsSumIndicator extends SumIndicator impleme
|
|||
|
||||
@Override public ServiceRelationClientCallsSumIndicator map2Data(Map<String, Object> dbMap) {
|
||||
ServiceRelationClientCallsSumIndicator indicator = new ServiceRelationClientCallsSumIndicator();
|
||||
indicator.setSourceServiceId(((Number)dbMap.get("source_service_id")).intValue());
|
||||
indicator.setDestServiceId(((Number)dbMap.get("dest_service_id")).intValue());
|
||||
indicator.setEntityId((String)dbMap.get("source_service_id"));
|
||||
indicator.setValue(((Number)dbMap.get("value")).longValue());
|
||||
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
|
||||
return indicator;
|
||||
|
|
|
|||
|
|
@ -44,8 +44,7 @@ public class ServiceRelationDispatcher implements SourceDispatcher<ServiceRelati
|
|||
}
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setSourceServiceId(source.getSourceServiceId());
|
||||
indicator.setDestServiceId(source.getDestServiceId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.combine(1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
}
|
||||
|
|
@ -57,8 +56,7 @@ public class ServiceRelationDispatcher implements SourceDispatcher<ServiceRelati
|
|||
}
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setSourceServiceId(source.getSourceServiceId());
|
||||
indicator.setDestServiceId(source.getDestServiceId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.combine(1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
}
|
||||
|
|
@ -67,8 +65,7 @@ public class ServiceRelationDispatcher implements SourceDispatcher<ServiceRelati
|
|||
|
||||
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setSourceServiceId(source.getSourceServiceId());
|
||||
indicator.setDestServiceId(source.getDestServiceId());
|
||||
indicator.setEntityId(source.getEntityId());
|
||||
indicator.combine(source.getLatency(), 1);
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,24 +41,28 @@ import org.apache.skywalking.oap.server.core.source.Scope;
|
|||
@StorageEntity(name = "service_relation_server_calls_sum", builder = ServiceRelationServerCallsSumIndicator.Builder.class)
|
||||
public class ServiceRelationServerCallsSumIndicator extends SumIndicator implements AlarmSupported {
|
||||
|
||||
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private int sourceServiceId;
|
||||
@Setter @Getter @Column(columnName = "dest_service_id") @IDColumn private int destServiceId;
|
||||
@Setter @Getter @Column(columnName = "source_service_id") @IDColumn private String entityId;
|
||||
|
||||
@Override public String id() {
|
||||
String splitJointId = String.valueOf(getTimeBucket());
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(sourceServiceId);
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(destServiceId);
|
||||
splitJointId += Const.ID_SPLIT + entityId;
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + sourceServiceId;
|
||||
result = 31 * result + destServiceId;
|
||||
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;
|
||||
|
|
@ -68,9 +72,7 @@ public class ServiceRelationServerCallsSumIndicator extends SumIndicator impleme
|
|||
return false;
|
||||
|
||||
ServiceRelationServerCallsSumIndicator indicator = (ServiceRelationServerCallsSumIndicator)obj;
|
||||
if (sourceServiceId != indicator.sourceServiceId)
|
||||
return false;
|
||||
if (destServiceId != indicator.destServiceId)
|
||||
if (entityId != indicator.entityId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
|
|
@ -81,39 +83,36 @@ public class ServiceRelationServerCallsSumIndicator extends SumIndicator impleme
|
|||
|
||||
@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, getSourceServiceId());
|
||||
remoteBuilder.setDataIntegers(1, getDestServiceId());
|
||||
|
||||
return remoteBuilder;
|
||||
}
|
||||
|
||||
@Override public void deserialize(RemoteData remoteData) {
|
||||
setEntityId(remoteData.getDataStrings(0));
|
||||
|
||||
setValue(remoteData.getDataLongs(0));
|
||||
setTimeBucket(remoteData.getDataLongs(1));
|
||||
|
||||
|
||||
setSourceServiceId(remoteData.getDataIntegers(0));
|
||||
setDestServiceId(remoteData.getDataIntegers(1));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override public AlarmMeta getAlarmMeta() {
|
||||
return new AlarmMeta("Service_Relation_Server_Calls_Sum", Scope.ServiceRelation, sourceServiceId, destServiceId);
|
||||
return new AlarmMeta("Service_Relation_Server_Calls_Sum", Scope.ServiceRelation, entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Indicator toHour() {
|
||||
ServiceRelationServerCallsSumIndicator indicator = new ServiceRelationServerCallsSumIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setSourceServiceId(this.getSourceServiceId());
|
||||
indicator.setDestServiceId(this.getDestServiceId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setValue(this.getValue());
|
||||
indicator.setTimeBucket(this.getTimeBucket());
|
||||
return indicator;
|
||||
|
|
@ -123,8 +122,7 @@ public class ServiceRelationServerCallsSumIndicator extends SumIndicator impleme
|
|||
public Indicator toDay() {
|
||||
ServiceRelationServerCallsSumIndicator indicator = new ServiceRelationServerCallsSumIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setSourceServiceId(this.getSourceServiceId());
|
||||
indicator.setDestServiceId(this.getDestServiceId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setValue(this.getValue());
|
||||
indicator.setTimeBucket(this.getTimeBucket());
|
||||
return indicator;
|
||||
|
|
@ -134,8 +132,7 @@ public class ServiceRelationServerCallsSumIndicator extends SumIndicator impleme
|
|||
public Indicator toMonth() {
|
||||
ServiceRelationServerCallsSumIndicator indicator = new ServiceRelationServerCallsSumIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setSourceServiceId(this.getSourceServiceId());
|
||||
indicator.setDestServiceId(this.getDestServiceId());
|
||||
indicator.setEntityId(this.getEntityId());
|
||||
indicator.setValue(this.getValue());
|
||||
indicator.setTimeBucket(this.getTimeBucket());
|
||||
return indicator;
|
||||
|
|
@ -145,8 +142,7 @@ public class ServiceRelationServerCallsSumIndicator extends SumIndicator impleme
|
|||
|
||||
@Override public Map<String, Object> data2Map(ServiceRelationServerCallsSumIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("source_service_id", storageData.getSourceServiceId());
|
||||
map.put("dest_service_id", storageData.getDestServiceId());
|
||||
map.put("source_service_id", storageData.getEntityId());
|
||||
map.put("value", storageData.getValue());
|
||||
map.put("time_bucket", storageData.getTimeBucket());
|
||||
return map;
|
||||
|
|
@ -154,8 +150,7 @@ public class ServiceRelationServerCallsSumIndicator extends SumIndicator impleme
|
|||
|
||||
@Override public ServiceRelationServerCallsSumIndicator map2Data(Map<String, Object> dbMap) {
|
||||
ServiceRelationServerCallsSumIndicator indicator = new ServiceRelationServerCallsSumIndicator();
|
||||
indicator.setSourceServiceId(((Number)dbMap.get("source_service_id")).intValue());
|
||||
indicator.setDestServiceId(((Number)dbMap.get("dest_service_id")).intValue());
|
||||
indicator.setEntityId((String)dbMap.get("source_service_id"));
|
||||
indicator.setValue(((Number)dbMap.get("value")).longValue());
|
||||
indicator.setTimeBucket(((Number)dbMap.get("time_bucket")).longValue());
|
||||
return indicator;
|
||||
|
|
|
|||
|
|
@ -129,6 +129,13 @@ public class ServiceComponentIndicator extends Indicator {
|
|||
@Override public final void combine(Indicator indicator) {
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + serviceId;
|
||||
result = 31 * result + componentId;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<ServiceComponentIndicator> {
|
||||
|
||||
@Override public Map<String, Object> data2Map(ServiceComponentIndicator storageData) {
|
||||
|
|
|
|||
|
|
@ -132,6 +132,13 @@ public class ServiceMappingIndicator extends Indicator {
|
|||
@Override public final void combine(Indicator indicator) {
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + serviceId;
|
||||
result = 31 * result + mappingServiceId;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<ServiceMappingIndicator> {
|
||||
|
||||
@Override public Map<String, Object> data2Map(ServiceMappingIndicator storageData) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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.manual.servicerelation;
|
||||
|
||||
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.ServiceRelation;
|
||||
|
||||
/**
|
||||
* @author wusheng
|
||||
*/
|
||||
public class ServiceCallRelationDispatcher implements SourceDispatcher<ServiceRelation> {
|
||||
@Override
|
||||
public void dispatch(ServiceRelation source) {
|
||||
doDispatch(source);
|
||||
}
|
||||
|
||||
public void doDispatch(ServiceRelation source) {
|
||||
ServiceCallRelationIndicator indicator = new ServiceCallRelationIndicator();
|
||||
indicator.setTimeBucket(source.getTimeBucket());
|
||||
indicator.setSourceServiceId(source.getSourceServiceId());
|
||||
indicator.setDestServiceId(source.getDestServiceId());
|
||||
IndicatorProcess.INSTANCE.in(indicator);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* 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.manual.servicerelation;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.Indicator;
|
||||
import org.apache.skywalking.oap.server.core.analysis.indicator.annotation.IndicatorType;
|
||||
import org.apache.skywalking.oap.server.core.remote.annotation.StreamData;
|
||||
import org.apache.skywalking.oap.server.core.remote.grpc.proto.RemoteData;
|
||||
import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
|
||||
import org.apache.skywalking.oap.server.core.storage.annotation.Column;
|
||||
import org.apache.skywalking.oap.server.core.storage.annotation.IDColumn;
|
||||
import org.apache.skywalking.oap.server.core.storage.annotation.StorageEntity;
|
||||
|
||||
@IndicatorType
|
||||
@StreamData
|
||||
@StorageEntity(name = ServiceCallRelationIndicator.INDEX_NAME, builder = ServiceCallRelationIndicator.Builder.class)
|
||||
public class ServiceCallRelationIndicator extends Indicator {
|
||||
|
||||
public static final String INDEX_NAME = "service_call_relation";
|
||||
public static final String SOURCE_SERVICE_ID = "source_service_id";
|
||||
public static final String DEST_SERVICE_ID = "dest_service_id";
|
||||
|
||||
@Setter @Getter @Column(columnName = SOURCE_SERVICE_ID) @IDColumn private int sourceServiceId;
|
||||
@Setter @Getter @Column(columnName = DEST_SERVICE_ID) @IDColumn private int destServiceId;
|
||||
|
||||
@Override public String id() {
|
||||
String splitJointId = String.valueOf(getTimeBucket());
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(sourceServiceId);
|
||||
splitJointId += Const.ID_SPLIT + String.valueOf(destServiceId);
|
||||
return splitJointId;
|
||||
}
|
||||
|
||||
@Override public void combine(Indicator indicator) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void calculate() {
|
||||
|
||||
}
|
||||
|
||||
@Override public Indicator toHour() {
|
||||
ServiceCallRelationIndicator indicator = new ServiceCallRelationIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInHour());
|
||||
indicator.setSourceServiceId(getSourceServiceId());
|
||||
indicator.setDestServiceId(getDestServiceId());
|
||||
return indicator;
|
||||
}
|
||||
|
||||
@Override public Indicator toDay() {
|
||||
ServiceCallRelationIndicator indicator = new ServiceCallRelationIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInDay());
|
||||
indicator.setSourceServiceId(getSourceServiceId());
|
||||
indicator.setDestServiceId(getDestServiceId());
|
||||
return indicator;
|
||||
}
|
||||
|
||||
@Override public Indicator toMonth() {
|
||||
ServiceCallRelationIndicator indicator = new ServiceCallRelationIndicator();
|
||||
indicator.setTimeBucket(toTimeBucketInMonth());
|
||||
indicator.setSourceServiceId(getSourceServiceId());
|
||||
indicator.setDestServiceId(getDestServiceId());
|
||||
return indicator;
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + sourceServiceId;
|
||||
result = 31 * result + destServiceId;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override public void deserialize(RemoteData remoteData) {
|
||||
setSourceServiceId(remoteData.getDataIntegers(0));
|
||||
setDestServiceId(remoteData.getDataIntegers(1));
|
||||
setTimeBucket(remoteData.getDataLongs(0));
|
||||
}
|
||||
|
||||
@Override public RemoteData.Builder serialize() {
|
||||
RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
|
||||
|
||||
remoteBuilder.setDataIntegers(0, getSourceServiceId());
|
||||
remoteBuilder.setDataIntegers(1, getDestServiceId());
|
||||
remoteBuilder.setDataLongs(0, getTimeBucket());
|
||||
|
||||
return remoteBuilder;
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + sourceServiceId;
|
||||
result = 31 * result + destServiceId;
|
||||
result = 31 * result + (int)getTimeBucket();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
|
||||
ServiceCallRelationIndicator indicator = (ServiceCallRelationIndicator)obj;
|
||||
if (sourceServiceId != indicator.sourceServiceId)
|
||||
return false;
|
||||
if (destServiceId != indicator.destServiceId)
|
||||
return false;
|
||||
|
||||
if (getTimeBucket() != indicator.getTimeBucket())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<ServiceCallRelationIndicator> {
|
||||
|
||||
@Override public ServiceCallRelationIndicator map2Data(Map<String, Object> dbMap) {
|
||||
ServiceCallRelationIndicator indicator = new ServiceCallRelationIndicator();
|
||||
indicator.setSourceServiceId(((Number)dbMap.get(SOURCE_SERVICE_ID)).intValue());
|
||||
indicator.setDestServiceId(((Number)dbMap.get(DEST_SERVICE_ID)).intValue());
|
||||
indicator.setTimeBucket(((Number)dbMap.get(TIME_BUCKET)).longValue());
|
||||
return indicator;
|
||||
}
|
||||
|
||||
@Override public Map<String, Object> data2Map(ServiceCallRelationIndicator storageData) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put(SOURCE_SERVICE_ID, storageData.getSourceServiceId());
|
||||
map.put(DEST_SERVICE_ID, storageData.getDestServiceId());
|
||||
map.put(TIME_BUCKET, storageData.getTimeBucket());
|
||||
return map;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -102,6 +102,10 @@ public class EndpointInventory extends RegisterSource {
|
|||
setName(remoteData.getDataStrings(0));
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<EndpointInventory> {
|
||||
|
||||
@Override public EndpointInventory map2Data(Map<String, Object> dbMap) {
|
||||
|
|
|
|||
|
|
@ -91,6 +91,10 @@ public class NetworkAddressInventory extends RegisterSource {
|
|||
setName(remoteData.getDataStrings(0));
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<NetworkAddressInventory> {
|
||||
|
||||
@Override public NetworkAddressInventory map2Data(Map<String, Object> dbMap) {
|
||||
|
|
|
|||
|
|
@ -139,6 +139,10 @@ public class ServiceInstanceInventory extends RegisterSource {
|
|||
setIpv4s(remoteData.getDataStrings(3));
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<ServiceInstanceInventory> {
|
||||
|
||||
@Override public ServiceInstanceInventory map2Data(Map<String, Object> dbMap) {
|
||||
|
|
|
|||
|
|
@ -114,6 +114,10 @@ public class ServiceInventory extends RegisterSource {
|
|||
setName(remoteData.getDataStrings(0));
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static class Builder implements StorageBuilder<ServiceInventory> {
|
||||
|
||||
@Override public ServiceInventory map2Data(Map<String, Object> dbMap) {
|
||||
|
|
|
|||
|
|
@ -35,4 +35,6 @@ public abstract class StreamData implements QueueData, Serializable, Deserializa
|
|||
@Override public final void setEndOfBatchContext(EndOfBatchContext context) {
|
||||
this.endOfBatchContext = context;
|
||||
}
|
||||
|
||||
public abstract int remoteHashCode();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class HashCodeSelector implements RemoteClientSelector {
|
|||
|
||||
@Override public RemoteClient select(List<RemoteClient> clients, StreamData streamData) {
|
||||
int size = clients.size();
|
||||
int selectIndex = Math.abs(streamData.hashCode()) % size;
|
||||
int selectIndex = Math.abs(streamData.remoteHashCode()) % size;
|
||||
return clients.get(selectIndex);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@ public class All extends Source {
|
|||
return Scope.All;
|
||||
}
|
||||
|
||||
|
||||
@Override public String getEntityId() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Getter @Setter private String name;
|
||||
@Getter @Setter private String serviceInstanceName;
|
||||
@Getter @Setter private String endpointName;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ public class Endpoint extends Source {
|
|||
return Scope.Endpoint;
|
||||
}
|
||||
|
||||
@Override public String getEntityId() {
|
||||
return String.valueOf(id);
|
||||
}
|
||||
|
||||
@Getter @Setter private int id;
|
||||
@Getter @Setter private String name;
|
||||
@Getter @Setter private int serviceId;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package org.apache.skywalking.oap.server.core.source;
|
||||
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
|
|
@ -29,6 +30,10 @@ public class EndpointRelation extends Source {
|
|||
return Scope.EndpointRelation;
|
||||
}
|
||||
|
||||
@Override public String getEntityId() {
|
||||
return String.valueOf(endpointId) + Const.ID_SPLIT + String.valueOf(childEndpointId);
|
||||
}
|
||||
|
||||
@Getter @Setter private int endpointId;
|
||||
@Getter @Setter private String endpoint;
|
||||
@Getter @Setter private int serviceId;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ public class Service extends Source {
|
|||
return Scope.Service;
|
||||
}
|
||||
|
||||
@Override public String getEntityId() {
|
||||
return String.valueOf(id);
|
||||
}
|
||||
|
||||
@Getter @Setter private int id;
|
||||
@Getter @Setter private String name;
|
||||
@Getter @Setter private String serviceInstanceName;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package org.apache.skywalking.oap.server.core.source;
|
||||
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.UnexpectedException;
|
||||
import org.apache.skywalking.oap.server.core.source.annotation.SourceType;
|
||||
|
||||
/**
|
||||
|
|
@ -31,6 +32,12 @@ public class ServiceComponent extends Source {
|
|||
return Scope.ServiceComponent;
|
||||
}
|
||||
|
||||
|
||||
@Override public String getEntityId() {
|
||||
throw new UnexpectedException("ServiceMapping doesn't support getEntityId");
|
||||
}
|
||||
|
||||
|
||||
@Getter @Setter private int serviceId;
|
||||
@Getter @Setter private int componentId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ public class ServiceInstance extends Source {
|
|||
return Scope.ServiceInstance;
|
||||
}
|
||||
|
||||
@Override public String getEntityId() {
|
||||
return String.valueOf(id);
|
||||
}
|
||||
|
||||
@Getter @Setter private int id;
|
||||
@Getter @Setter private int serviceId;
|
||||
@Getter @Setter private String name;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ public class ServiceInstanceJVMCPU extends Source {
|
|||
return Scope.ServiceInstanceJVMCPU;
|
||||
}
|
||||
|
||||
@Override public String getEntityId() {
|
||||
return String.valueOf(id);
|
||||
}
|
||||
|
||||
@Getter @Setter private int id;
|
||||
@Getter @Setter private String name;
|
||||
@Getter @Setter private String serviceName;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ public class ServiceInstanceJVMGC extends Source {
|
|||
return Scope.ServiceInstanceJVMGC;
|
||||
}
|
||||
|
||||
@Override public String getEntityId() {
|
||||
return String.valueOf(id);
|
||||
}
|
||||
|
||||
@Getter @Setter private int id;
|
||||
@Getter @Setter private String name;
|
||||
@Getter @Setter private String serviceName;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,10 @@ public class ServiceInstanceJVMMemory extends Source {
|
|||
return Scope.ServiceInstanceJVMMemory;
|
||||
}
|
||||
|
||||
@Override public String getEntityId() {
|
||||
return String.valueOf(id);
|
||||
}
|
||||
|
||||
@Getter @Setter private int id;
|
||||
@Getter @Setter private String name;
|
||||
@Getter @Setter private String serviceName;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,10 @@ public class ServiceInstanceJVMMemoryPool extends Source {
|
|||
return Scope.ServiceInstanceJVMMemoryPool;
|
||||
}
|
||||
|
||||
@Override public String getEntityId() {
|
||||
return String.valueOf(id);
|
||||
}
|
||||
|
||||
@Getter @Setter private int id;
|
||||
@Getter @Setter private String name;
|
||||
@Getter @Setter private String serviceName;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package org.apache.skywalking.oap.server.core.source;
|
||||
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
|
|
@ -29,6 +30,10 @@ public class ServiceInstanceRelation extends Source {
|
|||
return Scope.ServiceInstanceRelation;
|
||||
}
|
||||
|
||||
@Override public String getEntityId() {
|
||||
return String.valueOf(sourceServiceInstanceId) + Const.ID_SPLIT + String.valueOf(destServiceInstanceId);
|
||||
}
|
||||
|
||||
@Getter @Setter private int sourceServiceInstanceId;
|
||||
@Getter @Setter private int sourceServiceId;
|
||||
@Getter @Setter private String sourceServiceName;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package org.apache.skywalking.oap.server.core.source;
|
||||
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.UnexpectedException;
|
||||
import org.apache.skywalking.oap.server.core.source.annotation.SourceType;
|
||||
|
||||
/**
|
||||
|
|
@ -31,6 +32,11 @@ public class ServiceMapping extends Source {
|
|||
return Scope.ServiceMapping;
|
||||
}
|
||||
|
||||
|
||||
@Override public String getEntityId() {
|
||||
throw new UnexpectedException("ServiceMapping doesn't support getEntityId");
|
||||
}
|
||||
|
||||
@Getter @Setter private int serviceId;
|
||||
@Getter @Setter private int mappingServiceId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package org.apache.skywalking.oap.server.core.source;
|
||||
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
|
|
@ -29,6 +30,10 @@ public class ServiceRelation extends Source {
|
|||
return Scope.ServiceRelation;
|
||||
}
|
||||
|
||||
@Override public String getEntityId() {
|
||||
return String.valueOf(sourceServiceId) + Const.ID_SPLIT + String.valueOf(destServiceId);
|
||||
}
|
||||
|
||||
@Getter @Setter private int sourceServiceId;
|
||||
@Getter @Setter private String sourceServiceName;
|
||||
@Getter @Setter private String sourceServiceInstanceName;
|
||||
|
|
|
|||
|
|
@ -27,4 +27,6 @@ public abstract class Source {
|
|||
public abstract Scope scope();
|
||||
|
||||
@Getter @Setter private long timeBucket;
|
||||
|
||||
public abstract String getEntityId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,6 @@ public class SourceReceiverImpl implements SourceReceiver {
|
|||
}
|
||||
|
||||
@Override public void receive(Source source) {
|
||||
dispatcherManager.getDispatcher(source.scope()).dispatch(source);
|
||||
dispatcherManager.forward(source);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,5 +113,9 @@ public class IndicatorTest {
|
|||
@Override public RemoteData.Builder serialize() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,5 +77,9 @@ public class LongAvgIndicatorTest {
|
|||
@Override public RemoteData.Builder serialize() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,5 +92,9 @@ public class PercentIndicatorTest {
|
|||
@Override public RemoteData.Builder serialize() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,5 +122,9 @@ public class PxxIndicatorTest {
|
|||
@Override public RemoteData.Builder serialize() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,5 +81,9 @@ public class SumIndicatorTest {
|
|||
@Override public RemoteData.Builder serialize() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,5 +117,9 @@ public class ThermodynamicIndicatorTest {
|
|||
@Override public RemoteData.Builder serialize() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public int remoteHashCode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue