Merge branch 'master' into servicecomb

This commit is contained in:
李运涛 liyuntao 2018-02-09 03:20:24 -06:00 committed by GitHub
commit cbb2eca248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
246 changed files with 7764 additions and 4054 deletions

View File

@ -26,7 +26,6 @@ import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInsta
import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler;
import org.apache.skywalking.apm.network.proto.ApplicationInstance;
import org.apache.skywalking.apm.network.proto.ApplicationInstanceHeartbeat;
@ -55,8 +54,7 @@ public class InstanceDiscoveryServiceHandler extends InstanceDiscoveryServiceGrp
@Override
public void registerInstance(ApplicationInstance request,
StreamObserver<ApplicationInstanceMapping> responseObserver) {
long timeBucket = TimeBucketUtils.INSTANCE.getSecondTimeBucket(request.getRegisterTime());
int instanceId = instanceIDService.getOrCreateByAgentUUID(request.getApplicationId(), request.getAgentUUID(), timeBucket, buildOsInfo(request.getOsinfo()));
int instanceId = instanceIDService.getOrCreateByAgentUUID(request.getApplicationId(), request.getAgentUUID(), request.getRegisterTime(), buildOsInfo(request.getOsinfo()));
ApplicationInstanceMapping.Builder builder = ApplicationInstanceMapping.newBuilder();
builder.setApplicationId(request.getApplicationId());
builder.setApplicationInstanceId(instanceId);

View File

@ -50,9 +50,8 @@ public class NetworkAddressRegisterServiceHandler extends NetworkAddressRegister
ProtocolStringList addressesList = request.getAddressesList();
NetworkAddressMappings.Builder builder = NetworkAddressMappings.newBuilder();
for (int i = 0; i < addressesList.size(); i++) {
String networkAddress = addressesList.get(i);
int addressId = networkAddressIDService.getOrCreate(networkAddress);
for (String networkAddress : addressesList) {
int addressId = networkAddressIDService.get(networkAddress);
if (addressId != 0) {
KeyWithIntegerValue value = KeyWithIntegerValue.newBuilder().setKey(networkAddress).setValue(addressId).build();

View File

@ -63,7 +63,7 @@ public class NetworkAddressRegisterServletHandler extends JettyHandler {
for (int i = 0; i < networkAddresses.size(); i++) {
String networkAddress = networkAddresses.get(i).getAsString();
logger.debug("network address register, network address: {}", networkAddress);
int addressId = networkAddressIDService.getOrCreate(networkAddress);
int addressId = networkAddressIDService.get(networkAddress);
JsonObject mapping = new JsonObject();
mapping.addProperty(ADDRESS_ID, addressId);
mapping.addProperty(NETWORK_ADDRESS, networkAddress);

View File

@ -1,43 +1,33 @@
[
{
"gt": [
[
230150,
185809,
24040000
]
],
"gt": [[230150, 185809, 24040000]], //trace_id
"sg": {
"ts": [
230150,
185809,
24040000
],
"ai": -1,
"ii": 2,
"rs": [],
"ss": [
"ts": [230150, 185809, 24040000], //segment_id
"ai": -1, //ID
"ii": 2, //ID
"rs": [], //
"ss": [ //
{
"si": 1,
"tv": 1,
"lv": 1,
"ps": 0,
"st": 1501858094526,
"et": 1501858097004,
"ci": 3,
"cn": "",
"oi": 0,
"on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()",
"pi": 0,
"pn": "172.25.0.4:20880",
"ie": false,
"to": [
"si": 1, //
"tv": 1, //
"lv": 2, //RPCFrameworkDatabaseHttp
"ps": 0, //
"st": 1501858094526, //
"et": 1501858097004, //
"ci": 3, //TomcatMysqlDubbo...
"cn": "", //
"oi": 0, //ID
"on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()", //
"pi": 0, //ID
"pn": "172.25.0.4:20880", //
"ie": false, //Exception
"to": [ //TAGSQL
{
"k": "url",
"v": "rest://172.25.0.4:20880/org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"
}
],
"lo": []
"lo": [] //,使kv
},
{
"si": 0,

View File

@ -1,18 +1,8 @@
[
{
"gt": [
[
230150,
185809,
24040000
]
],
"gt": [[230150, 185809, 24040000]], //trace_id
"sg": {
"ts": [
137150,
185809,
48780000
],
"ts": [137150, 185809, 48780000], //segment_id
"ai": 2,
"ii": 3,
"ss": [
@ -32,21 +22,17 @@
"ie": false,
"rs": [
{
"pts": [
230150,
185809,
24040000
],
"pii": 2,
"psp": 0,
"psi": 0,
"psn": "/dubbox-case/case/dubbox-rest",
"ni": 0,
"nn": "172.25.0.4:20880",
"eii": 2,
"esi": 0,
"esn": "/dubbox-case/case/dubbox-rest",
"rn": 0
"pts": [230150, 185809, 24040000], //segment_id
"pii": 2, //
"psp": 1, //span_id
"psi": 0, //(org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()ID)
"psn": "/dubbox-case/case/dubbox-rest", //
"ni": 0, //使ID
"nn": "172.25.0.4:20880", //
"eii": 2, //
"esi": 0, //
"esn": "/dubbox-case/case/dubbox-rest", //
"rn": 0 //CrossProcessCrossThread
}
],
"to": [
@ -60,6 +46,23 @@
}
],
"lo": []
},
{
"si": 1,
"tv": 1,
"lv": 1,
"ps": 0,
"st": 1501858094726,
"et": 1501858095804,
"ci": 9,
"cn": "",
"oi": 0,
"on": "mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]",
"pi": 0,
"pn": "localhost:27017",
"ie": false,
"to": [],
"lo": []
}
]
}

View File

@ -3,7 +3,12 @@
"au": "dubbox-consumer",
"rt": 1501858094526,
"oi": {
"any_name": "any_value",
"any_name1": "any_value1"
"osName": "MacOS XX",
"hostName": "pengys",
"processId": "1001",
"ipv4s": [
"10.0.0.3",
"10.0.0.4"
]
}
}

View File

@ -3,7 +3,12 @@
"au": "dubbox-provider",
"rt": 1501858094526,
"oi": {
"any_name": "any_value",
"any_name1": "any_value1"
"osName": "MacOS X",
"hostName": "peng-yongsheng",
"processId": "1000",
"ipv4s": [
"10.0.0.1",
"10.0.0.2"
]
}
}

View File

@ -18,7 +18,7 @@
package org.apache.skywalking.apm.collector.analysis.alarm.provider.worker;
import org.apache.skywalking.apm.collector.analysis.metric.define.MetricSource;
import org.apache.skywalking.apm.collector.storage.table.MetricSource;
import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorker;
import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException;
import org.apache.skywalking.apm.collector.core.data.StreamData;

View File

@ -47,7 +47,7 @@ public class MemoryMetricService implements IMemoryMetricService {
@Override
public void send(int instanceId, long timeBucket, boolean isHeap, long init, long max, long used, long committed) {
String metricId = instanceId + Const.ID_SPLIT + String.valueOf(isHeap);
String metricId = instanceId + Const.ID_SPLIT + BooleanUtils.booleanToValue(isHeap);
String id = timeBucket + Const.ID_SPLIT + metricId;
MemoryMetric memoryMetric = new MemoryMetric();

View File

@ -32,8 +32,9 @@ public class MetricGraphIdDefine {
public static final int APPLICATION_COMPONENT_GRAPH_ID = 406;
public static final int APPLICATION_MAPPING_GRAPH_ID = 407;
public static final int SERVICE_MAPPING_GRAPH_ID = 408;
public static final int GLOBAL_TRACE_GRAPH_ID = 409;
public static final int SEGMENT_COST_GRAPH_ID = 410;
public static final int SEGMENT_DURATION_GRAPH_ID = 410;
public static final int INSTANCE_MAPPING_GRAPH_ID = 411;
public static final int INSTANCE_HEART_BEAT_PERSISTENCE_GRAPH_ID = 412;

View File

@ -22,35 +22,45 @@ package org.apache.skywalking.apm.collector.analysis.metric.define.graph;
* @author peng-yongsheng
*/
public class MetricWorkerIdDefine {
public static final int SERVICE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4100;
public static final int SERVICE_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4101;
public static final int SERVICE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4102;
public static final int SERVICE_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4103;
public static final int SERVICE_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4104;
public static final int SERVICE_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4105;
public static final int SERVICE_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4106;
public static final int SERVICE_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4107;
public static final int SERVICE_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4108;
public static final int SERVICE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4010;
public static final int SERVICE_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4011;
public static final int SERVICE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4012;
public static final int SERVICE_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4013;
public static final int SERVICE_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4014;
public static final int SERVICE_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4015;
public static final int SERVICE_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4016;
public static final int SERVICE_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4017;
public static final int SERVICE_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4018;
public static final int INSTANCE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4200;
public static final int INSTANCE_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4201;
public static final int INSTANCE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4202;
public static final int INSTANCE_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4203;
public static final int INSTANCE_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4204;
public static final int INSTANCE_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4205;
public static final int INSTANCE_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4206;
public static final int INSTANCE_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4207;
public static final int INSTANCE_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4208;
public static final int INSTANCE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4020;
public static final int INSTANCE_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4021;
public static final int INSTANCE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4022;
public static final int INSTANCE_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4023;
public static final int INSTANCE_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4024;
public static final int INSTANCE_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4025;
public static final int INSTANCE_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4026;
public static final int INSTANCE_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4027;
public static final int INSTANCE_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4028;
public static final int APPLICATION_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4300;
public static final int APPLICATION_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4301;
public static final int APPLICATION_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4302;
public static final int APPLICATION_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4303;
public static final int APPLICATION_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4304;
public static final int APPLICATION_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4305;
public static final int APPLICATION_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4306;
public static final int APPLICATION_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4307;
public static final int APPLICATION_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4308;
public static final int APPLICATION_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4030;
public static final int APPLICATION_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4031;
public static final int APPLICATION_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4032;
public static final int APPLICATION_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4033;
public static final int APPLICATION_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4034;
public static final int APPLICATION_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4035;
public static final int APPLICATION_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4036;
public static final int APPLICATION_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4037;
public static final int APPLICATION_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4038;
public static final int SERVICE_MAPPING_MINUTE_AGGREGATION_WORKER_ID = 4040;
public static final int SERVICE_MAPPING_MINUTE_REMOTE_WORKER_ID = 4041;
public static final int SERVICE_MAPPING_MINUTE_PERSISTENCE_WORKER_ID = 4042;
public static final int SERVICE_MAPPING_HOUR_PERSISTENCE_WORKER_ID = 4043;
public static final int SERVICE_MAPPING_HOUR_TRANSFORM_NODE_ID = 4044;
public static final int SERVICE_MAPPING_DAY_PERSISTENCE_WORKER_ID = 4045;
public static final int SERVICE_MAPPING_DAY_TRANSFORM_NODE_ID = 4046;
public static final int SERVICE_MAPPING_MONTH_PERSISTENCE_WORKER_ID = 4047;
public static final int SERVICE_MAPPING_MONTH_TRANSFORM_NODE_ID = 4048;
public static final int SERVICE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4400;
public static final int SERVICE_MINUTE_METRIC_REMOTE_WORKER_ID = 4401;
@ -113,7 +123,7 @@ public class MetricWorkerIdDefine {
public static final int APPLICATION_COMPONENT_MONTH_TRANSFORM_NODE_ID = 4908;
public static final int GLOBAL_TRACE_PERSISTENCE_WORKER_ID = 427;
public static final int SEGMENT_COST_PERSISTENCE_WORKER_ID = 428;
public static final int SEGMENT_DURATION_PERSISTENCE_WORKER_ID = 428;
public static final int INSTANCE_REFERENCE_GRAPH_BRIDGE_WORKER_ID = 429;
public static final int APPLICATION_REFERENCE_GRAPH_BRIDGE_WORKER_ID = 430;

View File

@ -35,8 +35,8 @@ import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.insta
import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping.InstanceMappingSpanListener;
import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric.InstanceMetricGraph;
import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric.InstanceReferenceMetricGraph;
import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.segment.SegmentCostGraph;
import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.segment.SegmentCostSpanListener;
import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.segment.SegmentDurationGraph;
import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.segment.SegmentDurationSpanListener;
import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric.ServiceMetricGraph;
import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric.ServiceReferenceMetricGraph;
import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric.ServiceReferenceMetricSpanListener;
@ -93,7 +93,7 @@ public class AnalysisMetricModuleProvider extends ModuleProvider {
segmentParserListenerRegister.register(new ApplicationMappingSpanListener.Factory());
segmentParserListenerRegister.register(new InstanceMappingSpanListener.Factory());
segmentParserListenerRegister.register(new GlobalTraceSpanListener.Factory());
segmentParserListenerRegister.register(new SegmentCostSpanListener.Factory());
segmentParserListenerRegister.register(new SegmentDurationSpanListener.Factory());
}
private void graphCreate(WorkerCreateListener workerCreateListener) {
@ -127,8 +127,8 @@ public class AnalysisMetricModuleProvider extends ModuleProvider {
GlobalTraceGraph globalTraceGraph = new GlobalTraceGraph(getManager(), workerCreateListener);
globalTraceGraph.create();
SegmentCostGraph segmentCostGraph = new SegmentCostGraph(getManager(), workerCreateListener);
segmentCostGraph.create();
SegmentDurationGraph segmentDurationGraph = new SegmentDurationGraph(getManager(), workerCreateListener);
segmentDurationGraph.create();
InstanceHeartBeatPersistenceGraph instanceHeartBeatPersistenceGraph = new InstanceHeartBeatPersistenceGraph(getManager(), workerCreateListener);
instanceHeartBeatPersistenceGraph.create();

View File

@ -31,7 +31,7 @@ public class ApplicationComponentCopy {
newApplicationComponent.setMetricId(applicationComponent.getMetricId());
newApplicationComponent.setComponentId(applicationComponent.getComponentId());
newApplicationComponent.setPeerId(applicationComponent.getPeerId());
newApplicationComponent.setApplicationId(applicationComponent.getApplicationId());
newApplicationComponent.setTimeBucket(newApplicationComponent.getTimeBucket());
return newApplicationComponent;
}

View File

@ -27,6 +27,8 @@ import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listen
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.FirstSpanListener;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.SpanListener;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.SpanListenerFactory;
import org.apache.skywalking.apm.collector.cache.CacheModule;
import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
import org.apache.skywalking.apm.collector.core.graph.Graph;
import org.apache.skywalking.apm.collector.core.graph.GraphManager;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
@ -39,17 +41,24 @@ import org.apache.skywalking.apm.collector.storage.table.application.Application
*/
public class ApplicationComponentSpanListener implements EntrySpanListener, ExitSpanListener, FirstSpanListener {
private final ApplicationCacheService applicationCacheService;
private List<ApplicationComponent> applicationComponents = new ArrayList<>();
private long timeBucket;
ApplicationComponentSpanListener(ModuleManager moduleManager) {
this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class);
}
@Override
public void parseExit(SpanDecorator spanDecorator, int applicationId, int instanceId, String segmentId) {
String metricId = spanDecorator.getPeerId() + Const.ID_SPLIT + String.valueOf(spanDecorator.getComponentId());
int applicationIdFromPeerId = applicationCacheService.getApplicationIdByAddressId(spanDecorator.getPeerId());
String metricId = applicationIdFromPeerId + Const.ID_SPLIT + String.valueOf(spanDecorator.getComponentId());
ApplicationComponent applicationComponent = new ApplicationComponent();
applicationComponent.setMetricId(metricId);
applicationComponent.setComponentId(spanDecorator.getComponentId());
applicationComponent.setPeerId(spanDecorator.getPeerId());
applicationComponent.setApplicationId(applicationIdFromPeerId);
applicationComponents.add(applicationComponent);
}
@ -60,7 +69,7 @@ public class ApplicationComponentSpanListener implements EntrySpanListener, Exit
ApplicationComponent applicationComponent = new ApplicationComponent();
applicationComponent.setMetricId(metricId);
applicationComponent.setComponentId(spanDecorator.getComponentId());
applicationComponent.setPeerId(applicationId);
applicationComponent.setApplicationId(applicationId);
applicationComponents.add(applicationComponent);
}
@ -82,7 +91,7 @@ public class ApplicationComponentSpanListener implements EntrySpanListener, Exit
public static class Factory implements SpanListenerFactory {
@Override public SpanListener create(ModuleManager moduleManager) {
return new ApplicationComponentSpanListener();
return new ApplicationComponentSpanListener(moduleManager);
}
}
}

View File

@ -32,7 +32,7 @@ public class ApplicationMappingCopy {
newApplicationMapping.setTimeBucket(applicationMapping.getTimeBucket());
newApplicationMapping.setApplicationId(applicationMapping.getApplicationId());
newApplicationMapping.setAddressId(applicationMapping.getAddressId());
newApplicationMapping.setMappingApplicationId(applicationMapping.getMappingApplicationId());
return newApplicationMapping;
}
}

View File

@ -26,6 +26,8 @@ import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listen
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.FirstSpanListener;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.SpanListener;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.SpanListenerFactory;
import org.apache.skywalking.apm.collector.cache.CacheModule;
import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
import org.apache.skywalking.apm.collector.core.graph.Graph;
import org.apache.skywalking.apm.collector.core.graph.GraphManager;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
@ -42,18 +44,26 @@ public class ApplicationMappingSpanListener implements FirstSpanListener, EntryS
private final Logger logger = LoggerFactory.getLogger(ApplicationMappingSpanListener.class);
private final ApplicationCacheService applicationCacheService;
private List<ApplicationMapping> applicationMappings = new LinkedList<>();
private long timeBucket;
ApplicationMappingSpanListener(ModuleManager moduleManager) {
this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class);
}
@Override public void parseEntry(SpanDecorator spanDecorator, int applicationId, int instanceId, String segmentId) {
logger.debug("application mapping listener parse reference");
if (spanDecorator.getRefsCount() > 0) {
for (int i = 0; i < spanDecorator.getRefsCount(); i++) {
ApplicationMapping applicationMapping = new ApplicationMapping();
applicationMapping.setApplicationId(applicationId);
applicationMapping.setAddressId(spanDecorator.getRefs(i).getNetworkAddressId());
String metricId = String.valueOf(applicationId) + Const.ID_SPLIT + String.valueOf(applicationMapping.getAddressId());
int addressId = spanDecorator.getRefs(i).getNetworkAddressId();
int mappingApplicationId = applicationCacheService.getApplicationIdByAddressId(addressId);
applicationMapping.setMappingApplicationId(mappingApplicationId);
String metricId = String.valueOf(applicationId) + Const.ID_SPLIT + String.valueOf(applicationMapping.getMappingApplicationId());
applicationMapping.setMetricId(metricId);
applicationMappings.add(applicationMapping);
}
@ -79,7 +89,7 @@ public class ApplicationMappingSpanListener implements FirstSpanListener, EntryS
public static class Factory implements SpanListenerFactory {
@Override public SpanListener create(ModuleManager moduleManager) {
return new ApplicationMappingSpanListener();
return new ApplicationMappingSpanListener(moduleManager);
}
}
}

View File

@ -22,23 +22,23 @@ import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGr
import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
import org.apache.skywalking.apm.collector.core.graph.GraphManager;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.storage.table.segment.SegmentCost;
import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDuration;
/**
* @author peng-yongsheng
*/
public class SegmentCostGraph {
public class SegmentDurationGraph {
private final ModuleManager moduleManager;
private final WorkerCreateListener workerCreateListener;
public SegmentCostGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
public SegmentDurationGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) {
this.moduleManager = moduleManager;
this.workerCreateListener = workerCreateListener;
}
public void create() {
GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.SEGMENT_COST_GRAPH_ID, SegmentCost.class)
.addNode(new SegmentCostPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.SEGMENT_DURATION_GRAPH_ID, SegmentDuration.class)
.addNode(new SegmentDurationPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
}
}

View File

@ -24,20 +24,20 @@ import org.apache.skywalking.apm.collector.analysis.worker.model.impl.Persistenc
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.ISegmentCostPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.segment.SegmentCost;
import org.apache.skywalking.apm.collector.storage.dao.ISegmentDurationPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDuration;
/**
* @author peng-yongsheng
*/
public class SegmentCostPersistenceWorker extends PersistenceWorker<SegmentCost> {
public class SegmentDurationPersistenceWorker extends PersistenceWorker<SegmentDuration> {
public SegmentCostPersistenceWorker(ModuleManager moduleManager) {
SegmentDurationPersistenceWorker(ModuleManager moduleManager) {
super(moduleManager);
}
@Override public int id() {
return MetricWorkerIdDefine.SEGMENT_COST_PERSISTENCE_WORKER_ID;
return MetricWorkerIdDefine.SEGMENT_DURATION_PERSISTENCE_WORKER_ID;
}
@Override protected boolean needMergeDBData() {
@ -45,18 +45,18 @@ public class SegmentCostPersistenceWorker extends PersistenceWorker<SegmentCost>
}
@SuppressWarnings("unchecked")
@Override protected IPersistenceDAO<?, ?, SegmentCost> persistenceDAO() {
return getModuleManager().find(StorageModule.NAME).getService(ISegmentCostPersistenceDAO.class);
@Override protected IPersistenceDAO<?, ?, SegmentDuration> persistenceDAO() {
return getModuleManager().find(StorageModule.NAME).getService(ISegmentDurationPersistenceDAO.class);
}
public static class Factory extends PersistenceWorkerProvider<SegmentCost, SegmentCostPersistenceWorker> {
public static class Factory extends PersistenceWorkerProvider<SegmentDuration, SegmentDurationPersistenceWorker> {
public Factory(ModuleManager moduleManager) {
super(moduleManager);
}
@Override public SegmentCostPersistenceWorker workerInstance(ModuleManager moduleManager) {
return new SegmentCostPersistenceWorker(moduleManager);
@Override public SegmentDurationPersistenceWorker workerInstance(ModuleManager moduleManager) {
return new SegmentDurationPersistenceWorker(moduleManager);
}
@Override

View File

@ -35,46 +35,46 @@ import org.apache.skywalking.apm.collector.core.graph.GraphManager;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.table.segment.SegmentCost;
import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author peng-yongsheng
*/
public class SegmentCostSpanListener implements EntrySpanListener, ExitSpanListener, LocalSpanListener, FirstSpanListener {
public class SegmentDurationSpanListener implements EntrySpanListener, ExitSpanListener, LocalSpanListener, FirstSpanListener {
private final Logger logger = LoggerFactory.getLogger(SegmentCostSpanListener.class);
private final Logger logger = LoggerFactory.getLogger(SegmentDurationSpanListener.class);
private final List<SegmentCost> segmentCosts;
private final List<SegmentDuration> segmentDurations;
private final ServiceNameCacheService serviceNameCacheService;
private boolean isError = false;
private long timeBucket;
public SegmentCostSpanListener(ModuleManager moduleManager) {
this.segmentCosts = new ArrayList<>();
SegmentDurationSpanListener(ModuleManager moduleManager) {
this.segmentDurations = new ArrayList<>();
this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class);
}
@Override
public void parseFirst(SpanDecorator spanDecorator, int applicationId, int instanceId,
String segmentId) {
timeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime());
timeBucket = TimeBucketUtils.INSTANCE.getSecondTimeBucket(spanDecorator.getStartTime());
SegmentCost segmentCost = new SegmentCost();
segmentCost.setId(segmentId);
segmentCost.setSegmentId(segmentId);
segmentCost.setApplicationId(applicationId);
segmentCost.setCost(spanDecorator.getEndTime() - spanDecorator.getStartTime());
segmentCost.setStartTime(spanDecorator.getStartTime());
segmentCost.setEndTime(spanDecorator.getEndTime());
SegmentDuration segmentDuration = new SegmentDuration();
segmentDuration.setId(segmentId);
segmentDuration.setSegmentId(segmentId);
segmentDuration.setApplicationId(applicationId);
segmentDuration.setDuration(spanDecorator.getEndTime() - spanDecorator.getStartTime());
segmentDuration.setStartTime(spanDecorator.getStartTime());
segmentDuration.setEndTime(spanDecorator.getEndTime());
if (spanDecorator.getOperationNameId() == 0) {
segmentCost.setServiceName(spanDecorator.getOperationName());
segmentDuration.setServiceName(spanDecorator.getOperationName());
} else {
segmentCost.setServiceName(serviceNameCacheService.getSplitServiceName(serviceNameCacheService.get(spanDecorator.getOperationNameId())));
segmentDuration.setServiceName(serviceNameCacheService.get(spanDecorator.getOperationNameId()).getServiceName());
}
segmentCosts.add(segmentCost);
segmentDurations.add(segmentDuration);
isError = isError || spanDecorator.getIsError();
}
@ -96,18 +96,18 @@ public class SegmentCostSpanListener implements EntrySpanListener, ExitSpanListe
}
@Override public void build() {
Graph<SegmentCost> graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SEGMENT_COST_GRAPH_ID, SegmentCost.class);
Graph<SegmentDuration> graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SEGMENT_DURATION_GRAPH_ID, SegmentDuration.class);
logger.debug("segment cost listener build");
for (SegmentCost segmentCost : segmentCosts) {
segmentCost.setIsError(BooleanUtils.booleanToValue(isError));
segmentCost.setTimeBucket(timeBucket);
graph.start(segmentCost);
for (SegmentDuration segmentDuration : segmentDurations) {
segmentDuration.setIsError(BooleanUtils.booleanToValue(isError));
segmentDuration.setTimeBucket(timeBucket);
graph.start(segmentDuration);
}
}
public static class Factory implements SpanListenerFactory {
@Override public SpanListener create(ModuleManager moduleManager) {
return new SegmentCostSpanListener(moduleManager);
return new SegmentDurationSpanListener(moduleManager);
}
}
}

View File

@ -20,7 +20,7 @@ package org.apache.skywalking.apm.collector.analysis.metric.provider.worker.serv
import java.util.LinkedList;
import java.util.List;
import org.apache.skywalking.apm.collector.analysis.metric.define.MetricSource;
import org.apache.skywalking.apm.collector.storage.table.MetricSource;
import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.ReferenceDecorator;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.SpanDecorator;

View File

@ -24,5 +24,7 @@ import org.apache.skywalking.apm.collector.core.module.Service;
* @author peng-yongsheng
*/
public interface INetworkAddressIDService extends Service {
int getOrCreate(String networkAddress);
int create(String networkAddress, int spanLayer);
int get(String networkAddress);
}

View File

@ -62,6 +62,7 @@ public class NetworkAddressRegisterSerialWorker extends AbstractLocalAsyncWorker
newNetworkAddress = new NetworkAddress();
newNetworkAddress.setId("-1");
newNetworkAddress.setAddressId(-1);
newNetworkAddress.setSpanLayer(networkAddress.getSpanLayer());
newNetworkAddress.setNetworkAddress(networkAddress.getNetworkAddress());
} else {
int max = networkAddressRegisterDAO.getMaxNetworkAddressId();
@ -70,6 +71,7 @@ public class NetworkAddressRegisterSerialWorker extends AbstractLocalAsyncWorker
newNetworkAddress = new NetworkAddress();
newNetworkAddress.setId(String.valueOf(addressId));
newNetworkAddress.setAddressId(addressId);
newNetworkAddress.setSpanLayer(networkAddress.getSpanLayer());
newNetworkAddress.setNetworkAddress(networkAddress.getNetworkAddress());
}
networkAddressRegisterDAO.save(newNetworkAddress);

View File

@ -30,16 +30,12 @@ import org.apache.skywalking.apm.collector.core.graph.GraphManager;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.core.util.ObjectUtils;
import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author peng-yongsheng
*/
public class NetworkAddressIDService implements INetworkAddressIDService {
private final Logger logger = LoggerFactory.getLogger(NetworkAddressIDService.class);
private final ModuleManager moduleManager;
private NetworkAddressCacheService networkAddressCacheService;
private IApplicationIDService applicationIDService;
@ -78,7 +74,7 @@ public class NetworkAddressIDService implements INetworkAddressIDService {
return this.networkAddressGraph;
}
@Override public int getOrCreate(String networkAddress) {
@Override public int create(String networkAddress, int spanLayer) {
int addressId = getNetworkAddressCacheService().getAddressId(networkAddress);
if (addressId != 0) {
@ -95,6 +91,7 @@ public class NetworkAddressIDService implements INetworkAddressIDService {
NetworkAddress newNetworkAddress = new NetworkAddress();
newNetworkAddress.setId("0");
newNetworkAddress.setNetworkAddress(networkAddress);
newNetworkAddress.setSpanLayer(spanLayer);
newNetworkAddress.setAddressId(0);
getNetworkAddressGraph().start(newNetworkAddress);
@ -102,4 +99,8 @@ public class NetworkAddressIDService implements INetworkAddressIDService {
return 0;
}
@Override public int get(String networkAddress) {
return getNetworkAddressCacheService().getAddressId(networkAddress);
}
}

View File

@ -19,7 +19,6 @@
package org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.standardization;
import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService;
import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService;
import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.ReferenceDecorator;
@ -39,7 +38,6 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> {
private final Logger logger = LoggerFactory.getLogger(ReferenceIdExchanger.class);
private static ReferenceIdExchanger EXCHANGER;
private final IApplicationIDService applicationIDService;
private final IServiceNameService serviceNameService;
private final InstanceCacheService instanceCacheService;
private final INetworkAddressIDService networkAddressIDService;
@ -52,7 +50,6 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> {
}
private ReferenceIdExchanger(ModuleManager moduleManager) {
this.applicationIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IApplicationIDService.class);
this.serviceNameService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IServiceNameService.class);
this.networkAddressIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(INetworkAddressIDService.class);
this.instanceCacheService = moduleManager.find(CacheModule.NAME).getService(InstanceCacheService.class);
@ -92,7 +89,7 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> {
}
if (standardBuilder.getNetworkAddressId() == 0 && StringUtils.isNotEmpty(standardBuilder.getNetworkAddress())) {
int networkAddressId = networkAddressIDService.getOrCreate(standardBuilder.getNetworkAddress());
int networkAddressId = networkAddressIDService.get(standardBuilder.getNetworkAddress());
if (networkAddressId == 0) {
if (logger.isDebugEnabled()) {
logger.debug("network address: {} from application id: {} exchange failed", standardBuilder.getNetworkAddress(), applicationId);

View File

@ -53,7 +53,7 @@ public class SpanIdExchanger implements IdExchanger<SpanDecorator> {
@Override public boolean exchange(SpanDecorator standardBuilder, int applicationId) {
if (standardBuilder.getPeerId() == 0 && StringUtils.isNotEmpty(standardBuilder.getPeer())) {
int peerId = networkAddressIDService.getOrCreate(standardBuilder.getPeer());
int peerId = networkAddressIDService.create(standardBuilder.getPeer(), standardBuilder.getSpanLayer().getNumber());
if (peerId == 0) {
logger.debug("peer: {} in application: {} exchange failed", standardBuilder.getPeer(), applicationId);

View File

@ -34,18 +34,18 @@ ui:
host: localhost
port: 12800
context_path: /
#storage:
# elasticsearch:
# cluster_name: CollectorDBCluster
# cluster_transport_sniffer: true
# cluster_nodes: localhost:9300
# index_shards_number: 2
# index_replicas_number: 0
# ttl: 7
storage:
h2:
url: jdbc:h2:tcp://localhost/~/test
user_name: sa
elasticsearch:
cluster_name: CollectorDBCluster
cluster_transport_sniffer: true
cluster_nodes: localhost:9300
index_shards_number: 2
index_replicas_number: 0
ttl: 7
#storage:
# h2:
# url: jdbc:h2:tcp://localhost/~/test
# user_name: sa
configuration:
default:
application_apdex_threshold: 2000

View File

@ -19,6 +19,7 @@
package org.apache.skywalking.apm.collector.cache.service;
import org.apache.skywalking.apm.collector.core.module.Service;
import org.apache.skywalking.apm.collector.storage.table.register.Application;
/**
* @author peng-yongsheng
@ -26,7 +27,7 @@ import org.apache.skywalking.apm.collector.core.module.Service;
public interface ApplicationCacheService extends Service {
int getApplicationIdByCode(String applicationCode);
String getApplicationCodeById(int applicationId);
Application getApplicationById(int applicationId);
int getApplicationIdByAddressId(int addressId);
}

View File

@ -16,16 +16,14 @@
*
*/
package org.apache.skywalking.apm.collector.cache.service;
import org.apache.skywalking.apm.collector.core.module.Service;
import org.apache.skywalking.apm.collector.storage.table.register.ServiceName;
/**
* @author peng-yongsheng
*/
public interface ServiceNameCacheService extends Service {
String get(int serviceId);
String getSplitServiceName(String serviceName);
ServiceName get(int serviceId);
}

View File

@ -22,11 +22,10 @@ import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.core.util.ObjectUtils;
import org.apache.skywalking.apm.collector.core.util.StringUtils;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO;
import org.apache.skywalking.apm.collector.storage.table.register.Application;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -70,23 +69,23 @@ public class ApplicationCacheGuavaService implements ApplicationCacheService {
return applicationId;
}
private final Cache<Integer, String> idCache = CacheBuilder.newBuilder().maximumSize(1000).build();
private final Cache<Integer, Application> applicationCache = CacheBuilder.newBuilder().maximumSize(1000).build();
@Override public String getApplicationCodeById(int applicationId) {
String applicationCode = Const.EMPTY_STRING;
@Override public Application getApplicationById(int applicationId) {
Application application = null;
try {
applicationCode = idCache.get(applicationId, () -> getApplicationCacheDAO().getApplicationCode(applicationId));
application = applicationCache.get(applicationId, () -> getApplicationCacheDAO().getApplication(applicationId));
} catch (Throwable e) {
logger.error(e.getMessage(), e);
}
if (StringUtils.isEmpty(applicationCode)) {
applicationCode = getApplicationCacheDAO().getApplicationCode(applicationId);
if (StringUtils.isNotEmpty(applicationCode)) {
codeCache.put(applicationCode, applicationId);
if (ObjectUtils.isEmpty(application)) {
application = getApplicationCacheDAO().getApplication(applicationId);
if (ObjectUtils.isNotEmpty(application)) {
applicationCache.put(applicationId, application);
}
}
return applicationCode;
return application;
}
private final Cache<Integer, Integer> addressIdCache = CacheBuilder.newBuilder().maximumSize(1000).build();

View File

@ -16,18 +16,16 @@
*
*/
package org.apache.skywalking.apm.collector.cache.guava.service;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.core.util.ObjectUtils;
import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService;
import org.apache.skywalking.apm.collector.core.util.StringUtils;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.core.util.ObjectUtils;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO;
import org.apache.skywalking.apm.collector.storage.table.register.ServiceName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -38,7 +36,7 @@ public class ServiceNameCacheGuavaService implements ServiceNameCacheService {
private final Logger logger = LoggerFactory.getLogger(ServiceNameCacheGuavaService.class);
private final Cache<Integer, String> serviceNameCache = CacheBuilder.newBuilder().maximumSize(10000).build();
private final Cache<Integer, ServiceName> serviceCache = CacheBuilder.newBuilder().maximumSize(10000).build();
private final ModuleManager moduleManager;
private IServiceNameCacheDAO serviceNameCacheDAO;
@ -54,34 +52,21 @@ public class ServiceNameCacheGuavaService implements ServiceNameCacheService {
return this.serviceNameCacheDAO;
}
public String get(int serviceId) {
String serviceName = Const.EMPTY_STRING;
public ServiceName get(int serviceId) {
ServiceName serviceName = null;
try {
serviceName = serviceNameCache.get(serviceId, () -> getServiceNameCacheDAO().getServiceName(serviceId));
serviceName = serviceCache.get(serviceId, () -> getServiceNameCacheDAO().get(serviceId));
} catch (Throwable e) {
logger.error(e.getMessage(), e);
}
if (StringUtils.isEmpty(serviceName)) {
serviceName = getServiceNameCacheDAO().getServiceName(serviceId);
if (StringUtils.isNotEmpty(serviceName)) {
serviceNameCache.put(serviceId, serviceName);
if (ObjectUtils.isEmpty(serviceName)) {
serviceName = getServiceNameCacheDAO().get(serviceId);
if (ObjectUtils.isNotEmpty(serviceName)) {
serviceCache.put(serviceId, serviceName);
}
}
return serviceName;
}
public String getSplitServiceName(String serviceName) {
if (StringUtils.isNotEmpty(serviceName)) {
String[] serviceNames = serviceName.split(Const.ID_SPLIT, 2);
if (serviceNames.length == 2) {
return serviceNames[1];
} else {
return Const.EMPTY_STRING;
}
} else {
return Const.EMPTY_STRING;
}
}
}

View File

@ -16,7 +16,6 @@
*
*/
package org.apache.skywalking.apm.collector.server.jetty;
import com.google.gson.JsonElement;
@ -33,35 +32,47 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.skywalking.apm.collector.core.util.ObjectUtils;
import org.apache.skywalking.apm.collector.server.ServerHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author peng-yongsheng
*/
public abstract class JettyHandler extends HttpServlet implements ServerHandler {
private final Logger logger = LoggerFactory.getLogger(JettyHandler.class);
public abstract String pathSpec();
@Override
protected final void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
protected final void doGet(HttpServletRequest req, HttpServletResponse resp) {
try {
reply(resp, doGet(req));
} catch (ArgumentsParseException e) {
replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
} catch (ArgumentsParseException | IOException e) {
try {
replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
} catch (IOException replyException) {
logger.error(replyException.getMessage(), e);
}
}
}
protected abstract JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException;
@Override
protected final void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
protected final void doPost(HttpServletRequest req, HttpServletResponse resp) {
try {
reply(resp, doPost(req));
} catch (ArgumentsParseException e) {
replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
} catch (ArgumentsParseException | IOException e) {
try {
replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
} catch (IOException replyException) {
logger.error(replyException.getMessage(), e);
}
}
}
protected abstract JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException;
protected abstract JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException, IOException;
@Override
protected final void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
@ -150,7 +161,7 @@ public abstract class JettyHandler extends HttpServlet implements ServerHandler
}
private void reply(HttpServletResponse response, JsonElement resJson) throws IOException {
response.setContentType("text/json");
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
response.setStatus(HttpServletResponse.SC_OK);
@ -163,7 +174,7 @@ public abstract class JettyHandler extends HttpServlet implements ServerHandler
}
private void replyError(HttpServletResponse response, String errorMessage, int status) throws IOException {
response.setContentType("text/plain");
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
response.setStatus(status);
response.setHeader("error-message", errorMessage);

View File

@ -36,5 +36,10 @@
<artifactId>gson</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.9</version>
</dependency>
</dependencies>
</project>

View File

@ -25,20 +25,20 @@ import org.apache.skywalking.apm.collector.core.UnexpectedException;
*/
public class BooleanUtils {
public static final Integer TRUE = 1;
public static final Integer FALSE = 0;
public static final int TRUE = 1;
public static final int FALSE = 0;
public static boolean valueToBoolean(Integer value) {
if (TRUE.equals(value)) {
public static boolean valueToBoolean(int value) {
if (TRUE == value) {
return true;
} else if (FALSE.equals(value)) {
} else if (FALSE == value) {
return false;
} else {
throw new UnexpectedException("Boolean value error, must be 0 or 1");
}
}
public static Integer booleanToValue(Boolean booleanValue) {
public static int booleanToValue(Boolean booleanValue) {
if (booleanValue) {
return TRUE;
} else {

View File

@ -20,8 +20,6 @@ package org.apache.skywalking.apm.collector.core.util;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.TimeZone;
import org.apache.skywalking.apm.collector.core.UnexpectedException;
/**
* @author peng-yongsheng
@ -89,65 +87,7 @@ public enum TimeBucketUtils {
return secondBucket / 100 / 100 / 100 / 100;
}
public long changeTimeBucket2TimeStamp(String timeBucketType, long timeBucket) {
if (TimeBucketType.SECOND.name().toLowerCase().equals(timeBucketType.toLowerCase())) {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, Integer.valueOf(String.valueOf(timeBucket).substring(0, 4)));
calendar.set(Calendar.MONTH, Integer.valueOf(String.valueOf(timeBucket).substring(4, 6)) - 1);
calendar.set(Calendar.DAY_OF_MONTH, Integer.valueOf(String.valueOf(timeBucket).substring(6, 8)));
calendar.set(Calendar.HOUR_OF_DAY, Integer.valueOf(String.valueOf(timeBucket).substring(8, 10)));
calendar.set(Calendar.MINUTE, Integer.valueOf(String.valueOf(timeBucket).substring(10, 12)));
calendar.set(Calendar.SECOND, Integer.valueOf(String.valueOf(timeBucket).substring(12, 14)));
return calendar.getTimeInMillis();
} else if (TimeBucketType.MINUTE.name().toLowerCase().equals(timeBucketType.toLowerCase())) {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, Integer.valueOf(String.valueOf(timeBucket).substring(0, 4)));
calendar.set(Calendar.MONTH, Integer.valueOf(String.valueOf(timeBucket).substring(4, 6)) - 1);
calendar.set(Calendar.DAY_OF_MONTH, Integer.valueOf(String.valueOf(timeBucket).substring(6, 8)));
calendar.set(Calendar.HOUR_OF_DAY, Integer.valueOf(String.valueOf(timeBucket).substring(8, 10)));
calendar.set(Calendar.MINUTE, Integer.valueOf(String.valueOf(timeBucket).substring(10, 12)));
return calendar.getTimeInMillis();
} else {
throw new UnexpectedException("time bucket type must be second or minute");
}
}
public long[] getFiveSecondTimeBuckets(long secondTimeBucket) {
long timeStamp = changeTimeBucket2TimeStamp(TimeBucketType.SECOND.name(), secondTimeBucket);
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(timeStamp);
long[] timeBuckets = new long[5];
timeBuckets[0] = secondTimeBucket;
for (int i = 0; i < 4; i++) {
calendar.add(Calendar.SECOND, -1);
timeBuckets[i + 1] = getSecondTimeBucket(calendar.getTimeInMillis());
}
return timeBuckets;
}
public long changeToUTCTimeBucket(long timeBucket) {
String timeBucketStr = String.valueOf(timeBucket);
if (TimeZone.getDefault().getID().equals("GMT+08:00") || timeBucketStr.endsWith("0000")) {
return timeBucket;
} else {
return timeBucket - 800;
}
}
public long addSecondForSecondTimeBucket(String timeBucketType, long timeBucket, int second) {
if (!TimeBucketType.SECOND.name().equals(timeBucketType)) {
throw new UnexpectedException("time bucket type must be second ");
}
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(changeTimeBucket2TimeStamp(timeBucketType, timeBucket));
calendar.add(Calendar.SECOND, second);
return getSecondTimeBucket(calendar.getTimeInMillis());
}
public enum TimeBucketType {
SECOND, MINUTE, HOUR, DAY
SECOND, MINUTE, HOUR, DAY, MONTH
}
}

View File

@ -16,14 +16,10 @@
*
*/
package org.apache.skywalking.apm.collector.core.util;
import java.util.TimeZone;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
/**
* @author wu-sheng
@ -33,25 +29,4 @@ public class TimeBucketUtilsTest {
public void setup() {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
}
@After
public void teardown() {
}
@Test
public void testGetInfoFromATimestamp() {
long timeMillis = 1509521745220L;
Assert.assertArrayEquals(new long[] {
20171101153545L,
20171101153544L,
20171101153543L,
20171101153542L,
20171101153541L
}, TimeBucketUtils.INSTANCE.getFiveSecondTimeBuckets(TimeBucketUtils.INSTANCE.getSecondTimeBucket(timeMillis)));
Assert.assertEquals(20171101153545L, TimeBucketUtils.INSTANCE.getSecondTimeBucket(timeMillis));
Assert.assertEquals(201711011535L, TimeBucketUtils.INSTANCE.getMinuteTimeBucket(timeMillis));
Assert.assertEquals(201711011500L, TimeBucketUtils.INSTANCE.getHourTimeBucket(timeMillis));
Assert.assertEquals(201711010000L, TimeBucketUtils.INSTANCE.getDayTimeBucket(timeMillis));
}
}

View File

@ -22,23 +22,10 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.skywalking.apm.collector.core.module.Module;
import org.apache.skywalking.apm.collector.storage.base.dao.IBatchDAO;
import org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IApplicationMappingUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IApplicationReferenceMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ICpuMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IGCMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IGlobalTracePersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.IGlobalTraceUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceHeartBeatPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ISegmentCostPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.ISegmentCostUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ISegmentDurationPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.ISegmentPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.ISegmentUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IServiceReferenceUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO;
@ -115,6 +102,22 @@ import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceDay
import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceHourMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMinuteMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMonthMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationComponentUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationReferenceMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.ICpuMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IGCMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IGlobalTraceUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IMemoryMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IMemoryPoolMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.INetworkAddressUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentDurationUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceNameServiceUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceReferenceMetricUIDAO;
/**
* @author peng-yongsheng
@ -195,7 +198,7 @@ public class StorageModule extends Module {
classes.add(IInstanceMappingMonthPersistenceDAO.class);
classes.add(IGlobalTracePersistenceDAO.class);
classes.add(ISegmentCostPersistenceDAO.class);
classes.add(ISegmentDurationPersistenceDAO.class);
classes.add(ISegmentPersistenceDAO.class);
classes.add(IInstanceHeartBeatPersistenceDAO.class);
@ -232,6 +235,9 @@ public class StorageModule extends Module {
private void addUiDAO(List<Class> classes) {
classes.add(IInstanceUIDAO.class);
classes.add(INetworkAddressUIDAO.class);
classes.add(IServiceNameServiceUIDAO.class);
classes.add(IServiceMetricUIDAO.class);
classes.add(ICpuMetricUIDAO.class);
classes.add(IGCMetricUIDAO.class);
@ -243,9 +249,9 @@ public class StorageModule extends Module {
classes.add(IApplicationComponentUIDAO.class);
classes.add(IApplicationMappingUIDAO.class);
classes.add(IApplicationReferenceMetricUIDAO.class);
classes.add(ISegmentCostUIDAO.class);
classes.add(ISegmentDurationUIDAO.class);
classes.add(ISegmentUIDAO.class);
classes.add(IServiceReferenceUIDAO.class);
classes.add(IServiceReferenceMetricUIDAO.class);
}
private void addAlarmDAO(List<Class> classes) {

View File

@ -1,61 +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.apm.collector.storage.dao;
import com.google.gson.JsonArray;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
/**
* @author peng-yongsheng
*/
public interface IInstanceMetricUIDAO extends DAO {
InstanceMetric get(long[] timeBuckets, int instanceId);
long getTpsMetric(int instanceId, long timeBucket);
JsonArray getTpsMetric(int instanceId, long startTimeBucket, long endTimeBucket);
long getRespTimeMetric(int instanceId, long timeBucket);
JsonArray getRespTimeMetric(int instanceId, long startTimeBucket, long endTimeBucket);
class InstanceMetric {
private final int instanceId;
private final long calls;
private final long durationSum;
public InstanceMetric(int instanceId, long calls, long durationSum) {
this.instanceId = instanceId;
this.calls = calls;
this.durationSum = durationSum;
}
public int getInstanceId() {
return instanceId;
}
public long getCalls() {
return calls;
}
public long getDurationSum() {
return durationSum;
}
}
}

View File

@ -19,10 +19,10 @@
package org.apache.skywalking.apm.collector.storage.dao;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.segment.SegmentCost;
import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDuration;
/**
* @author peng-yongsheng
*/
public interface ISegmentCostPersistenceDAO<Insert, Update, DataImpl extends SegmentCost> extends IPersistenceDAO<Insert, Update, DataImpl> {
public interface ISegmentDurationPersistenceDAO<Insert, Update, DataImpl extends SegmentDuration> extends IPersistenceDAO<Insert, Update, DataImpl> {
}

View File

@ -19,6 +19,7 @@
package org.apache.skywalking.apm.collector.storage.dao.cache;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.table.register.Application;
/**
* @author peng-yongsheng
@ -26,7 +27,7 @@ import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
public interface IApplicationCacheDAO extends DAO {
int getApplicationIdByCode(String applicationCode);
String getApplicationCode(int applicationId);
Application getApplication(int applicationId);
int getApplicationIdByAddressId(int addressId);
}

View File

@ -19,12 +19,13 @@
package org.apache.skywalking.apm.collector.storage.dao.cache;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.table.register.ServiceName;
/**
* @author peng-yongsheng
*/
public interface IServiceNameCacheDAO extends DAO {
String getServiceName(int serviceId);
ServiceName get(int serviceId);
int getServiceId(int applicationId, String serviceName);
}

View File

@ -0,0 +1,52 @@
/*
* 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.apm.collector.storage.dao.ui;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
/**
* @author peng-yongsheng
*/
public interface IApplicationComponentUIDAO extends DAO {
List<ApplicationComponent> load(Step step, long startTime, long endTime);
class ApplicationComponent {
private int componentId;
private int applicationId;
public int getComponentId() {
return componentId;
}
public void setComponentId(int componentId) {
this.componentId = componentId;
}
public int getApplicationId() {
return applicationId;
}
public void setApplicationId(int applicationId) {
this.applicationId = applicationId;
}
}
}

View File

@ -16,49 +16,36 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.dao.ui;
import com.google.gson.JsonObject;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
/**
* @author peng-yongsheng
*/
public interface IGCMetricUIDAO extends DAO {
public interface IApplicationMappingUIDAO extends DAO {
List<ApplicationMapping> load(Step step, long startTime, long endTime);
GCCount getGCCount(long[] timeBuckets, int instanceId);
class ApplicationMapping {
private int applicationId;
private int mappingApplicationId;
JsonObject getMetric(int instanceId, long timeBucket);
JsonObject getMetric(int instanceId, long startTimeBucket, long endTimeBucket);
class GCCount {
private int young;
private int old;
private int full;
public int getYoung() {
return young;
public int getApplicationId() {
return applicationId;
}
public int getOld() {
return old;
public void setApplicationId(int applicationId) {
this.applicationId = applicationId;
}
public int getFull() {
return full;
public int getMappingApplicationId() {
return mappingApplicationId;
}
public void setYoung(int young) {
this.young = young;
}
public void setOld(int old) {
this.old = old;
}
public void setFull(int full) {
this.full = full;
public void setMappingApplicationId(int mappingApplicationId) {
this.mappingApplicationId = mappingApplicationId;
}
}
}

View File

@ -0,0 +1,38 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.skywalking.apm.collector.storage.dao.ui;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.table.MetricSource;
import org.apache.skywalking.apm.collector.storage.ui.common.Call;
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
/**
* @author peng-yongsheng
*/
public interface IApplicationReferenceMetricUIDAO extends DAO {
List<Call> getFrontApplications(Step step, int applicationId, long startTime, long endTime,
MetricSource metricSource);
List<Call> getBehindApplications(Step step, int applicationId, long startTime, long endTime,
MetricSource metricSource);
List<Call> getApplications(Step step, long startTime, long endTime, MetricSource metricSource);
}

View File

@ -16,16 +16,16 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.dao.ui;
import com.google.gson.JsonArray;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
import org.apache.skywalking.apm.collector.storage.utils.DurationPoint;
/**
* @author peng-yongsheng
*/
public interface ICpuMetricUIDAO extends DAO {
int getMetric(int instanceId, long timeBucket);
JsonArray getMetric(int instanceId, long startTimeBucket, long endTimeBucket);
List<Integer> getCPUTrend(int instanceId, Step step, List<DurationPoint> durationPoints);
}

View File

@ -16,24 +16,18 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.dao.ui;
import com.google.gson.JsonObject;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
import org.apache.skywalking.apm.collector.storage.utils.DurationPoint;
/**
* @author peng-yongsheng
*/
public interface ISegmentCostUIDAO extends DAO {
JsonObject loadTop(long startTime, long endTime, long minCost, long maxCost, String operationName,
Error error, int applicationId, List<String> segmentIds, int limit, int from, Sort sort);
public interface IGCMetricUIDAO extends DAO {
List<Integer> getYoungGCTrend(int instanceId, Step step, List<DurationPoint> durationPoints);
enum Sort {
Cost, Time
}
enum Error {
All, True, False
}
List<Integer> getOldGCTrend(int instanceId, Step step, List<DurationPoint> durationPoints);
}

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.dao.ui;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;

View File

@ -0,0 +1,40 @@
/*
* 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.apm.collector.storage.dao.ui;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.table.MetricSource;
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo;
import org.apache.skywalking.apm.collector.storage.utils.DurationPoint;
/**
* @author peng-yongsheng
*/
public interface IInstanceMetricUIDAO extends DAO {
List<AppServerInfo> getTopNServerThroughput(int applicationId, Step step, long start, long end, long secondBetween,
int topN,
MetricSource metricSource);
List<Integer> getServerTPSTrend(int instanceId, Step step, List<DurationPoint> durationPoints);
List<Integer> getResponseTimeTrend(int instanceId, Step step, List<DurationPoint> durationPoints);
}

View File

@ -16,12 +16,13 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.dao.ui;
import com.google.gson.JsonArray;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.table.register.Instance;
import org.apache.skywalking.apm.collector.storage.ui.application.Application;
import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo;
/**
* @author peng-yongsheng
@ -31,27 +32,11 @@ public interface IInstanceUIDAO extends DAO {
Long instanceLastHeartBeatTime(long applicationInstanceId);
JsonArray getApplications(long startTime, long endTime);
List<Application> getApplications(long startTime, long endTime, int... applicationIds);
Instance getInstance(int instanceId);
List<Instance> getInstances(int applicationId, long timeBucket);
List<AppServerInfo> searchServer(String keyword, long start, long end);
class Application {
private final int applicationId;
private final long count;
public Application(int applicationId, long count) {
this.applicationId = applicationId;
this.count = count;
}
public int getApplicationId() {
return applicationId;
}
public long getCount() {
return count;
}
}
List<AppServerInfo> getAllServer(int applicationId, long start, long end);
}

View File

@ -0,0 +1,60 @@
/*
* 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.apm.collector.storage.dao.ui;
import java.util.LinkedList;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
import org.apache.skywalking.apm.collector.storage.utils.DurationPoint;
/**
* @author peng-yongsheng
*/
public interface IMemoryMetricUIDAO extends DAO {
Trend getHeapMemoryTrend(int instanceId, Step step, List<DurationPoint> durationPoints);
Trend getNoHeapMemoryTrend(int instanceId, Step step, List<DurationPoint> durationPoints);
class Trend {
private List<Integer> metrics;
private List<Integer> maxMetrics;
public Trend() {
this.metrics = new LinkedList<>();
this.maxMetrics = new LinkedList<>();
}
public List<Integer> getMetrics() {
return metrics;
}
public void setMetrics(List<Integer> metrics) {
this.metrics = metrics;
}
public List<Integer> getMaxMetrics() {
return maxMetrics;
}
public void setMaxMetrics(List<Integer> maxMetrics) {
this.maxMetrics = maxMetrics;
}
}
}

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.dao.ui;
import com.google.gson.JsonObject;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;

View File

@ -16,14 +16,13 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.dao.ui;
import com.google.gson.JsonArray;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
/**
* @author peng-yongsheng
*/
public interface IApplicationMappingUIDAO extends DAO {
JsonArray load(long startTime, long endTime);
public interface INetworkAddressUIDAO extends DAO {
int getNumOfSpanLayer(int spanLayer);
}

View File

@ -16,16 +16,15 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.dao.ui;
import com.google.gson.JsonObject;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief;
/**
* @author peng-yongsheng
*/
public interface IMemoryMetricUIDAO extends DAO {
JsonObject getMetric(int instanceId, long timeBucket, boolean isHeap);
JsonObject getMetric(int instanceId, long startTimeBucket, long endTimeBucket, boolean isHeap);
public interface ISegmentDurationUIDAO extends DAO {
TraceBrief loadTop(long startTime, long endTime, long minDuration, long maxDuration, String operationName,
int applicationId, String traceId, int limit, int from);
}

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.dao.ui;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.network.proto.TraceSegmentObject;

View File

@ -0,0 +1,43 @@
/*
* 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.apm.collector.storage.dao.ui;
import java.util.Collection;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.table.MetricSource;
import org.apache.skywalking.apm.collector.storage.ui.common.Node;
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
import org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric;
import org.apache.skywalking.apm.collector.storage.utils.DurationPoint;
/**
* @author peng-yongsheng
*/
public interface IServiceMetricUIDAO extends DAO {
List<Integer> getServiceResponseTimeTrend(int serviceId, Step step, List<DurationPoint> durationPoints);
List<Integer> getServiceSLATrend(int serviceId, Step step, List<DurationPoint> durationPoints);
List<Node> getServicesMetric(Step step, long startTime, long endTime,
MetricSource metricSource, Collection<Integer> serviceIds);
List<ServiceMetric> getSlowService(int applicationId, Step step, long start, long end,
Integer top, MetricSource metricSource);
}

View File

@ -16,15 +16,17 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.dao.ui;
import com.google.gson.JsonObject;
import java.util.Map;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.ui.service.ServiceInfo;
/**
* @author peng-yongsheng
*/
public interface IServiceReferenceUIDAO extends DAO {
Map<String, JsonObject> load(int entryServiceId, long startTime, long endTime);
public interface IServiceNameServiceUIDAO extends DAO {
int getCount();
List<ServiceInfo> searchService(String keyword, int topN);
}

View File

@ -0,0 +1,43 @@
/*
* 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.apm.collector.storage.dao.ui;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.table.MetricSource;
import org.apache.skywalking.apm.collector.storage.ui.common.Call;
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
/**
* @author peng-yongsheng
*/
public interface IServiceReferenceMetricUIDAO extends DAO {
List<Call> getFrontServices(Step step, long startTime, long endTime,
MetricSource metricSource, int behindServiceId);
List<Call> getBehindServices(Step step, long startTime, long endTime,
MetricSource metricSource, int frontServiceId);
List<Call> getFrontServices(Step step, long startTime, long endTime,
MetricSource metricSource, List<Integer> behindServiceIds);
List<Call> getBehindServices(Step step, long startTime, long endTime,
MetricSource metricSource, List<Integer> frontServiceIds);
}

View File

@ -41,7 +41,7 @@ public class ApplicationComponent extends StreamData {
private static final Column[] INTEGER_COLUMNS = {
new Column(ApplicationComponentTable.COLUMN_COMPONENT_ID, new CoverOperation()),
new Column(ApplicationComponentTable.COLUMN_PEER_ID, new CoverOperation()),
new Column(ApplicationComponentTable.COLUMN_APPLICATION_ID, new CoverOperation()),
};
private static final Column[] BYTE_COLUMNS = {};
@ -82,11 +82,11 @@ public class ApplicationComponent extends StreamData {
setDataInteger(0, componentId);
}
public Integer getPeerId() {
public Integer getApplicationId() {
return getDataInteger(1);
}
public void setPeerId(Integer peerId) {
setDataInteger(1, peerId);
public void setApplicationId(Integer applicationId) {
setDataInteger(1, applicationId);
}
}

View File

@ -16,7 +16,6 @@
*
*/
package org.apache.skywalking.apm.collector.storage.table.application;
import org.apache.skywalking.apm.collector.core.data.CommonTable;
@ -27,5 +26,5 @@ import org.apache.skywalking.apm.collector.core.data.CommonTable;
public class ApplicationComponentTable extends CommonTable {
public static final String TABLE = "application_component";
public static final String COLUMN_COMPONENT_ID = "component_id";
public static final String COLUMN_PEER_ID = "peer_id";
public static final String COLUMN_APPLICATION_ID = "application_id";
}

View File

@ -41,7 +41,7 @@ public class ApplicationMapping extends StreamData {
private static final Column[] INTEGER_COLUMNS = {
new Column(ApplicationMappingTable.COLUMN_APPLICATION_ID, new CoverOperation()),
new Column(ApplicationMappingTable.COLUMN_ADDRESS_ID, new CoverOperation()),
new Column(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID, new CoverOperation()),
};
private static final Column[] BYTE_COLUMNS = {};
@ -74,12 +74,12 @@ public class ApplicationMapping extends StreamData {
setDataInteger(0, applicationId);
}
public int getAddressId() {
public int getMappingApplicationId() {
return getDataInteger(1);
}
public void setAddressId(int addressId) {
setDataInteger(1, addressId);
public void setMappingApplicationId(int mappingApplicationId) {
setDataInteger(1, mappingApplicationId);
}
public long getTimeBucket() {

View File

@ -16,7 +16,6 @@
*
*/
package org.apache.skywalking.apm.collector.storage.table.application;
import org.apache.skywalking.apm.collector.core.data.CommonTable;
@ -27,5 +26,5 @@ import org.apache.skywalking.apm.collector.core.data.CommonTable;
public class ApplicationMappingTable extends CommonTable {
public static final String TABLE = "application_mapping";
public static final String COLUMN_APPLICATION_ID = "application_id";
public static final String COLUMN_ADDRESS_ID = "address_id";
public static final String COLUMN_MAPPING_APPLICATION_ID = "mapping_application_id";
}

View File

@ -39,6 +39,7 @@ public class Application extends StreamData {
private static final Column[] INTEGER_COLUMNS = {
new Column(ApplicationTable.COLUMN_APPLICATION_ID, new CoverOperation()),
new Column(ApplicationTable.COLUMN_LAYER, new CoverOperation()),
new Column(ApplicationTable.COLUMN_ADDRESS_ID, new CoverOperation()),
new Column(ApplicationTable.COLUMN_IS_ADDRESS, new CoverOperation()),
};
@ -81,19 +82,27 @@ public class Application extends StreamData {
setDataInteger(0, applicationId);
}
public int getAddressId() {
public int getLayer() {
return getDataInteger(1);
}
public void setAddressId(int addressId) {
setDataInteger(1, addressId);
public void setLayer(int layer) {
setDataInteger(1, layer);
}
public int getIsAddress() {
public int getAddressId() {
return getDataInteger(2);
}
public void setAddressId(int addressId) {
setDataInteger(2, addressId);
}
public int getIsAddress() {
return getDataInteger(3);
}
public void setIsAddress(int isAddress) {
setDataInteger(2, isAddress);
setDataInteger(3, isAddress);
}
}

View File

@ -27,6 +27,7 @@ public class ApplicationTable extends CommonTable {
public static final String TABLE = "application";
public static final String COLUMN_APPLICATION_CODE = "application_code";
public static final String COLUMN_APPLICATION_ID = "application_id";
public static final String COLUMN_LAYER = "layer";
public static final String COLUMN_IS_ADDRESS = "is_address";
public static final String COLUMN_ADDRESS_ID = "address_id";
}

View File

@ -39,6 +39,7 @@ public class NetworkAddress extends StreamData {
private static final Column[] INTEGER_COLUMNS = {
new Column(NetworkAddressTable.COLUMN_ADDRESS_ID, new NonOperation()),
new Column(NetworkAddressTable.COLUMN_SPAN_LAYER, new NonOperation()),
};
private static final Column[] BYTE_COLUMNS = {};
@ -78,4 +79,12 @@ public class NetworkAddress extends StreamData {
public void setAddressId(Integer addressId) {
setDataInteger(0, addressId);
}
public Integer getSpanLayer() {
return getDataInteger(1);
}
public void setSpanLayer(Integer spanLayer) {
setDataInteger(1, spanLayer);
}
}

View File

@ -26,5 +26,6 @@ import org.apache.skywalking.apm.collector.core.data.CommonTable;
public class NetworkAddressTable extends CommonTable {
public static final String TABLE = "network_address";
public static final String COLUMN_NETWORK_ADDRESS = "network_address";
public static final String COLUMN_SPAN_LAYER = "span_layer";
public static final String COLUMN_ADDRESS_ID = "address_id";
}

View File

@ -26,31 +26,32 @@ import org.apache.skywalking.apm.collector.core.data.operator.NonOperation;
/**
* @author peng-yongsheng
*/
public class SegmentCost extends StreamData {
public class SegmentDuration extends StreamData {
private static final Column[] STRING_COLUMNS = {
new Column(SegmentCostTable.COLUMN_ID, new NonOperation()),
new Column(SegmentCostTable.COLUMN_SEGMENT_ID, new CoverOperation()),
new Column(SegmentCostTable.COLUMN_SERVICE_NAME, new CoverOperation()),
new Column(SegmentDurationTable.COLUMN_ID, new NonOperation()),
new Column(SegmentDurationTable.COLUMN_SEGMENT_ID, new CoverOperation()),
new Column(SegmentDurationTable.COLUMN_SERVICE_NAME, new CoverOperation()),
new Column(SegmentDurationTable.COLUMN_TRACE_ID, new CoverOperation()),
};
private static final Column[] LONG_COLUMNS = {
new Column(SegmentCostTable.COLUMN_COST, new CoverOperation()),
new Column(SegmentCostTable.COLUMN_START_TIME, new CoverOperation()),
new Column(SegmentCostTable.COLUMN_END_TIME, new CoverOperation()),
new Column(SegmentCostTable.COLUMN_TIME_BUCKET, new CoverOperation()),
new Column(SegmentDurationTable.COLUMN_DURATION, new CoverOperation()),
new Column(SegmentDurationTable.COLUMN_START_TIME, new CoverOperation()),
new Column(SegmentDurationTable.COLUMN_END_TIME, new CoverOperation()),
new Column(SegmentDurationTable.COLUMN_TIME_BUCKET, new CoverOperation()),
};
private static final Column[] DOUBLE_COLUMNS = {};
private static final Column[] INTEGER_COLUMNS = {
new Column(SegmentCostTable.COLUMN_APPLICATION_ID, new CoverOperation()),
new Column(SegmentCostTable.COLUMN_IS_ERROR, new CoverOperation()),
new Column(SegmentDurationTable.COLUMN_APPLICATION_ID, new CoverOperation()),
new Column(SegmentDurationTable.COLUMN_IS_ERROR, new CoverOperation()),
};
private static final Column[] BYTE_COLUMNS = {};
public SegmentCost() {
public SegmentDuration() {
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
}
@ -86,12 +87,20 @@ public class SegmentCost extends StreamData {
setDataString(2, serviceName);
}
public Long getCost() {
public String getTraceId() {
return getDataString(3);
}
public void setTraceId(String traceId) {
setDataString(3, traceId);
}
public Long getDuration() {
return getDataLong(0);
}
public void setCost(Long cost) {
setDataLong(0, cost);
public void setDuration(Long duration) {
setDataLong(0, duration);
}
public Long getStartTime() {

View File

@ -16,7 +16,6 @@
*
*/
package org.apache.skywalking.apm.collector.storage.table.segment;
import org.apache.skywalking.apm.collector.core.data.CommonTable;
@ -24,13 +23,14 @@ import org.apache.skywalking.apm.collector.core.data.CommonTable;
/**
* @author peng-yongsheng
*/
public class SegmentCostTable extends CommonTable {
public static final String TABLE = "segment_cost";
public class SegmentDurationTable extends CommonTable {
public static final String TABLE = "segment_duration";
public static final String COLUMN_SEGMENT_ID = "segment_id";
public static final String COLUMN_TRACE_ID = "trace_id";
public static final String COLUMN_APPLICATION_ID = "application_id";
public static final String COLUMN_START_TIME = "start_time";
public static final String COLUMN_END_TIME = "end_time";
public static final String COLUMN_SERVICE_NAME = "service_name";
public static final String COLUMN_COST = "cost";
public static final String COLUMN_DURATION = "duration";
public static final String COLUMN_IS_ERROR = "is_error";
}

View File

@ -0,0 +1,45 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.skywalking.apm.collector.storage.ui.alarm;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class Alarm {
private List<AlarmItem> items;
private int total;
public List<AlarmItem> getItems() {
return items;
}
public void setItems(List<AlarmItem> items) {
this.items = items;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
}

View File

@ -0,0 +1,31 @@
/*
* 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.apm.collector.storage.ui.alarm;
/**
* @author peng-yongsheng
*/
public class AlarmItem {
private String id;
private String title;
private String content;
private String startTime;
private AlarmType alarmType;
private CauseType causeType;
}

View File

@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.skywalking.apm.collector.storage.ui.alarm;
/**
* @author peng-yongsheng
*/
public enum AlarmType {
APPLICATION,
SERVER,
SERVICE
}

View File

@ -0,0 +1,27 @@
/*
* 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.apm.collector.storage.ui.alarm;
/**
* @author peng-yongsheng
*/
public enum CauseType {
LOW_SUCCESS_RATE,
SLOW_RESPONSE
}

View File

@ -0,0 +1,52 @@
/*
* 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.apm.collector.storage.ui.application;
/**
* @author peng-yongsheng
*/
public class Application {
private int id;
private String name;
private int numOfServer;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getNumOfServer() {
return numOfServer;
}
public void setNumOfServer(int numOfServer) {
this.numOfServer = numOfServer;
}
}

View File

@ -0,0 +1,100 @@
/*
* 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.apm.collector.storage.ui.application;
import org.apache.skywalking.apm.collector.storage.ui.common.Node;
/**
* @author peng-yongsheng
*/
public class ApplicationNode extends Node {
private Float sla;
private Long callsPerSec;
private Long responseTimePerSec;
private Float apdex;
private Boolean isAlarm;
private Integer numOfServer;
private Integer numOfServerAlarm;
private Integer numOfServiceAlarm;
public Float getSla() {
return sla;
}
public void setSla(Float sla) {
this.sla = sla;
}
public Long getCallsPerSec() {
return callsPerSec;
}
public void setCallsPerSec(Long callsPerSec) {
this.callsPerSec = callsPerSec;
}
public Long getResponseTimePerSec() {
return responseTimePerSec;
}
public void setResponseTimePerSec(Long responseTimePerSec) {
this.responseTimePerSec = responseTimePerSec;
}
public Float getApdex() {
return apdex;
}
public void setApdex(Float apdex) {
this.apdex = apdex;
}
public Boolean getAlarm() {
return isAlarm;
}
public void setAlarm(Boolean alarm) {
isAlarm = alarm;
}
public Integer getNumOfServer() {
return numOfServer;
}
public void setNumOfServer(Integer numOfServer) {
this.numOfServer = numOfServer;
}
public Integer getNumOfServerAlarm() {
return numOfServerAlarm;
}
public void setNumOfServerAlarm(Integer numOfServerAlarm) {
this.numOfServerAlarm = numOfServerAlarm;
}
public Integer getNumOfServiceAlarm() {
return numOfServiceAlarm;
}
public void setNumOfServiceAlarm(Integer numOfServiceAlarm) {
this.numOfServiceAlarm = numOfServiceAlarm;
}
}

View File

@ -16,14 +16,12 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.ui.application;
import com.google.gson.JsonArray;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.ui.common.Node;
/**
* @author peng-yongsheng
*/
public interface IApplicationReferenceMetricUIDAO extends DAO {
JsonArray load(long startTime, long endTime);
public class ConjecturalNode extends Node {
}

View File

@ -0,0 +1,115 @@
/*
* 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.apm.collector.storage.ui.common;
/**
* @author peng-yongsheng
*/
public class Call {
private int source;
private String sourceName;
private int target;
private String targetName;
private boolean isAlert;
private String callType;
private long calls;
private long callsPerSec;
private long responseTimes;
private long responseTimePerSec;
public int getSource() {
return source;
}
public void setSource(int source) {
this.source = source;
}
public String getSourceName() {
return sourceName;
}
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
public int getTarget() {
return target;
}
public void setTarget(int target) {
this.target = target;
}
public String getTargetName() {
return targetName;
}
public void setTargetName(String targetName) {
this.targetName = targetName;
}
public boolean isAlert() {
return isAlert;
}
public void setAlert(boolean alert) {
isAlert = alert;
}
public String getCallType() {
return callType;
}
public void setCallType(String callType) {
this.callType = callType;
}
public long getCalls() {
return calls;
}
public void setCalls(long calls) {
this.calls = calls;
}
public long getCallsPerSec() {
return callsPerSec;
}
public void setCallsPerSec(long callsPerSec) {
this.callsPerSec = callsPerSec;
}
public long getResponseTimes() {
return responseTimes;
}
public void setResponseTimes(long responseTimes) {
this.responseTimes = responseTimes;
}
public long getResponseTimePerSec() {
return responseTimePerSec;
}
public void setResponseTimePerSec(long responseTimePerSec) {
this.responseTimePerSec = responseTimePerSec;
}
}

View File

@ -0,0 +1,53 @@
/*
* 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.apm.collector.storage.ui.common;
/**
* @author peng-yongsheng
*/
public class Duration {
private String start;
private String end;
private Step step;
public String getStart() {
return start;
}
public void setStart(String start) {
this.start = start;
}
public String getEnd() {
return end;
}
public void setEnd(String end) {
this.end = end;
}
public Step getStep() {
return step;
}
public void setStep(Step step) {
this.step = step;
}
}

View File

@ -0,0 +1,52 @@
/*
* 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.apm.collector.storage.ui.common;
/**
* @author peng-yongsheng
*/
public abstract class Node {
private int id;
private String name;
private String type;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -0,0 +1,52 @@
/*
* 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.apm.collector.storage.ui.common;
/**
* @author peng-yongsheng
*/
public class Pagination {
private Integer pageNum;
private Integer pageSize;
private Boolean needTotal;
public Integer getPageNum() {
return pageNum;
}
public void setPageNum(Integer pageNum) {
this.pageNum = pageNum;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Boolean getNeedTotal() {
return needTotal;
}
public void setNeedTotal(Boolean needTotal) {
this.needTotal = needTotal;
}
}

View File

@ -0,0 +1,36 @@
/*
* 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.apm.collector.storage.ui.common;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class ResponseTimeTrend {
private List<Integer> trendList;
public List<Integer> getTrendList() {
return trendList;
}
public void setTrendList(List<Integer> trendList) {
this.trendList = trendList;
}
}

View File

@ -0,0 +1,36 @@
/*
* 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.apm.collector.storage.ui.common;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class SLATrend {
private List<Integer> trendList;
public List<Integer> getTrendList() {
return trendList;
}
public void setTrendList(List<Integer> trendList) {
this.trendList = trendList;
}
}

View File

@ -0,0 +1,30 @@
/*
* 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.apm.collector.storage.ui.common;
/**
* @author peng-yongsheng
*/
public enum Step {
MONTH,
DAY,
HOUR,
MINUTE,
SECOND
}

View File

@ -0,0 +1,36 @@
/*
* 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.apm.collector.storage.ui.common;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class ThroughputTrend {
private List<Integer> trendList;
public List<Integer> getTrendList() {
return trendList;
}
public void setTrendList(List<Integer> trendList) {
this.trendList = trendList;
}
}

View File

@ -0,0 +1,52 @@
/*
* 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.apm.collector.storage.ui.common;
import java.util.LinkedList;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class Topology {
private List<Node> nodes;
private List<Call> calls;
public Topology() {
this.nodes = new LinkedList<>();
this.calls = new LinkedList<>();
}
public List<Node> getNodes() {
return nodes;
}
public void setNodes(List<Node> nodes) {
this.nodes = nodes;
}
public List<Call> getCalls() {
return calls;
}
public void setCalls(List<Call> calls) {
this.calls = calls;
}
}

View File

@ -0,0 +1,25 @@
/*
* 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.apm.collector.storage.ui.common;
/**
* @author peng-yongsheng
*/
public class VisualUserNode extends Node {
}

View File

@ -0,0 +1,31 @@
/*
* 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.apm.collector.storage.ui.config;
import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType;
import org.apache.skywalking.apm.collector.storage.ui.alarm.CauseType;
/**
* @author peng-yongsheng
*/
public class AlarmThreshold {
private AlarmType type;
private Integer threshold;
private CauseType causeType;
}

View File

@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.skywalking.apm.collector.storage.ui.config;
import org.apache.skywalking.apm.collector.storage.ui.alarm.CauseType;
/**
* @author peng-yongsheng
*/
public class ExistedAlarmThresholdItem {
private Integer threshold;
private CauseType causeType;
}

View File

@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.skywalking.apm.collector.storage.ui.config;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class ExistedAlarmThresholds {
private List<ExistedAlarmThresholdItem> items;
}

View File

@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.skywalking.apm.collector.storage.ui.config;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class ExistedTTLConfigs {
private List<TTL> ttl;
}

View File

@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.skywalking.apm.collector.storage.ui.config;
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
/**
* @author peng-yongsheng
*/
public class TTL {
private Step unit;
private Integer value;
}

View File

@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.skywalking.apm.collector.storage.ui.config;
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
/**
* @author peng-yongsheng
*/
public class TTLConfigItem {
private Step unit;
private Integer value;
}

View File

@ -16,14 +16,13 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.ui.overview;
import com.google.gson.JsonArray;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import java.util.List;
/**
* @author peng-yongsheng
*/
public interface IApplicationComponentUIDAO extends DAO {
JsonArray load(long startTime, long endTime);
public class AlarmTrend {
public List<Integer> numOfAlarmRate;
}

View File

@ -0,0 +1,70 @@
/*
* 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.apm.collector.storage.ui.overview;
/**
* @author peng-yongsheng
*/
public class ClusterBrief {
private int numOfApplication;
private int numOfService;
private int numOfDatabase;
private int numOfCache;
private int numOfMQ;
public int getNumOfApplication() {
return numOfApplication;
}
public void setNumOfApplication(int numOfApplication) {
this.numOfApplication = numOfApplication;
}
public int getNumOfService() {
return numOfService;
}
public void setNumOfService(int numOfService) {
this.numOfService = numOfService;
}
public int getNumOfDatabase() {
return numOfDatabase;
}
public void setNumOfDatabase(int numOfDatabase) {
this.numOfDatabase = numOfDatabase;
}
public int getNumOfCache() {
return numOfCache;
}
public void setNumOfCache(int numOfCache) {
this.numOfCache = numOfCache;
}
public int getNumOfMQ() {
return numOfMQ;
}
public void setNumOfMQ(int numOfMQ) {
this.numOfMQ = numOfMQ;
}
}

View File

@ -0,0 +1,43 @@
/*
* 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.apm.collector.storage.ui.overview;
/**
* @author peng-yongsheng
*/
public class ConjecturalApp {
private String name;
private int num;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
}

View File

@ -0,0 +1,36 @@
/*
* 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.apm.collector.storage.ui.overview;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class ConjecturalAppBrief {
private List<ConjecturalApp> apps;
public List<ConjecturalApp> getApps() {
return apps;
}
public void setApps(List<ConjecturalApp> apps) {
this.apps = apps;
}
}

View File

@ -0,0 +1,108 @@
/*
* 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.apm.collector.storage.ui.server;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class AppServerInfo {
private int id;
private int applicationId;
private String applicationCode;
private String osInfo;
private String name;
private int tps;
private String host;
private int pid;
private List<String> ipv4;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getApplicationId() {
return applicationId;
}
public void setApplicationId(int applicationId) {
this.applicationId = applicationId;
}
public String getApplicationCode() {
return applicationCode;
}
public void setApplicationCode(String applicationCode) {
this.applicationCode = applicationCode;
}
public String getOsInfo() {
return osInfo;
}
public void setOsInfo(String osInfo) {
this.osInfo = osInfo;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getTps() {
return tps;
}
public void setTps(int tps) {
this.tps = tps;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
public List<String> getIpv4() {
return ipv4;
}
public void setIpv4(List<String> ipv4) {
this.ipv4 = ipv4;
}
}

View File

@ -0,0 +1,36 @@
/*
* 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.apm.collector.storage.ui.server;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class CPUTrend {
private List<Integer> cost;
public List<Integer> getCost() {
return cost;
}
public void setCost(List<Integer> cost) {
this.cost = cost;
}
}

View File

@ -0,0 +1,45 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.skywalking.apm.collector.storage.ui.server;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class GCTrend {
private List<Integer> youngGC;
private List<Integer> oldGC;
public List<Integer> getYoungGC() {
return youngGC;
}
public void setYoungGC(List<Integer> youngGC) {
this.youngGC = youngGC;
}
public List<Integer> getOldGC() {
return oldGC;
}
public void setOldGC(List<Integer> oldGC) {
this.oldGC = oldGC;
}
}

View File

@ -0,0 +1,63 @@
/*
* 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.apm.collector.storage.ui.server;
import java.util.List;
/**
* @author peng-yongsheng
*/
public class MemoryTrend {
private List<Integer> heap;
private List<Integer> maxHeap;
private List<Integer> noheap;
private List<Integer> maxNoheap;
public List<Integer> getHeap() {
return heap;
}
public void setHeap(List<Integer> heap) {
this.heap = heap;
}
public List<Integer> getMaxHeap() {
return maxHeap;
}
public void setMaxHeap(List<Integer> maxHeap) {
this.maxHeap = maxHeap;
}
public List<Integer> getNoheap() {
return noheap;
}
public void setNoheap(List<Integer> noheap) {
this.noheap = noheap;
}
public List<Integer> getMaxNoheap() {
return maxNoheap;
}
public void setMaxNoheap(List<Integer> maxNoheap) {
this.maxNoheap = maxNoheap;
}
}

View File

@ -0,0 +1,43 @@
/*
* 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.apm.collector.storage.ui.service;
/**
* @author peng-yongsheng
*/
public class ServiceInfo {
private int id;
private String name;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,61 @@
/*
* 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.apm.collector.storage.ui.service;
/**
* @author peng-yongsheng
*/
public class ServiceMetric {
private int id;
private String name;
private int avgResponseTime;
private int tps;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAvgResponseTime() {
return avgResponseTime;
}
public void setAvgResponseTime(int avgResponseTime) {
this.avgResponseTime = avgResponseTime;
}
public int getTps() {
return tps;
}
public void setTps(int tps) {
this.tps = tps;
}
}

Some files were not shown because too many files have changed in this diff Show More