Merge branch 'master' into 6.0
# Conflicts: # README_ZH.md
This commit is contained in:
commit
e3f4e021be
|
|
@ -28,6 +28,7 @@ Release Notes.
|
|||
|
||||
#### Collector Changes
|
||||
- Topology query optimization for more than 100 apps.
|
||||
- Error rate alarm is not triggered.
|
||||
- Tolerate unsupported segments.
|
||||
- Support Integer Array, Long Array, String Array, Double Array in streaming data model.
|
||||
- Support multiple entry span and multiple service name in one segment durtaion record.
|
||||
|
|
|
|||
|
|
@ -60,9 +60,11 @@ This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDU
|
|||
|
||||
# Live Demo
|
||||
- Host in Beijing. [goto](http://49.4.12.44:8080/)
|
||||
- Username: admin
|
||||
- Password: admin
|
||||
|
||||
# Screenshot
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta/Dashboard.png"/>
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta2/Dashboard.png"/>
|
||||
|
||||
|
||||
- [See all screenshots](/docs/Screenshots.md)
|
||||
|
|
|
|||
|
|
@ -49,11 +49,11 @@ public class ConfigurationModuleProvider extends ModuleProvider {
|
|||
@Override public void prepare() throws ServiceNotProvidedException {
|
||||
String namespace = StringUtils.isNotEmpty(config.getNamespace()) ? config.getNamespace() : Const.EMPTY_STRING;
|
||||
int applicationApdexThreshold = config.getApplicationApdexThreshold() == 0 ? 2000 : config.getApplicationApdexThreshold();
|
||||
double serviceErrorRateThreshold = config.getServiceErrorRateThreshold() == 0 ? 10.00 : config.getServiceErrorRateThreshold();
|
||||
double serviceErrorRateThreshold = config.getServiceErrorRateThreshold() == 0 ? 0.10 : config.getServiceErrorRateThreshold() / 100;
|
||||
int serviceAverageResponseTimeThreshold = config.getServiceAverageResponseTimeThreshold() == 0 ? 2000 : config.getServiceAverageResponseTimeThreshold();
|
||||
double instanceErrorRateThreshold = config.getInstanceErrorRateThreshold() == 0 ? 10.00 : config.getInstanceErrorRateThreshold();
|
||||
double instanceErrorRateThreshold = config.getInstanceErrorRateThreshold() == 0 ? 0.10 : config.getInstanceErrorRateThreshold() / 100;
|
||||
int instanceAverageResponseTimeThreshold = config.getInstanceAverageResponseTimeThreshold() == 0 ? 2000 : config.getInstanceAverageResponseTimeThreshold();
|
||||
double applicationErrorRateThreshold = config.getApplicationErrorRateThreshold() == 0 ? 10.00 : config.getApplicationErrorRateThreshold();
|
||||
double applicationErrorRateThreshold = config.getApplicationErrorRateThreshold() == 0 ? 0.10 : config.getApplicationErrorRateThreshold() / 100;
|
||||
int applicationAverageResponseTimeThreshold = config.getApplicationAverageResponseTimeThreshold() == 0 ? 2000 : config.getApplicationAverageResponseTimeThreshold();
|
||||
|
||||
int thermodynamicResponseTimeStep = config.getThermodynamicResponseTimeStep() == 0 ? 50 : config.getThermodynamicResponseTimeStep();
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public interface IGCMetricUIDAO extends DAO {
|
|||
* <p>SQL as: select COUNT, TIMES, DURATION from GC_METRIC where ID in (durationPoints), rule of
|
||||
* ID generation is "${durationPoint}_${instanceId}_${gcPhrase}",
|
||||
* {@link org.apache.skywalking.apm.network.proto.GCPhrase#NEW_VALUE}
|
||||
* <p>The average young generation GC average count formula is "COUNT / TIMES".
|
||||
* <p>The young generation GC count
|
||||
* <p>The average young generation GC average duration formula is "DURATION / TIMES".
|
||||
* <p>Every element in return list must match DurationPoint list, which also means that,
|
||||
* the two list must be in same size, and index match.
|
||||
|
|
@ -64,8 +64,8 @@ public interface IGCMetricUIDAO extends DAO {
|
|||
* <p>SQL as: select COUNT, TIMES, DURATION from GC_METRIC where ID in (durationPoints), rule of
|
||||
* ID generation is "${durationPoint}_${instanceId}_${gcPhrase}",
|
||||
* {@link org.apache.skywalking.apm.network.proto.GCPhrase#OLD_VALUE}
|
||||
* <p>The average young generation GC average count formula is "COUNT / TIMES".
|
||||
* <p>The average young generation GC average duration formula is "DURATION / TIMES".
|
||||
* <p>The old generation GC count
|
||||
* <p>The average old generation GC average duration formula is "DURATION / TIMES".
|
||||
* <p>Every element in return list must match DurationPoint list, which also means that,
|
||||
* the two list must be in same size, and index match.
|
||||
* <p>If some element of the return list can't be found, the implementor must set 0 as
|
||||
|
|
|
|||
|
|
@ -22,26 +22,21 @@ package org.apache.skywalking.apm.collector.storage.ui.service;
|
|||
* @author peng-yongsheng
|
||||
*/
|
||||
public class ServiceMetric {
|
||||
private int id;
|
||||
private String name;
|
||||
private ServiceInfo service;
|
||||
private long calls;
|
||||
private int avgResponseTime;
|
||||
private int cpm;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
public ServiceMetric() {
|
||||
this.service = new ServiceInfo();
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
public ServiceInfo getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
public void setService(ServiceInfo service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public int getAvgResponseTime() {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class SegmentDurationEsPersistenceDAO extends EsDAO implements ISegmentDu
|
|||
XContentBuilder target = XContentFactory.jsonBuilder().startObject()
|
||||
.field(SegmentDurationTable.SEGMENT_ID.getName(), data.getSegmentId())
|
||||
.field(SegmentDurationTable.APPLICATION_ID.getName(), data.getApplicationId())
|
||||
.array(SegmentDurationTable.SERVICE_NAME.getName(), data.getServiceName())
|
||||
.field(SegmentDurationTable.SERVICE_NAME.getName(), data.getServiceName())
|
||||
.field(SegmentDurationTable.DURATION.getName(), data.getDuration())
|
||||
.field(SegmentDurationTable.START_TIME.getName(), data.getStartTime())
|
||||
.field(SegmentDurationTable.END_TIME.getName(), data.getEndTime())
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class ApplicationComponentEsUIDAO extends EsDAO implements IApplicationCo
|
|||
SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName);
|
||||
searchRequestBuilder.setTypes(ApplicationComponentTable.TABLE_TYPE);
|
||||
searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
|
||||
searchRequestBuilder.setPostFilter(QueryBuilders.rangeQuery(ApplicationComponentTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket));
|
||||
searchRequestBuilder.setQuery(QueryBuilders.rangeQuery(ApplicationComponentTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket));
|
||||
searchRequestBuilder.setSize(0);
|
||||
|
||||
searchRequestBuilder.addAggregation(AggregationBuilders.terms(ApplicationComponentTable.COMPONENT_ID.getName()).field(ApplicationComponentTable.COMPONENT_ID.getName()).size(100)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class ApplicationMappingEsUIDAO extends EsDAO implements IApplicationMapp
|
|||
SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName);
|
||||
searchRequestBuilder.setTypes(ApplicationMappingTable.TABLE_TYPE);
|
||||
searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
|
||||
searchRequestBuilder.setPostFilter(QueryBuilders.rangeQuery(ApplicationMappingTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket));
|
||||
searchRequestBuilder.setQuery(QueryBuilders.rangeQuery(ApplicationMappingTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket));
|
||||
searchRequestBuilder.setSize(0);
|
||||
|
||||
searchRequestBuilder.addAggregation(
|
||||
|
|
|
|||
|
|
@ -101,10 +101,10 @@ public class ApplicationMetricEsUIDAO extends EsDAO implements IApplicationMetri
|
|||
searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
|
||||
|
||||
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
|
||||
boolQuery.must().add(QueryBuilders.rangeQuery(ApplicationMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket));
|
||||
boolQuery.must().add(QueryBuilders.termQuery(ApplicationMetricTable.SOURCE_VALUE.getName(), metricSource.getValue()));
|
||||
boolQuery.filter().add(QueryBuilders.rangeQuery(ApplicationMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket));
|
||||
boolQuery.filter().add(QueryBuilders.termQuery(ApplicationMetricTable.SOURCE_VALUE.getName(), metricSource.getValue()));
|
||||
|
||||
searchRequestBuilder.setPostFilter(boolQuery);
|
||||
searchRequestBuilder.setQuery(boolQuery);
|
||||
searchRequestBuilder.setSize(0);
|
||||
|
||||
TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms(ApplicationMetricTable.APPLICATION_ID.getName()).field(ApplicationMetricTable.APPLICATION_ID.getName()).size(100);
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ public class ApplicationReferenceMetricEsUIDAO extends EsDAO implements IApplica
|
|||
searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
|
||||
|
||||
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
|
||||
boolQuery.must().add(QueryBuilders.rangeQuery(ApplicationReferenceMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket));
|
||||
boolQuery.must().add(QueryBuilders.termQuery(ApplicationReferenceMetricTable.SOURCE_VALUE.getName(), metricSource.getValue()));
|
||||
boolQuery.filter().add(QueryBuilders.rangeQuery(ApplicationReferenceMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket));
|
||||
boolQuery.filter().add(QueryBuilders.termQuery(ApplicationReferenceMetricTable.SOURCE_VALUE.getName(), metricSource.getValue()));
|
||||
|
||||
if (CollectionUtils.isNotEmpty(applicationIds)) {
|
||||
BoolQueryBuilder applicationBoolQuery = QueryBuilders.boolQuery();
|
||||
|
|
@ -71,7 +71,7 @@ public class ApplicationReferenceMetricEsUIDAO extends EsDAO implements IApplica
|
|||
boolQuery.must().add(applicationBoolQuery);
|
||||
}
|
||||
|
||||
searchRequestBuilder.setPostFilter(boolQuery);
|
||||
searchRequestBuilder.setQuery(boolQuery);
|
||||
searchRequestBuilder.setSize(0);
|
||||
|
||||
return buildMetrics(searchRequestBuilder);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public class GCMetricEsUIDAO extends EsDAO implements IGCMetricUIDAO {
|
|||
long count = ((Number)itemResponse.getResponse().getSource().get(GCMetricTable.COUNT.getName())).longValue();
|
||||
long duration = ((Number)itemResponse.getResponse().getSource().get(GCMetricTable.DURATION.getName())).longValue();
|
||||
long times = ((Number)itemResponse.getResponse().getSource().get(GCMetricTable.TIMES.getName())).intValue();
|
||||
gcTrends.add(new Trend((int)(count / times), (int)(duration / times)));
|
||||
gcTrends.add(new Trend((int)count, (int)(duration / times)));
|
||||
} else {
|
||||
gcTrends.add(new Trend(0, 0));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,23 +160,23 @@ public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO {
|
|||
searchRequestBuilder.setSize(1000);
|
||||
|
||||
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
|
||||
boolQuery.must().add(QueryBuilders.termQuery(InstanceTable.APPLICATION_ID.getName(), applicationId));
|
||||
boolQuery.must().add(QueryBuilders.termQuery(InstanceTable.IS_ADDRESS.getName(), BooleanUtils.FALSE));
|
||||
boolQuery.filter().add(QueryBuilders.termQuery(InstanceTable.APPLICATION_ID.getName(), applicationId));
|
||||
boolQuery.filter().add(QueryBuilders.termQuery(InstanceTable.IS_ADDRESS.getName(), BooleanUtils.FALSE));
|
||||
|
||||
BoolQueryBuilder boolQuery1 = QueryBuilders.boolQuery();
|
||||
boolQuery1.must().add(QueryBuilders.rangeQuery(InstanceTable.HEARTBEAT_TIME.getName()).gte(endSecondTimeBucket));
|
||||
boolQuery1.must().add(QueryBuilders.rangeQuery(InstanceTable.REGISTER_TIME.getName()).lte(endSecondTimeBucket));
|
||||
boolQuery1.filter().add(QueryBuilders.rangeQuery(InstanceTable.HEARTBEAT_TIME.getName()).gte(endSecondTimeBucket));
|
||||
boolQuery1.filter().add(QueryBuilders.rangeQuery(InstanceTable.REGISTER_TIME.getName()).lte(endSecondTimeBucket));
|
||||
|
||||
BoolQueryBuilder boolQuery2 = QueryBuilders.boolQuery();
|
||||
boolQuery2.must().add(QueryBuilders.rangeQuery(InstanceTable.REGISTER_TIME.getName()).lte(endSecondTimeBucket));
|
||||
boolQuery2.must().add(QueryBuilders.rangeQuery(InstanceTable.HEARTBEAT_TIME.getName()).gte(startSecondTimeBucket));
|
||||
boolQuery2.filter().add(QueryBuilders.rangeQuery(InstanceTable.REGISTER_TIME.getName()).lte(endSecondTimeBucket));
|
||||
boolQuery2.filter().add(QueryBuilders.rangeQuery(InstanceTable.HEARTBEAT_TIME.getName()).gte(startSecondTimeBucket));
|
||||
|
||||
BoolQueryBuilder timeBoolQuery = QueryBuilders.boolQuery();
|
||||
timeBoolQuery.should().add(boolQuery1);
|
||||
timeBoolQuery.should().add(boolQuery2);
|
||||
|
||||
boolQuery.must().add(timeBoolQuery);
|
||||
searchRequestBuilder.setPostFilter(boolQuery);
|
||||
searchRequestBuilder.setQuery(boolQuery);
|
||||
|
||||
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
|
||||
SearchHit[] searchHits = searchResponse.getHits().getHits();
|
||||
|
|
@ -190,7 +190,7 @@ public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO {
|
|||
searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
|
||||
searchRequestBuilder.setSize(1);
|
||||
|
||||
searchRequestBuilder.setPostFilter(QueryBuilders.termQuery(InstanceTable.APPLICATION_ID.getName(), applicationId));
|
||||
searchRequestBuilder.setQuery(QueryBuilders.termQuery(InstanceTable.APPLICATION_ID.getName(), applicationId));
|
||||
searchRequestBuilder.addSort(SortBuilders.fieldSort(InstanceTable.REGISTER_TIME.getName()).order(SortOrder.ASC));
|
||||
|
||||
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
|
||||
|
|
@ -210,7 +210,7 @@ public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO {
|
|||
searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
|
||||
searchRequestBuilder.setSize(1);
|
||||
|
||||
searchRequestBuilder.setPostFilter(QueryBuilders.termQuery(InstanceTable.APPLICATION_ID.getName(), applicationId));
|
||||
searchRequestBuilder.setQuery(QueryBuilders.termQuery(InstanceTable.APPLICATION_ID.getName(), applicationId));
|
||||
searchRequestBuilder.addSort(SortBuilders.fieldSort(InstanceTable.HEARTBEAT_TIME.getName()).order(SortOrder.DESC));
|
||||
|
||||
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@
|
|||
|
||||
package org.apache.skywalking.apm.collector.storage.es.dao.ui;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
|
||||
import org.apache.skywalking.apm.collector.core.util.*;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentDurationUIDAO;
|
||||
|
|
@ -36,8 +35,6 @@ import org.elasticsearch.search.sort.SortOrder;
|
|||
*/
|
||||
public class SegmentDurationEsUIDAO extends EsDAO implements ISegmentDurationUIDAO {
|
||||
|
||||
private final Gson gson = new Gson();
|
||||
|
||||
public SegmentDurationEsUIDAO(ElasticSearchClient client) {
|
||||
super(client);
|
||||
}
|
||||
|
|
@ -105,12 +102,7 @@ public class SegmentDurationEsUIDAO extends EsDAO implements ISegmentDurationUID
|
|||
|
||||
basicTrace.setSegmentId((String)searchHit.getSource().get(SegmentDurationTable.SEGMENT_ID.getName()));
|
||||
basicTrace.setStart(((Number)searchHit.getSource().get(SegmentDurationTable.START_TIME.getName())).longValue());
|
||||
|
||||
String serviceNameJsonStr = (String)searchHit.getSource().get(SegmentDurationTable.SERVICE_NAME.getName());
|
||||
if (StringUtils.isNotEmpty(serviceNameJsonStr)) {
|
||||
List serviceNames = gson.fromJson(serviceNameJsonStr, LinkedList.class);
|
||||
basicTrace.getOperationName().addAll(serviceNames);
|
||||
}
|
||||
basicTrace.getOperationName().addAll((List)searchHit.getSource().get(SegmentDurationTable.SERVICE_NAME.getName()));
|
||||
basicTrace.setDuration(((Number)searchHit.getSource().get(SegmentDurationTable.DURATION.getName())).intValue());
|
||||
basicTrace.setError(BooleanUtils.valueToBoolean(((Number)searchHit.getSource().get(SegmentDurationTable.IS_ERROR.getName())).intValue()));
|
||||
traceBrief.getTraces().add(basicTrace);
|
||||
|
|
|
|||
|
|
@ -208,7 +208,8 @@ public class ServiceMetricEsUIDAO extends EsDAO implements IServiceMetricUIDAO {
|
|||
int serviceId = ((Number)searchHit.getSource().get(ServiceMetricTable.SERVICE_ID.getName())).intValue();
|
||||
if (!serviceIds.contains(serviceId)) {
|
||||
ServiceMetric serviceMetric = new ServiceMetric();
|
||||
serviceMetric.setId(serviceId);
|
||||
serviceMetric.getService().setId(serviceId);
|
||||
serviceMetric.getService().setApplicationId(serviceId);
|
||||
serviceMetric.setCalls(((Number)searchHit.getSource().get(ServiceMetricTable.TRANSACTION_CALLS.getName())).longValue());
|
||||
serviceMetric.setAvgResponseTime(((Number)searchHit.getSource().get(ServiceMetricTable.TRANSACTION_AVERAGE_DURATION.getName())).intValue());
|
||||
serviceMetrics.add(serviceMetric);
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class GCMetricH2UIDAO extends H2DAO implements IGCMetricUIDAO {
|
|||
long count = rs.getLong(GCMetricTable.COUNT.getName());
|
||||
long duration = rs.getLong(GCMetricTable.DURATION.getName());
|
||||
long times = rs.getLong(GCMetricTable.TIMES.getName());
|
||||
gcTrends.add(new Trend((int)(count / times), (int)(duration / times)));
|
||||
gcTrends.add(new Trend((int)count, (int)(duration / times)));
|
||||
} else {
|
||||
gcTrends.add(new Trend(0, 0));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,26 +18,18 @@
|
|||
|
||||
package org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient;
|
||||
import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
import org.apache.skywalking.apm.collector.client.shardingjdbc.*;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.ui.IGCMetricUIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable;
|
||||
import org.apache.skywalking.apm.collector.storage.ui.common.Step;
|
||||
import org.apache.skywalking.apm.collector.storage.utils.DurationPoint;
|
||||
import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder;
|
||||
import org.apache.skywalking.apm.collector.storage.utils.*;
|
||||
import org.apache.skywalking.apm.network.proto.GCPhrase;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.*;
|
||||
|
||||
/**
|
||||
* @author linjiaqi
|
||||
|
|
@ -69,15 +61,15 @@ public class GCMetricShardingjdbcUIDAO extends ShardingjdbcDAO implements IGCMet
|
|||
durationPoints.forEach(durationPoint -> {
|
||||
String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + gcPhrase;
|
||||
try (
|
||||
ResultSet rs = client.executeQuery(sql, new String[] {id});
|
||||
Statement statement = rs.getStatement();
|
||||
Connection conn = statement.getConnection();
|
||||
) {
|
||||
ResultSet rs = client.executeQuery(sql, new String[] {id});
|
||||
Statement statement = rs.getStatement();
|
||||
Connection conn = statement.getConnection();
|
||||
) {
|
||||
if (rs.next()) {
|
||||
long count = rs.getLong(GCMetricTable.COUNT.getName());
|
||||
long duration = rs.getLong(GCMetricTable.DURATION.getName());
|
||||
long times = rs.getLong(GCMetricTable.TIMES.getName());
|
||||
gcTrends.add(new Trend((int)(count / times), (int)(duration / times)));
|
||||
gcTrends.add(new Trend((int)count, (int)(duration / times)));
|
||||
} else {
|
||||
gcTrends.add(new Trend(0, 0));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,7 +208,8 @@ public class ServiceMetricShardingjdbcUIDAO extends ShardingjdbcDAO implements I
|
|||
int serviceId = rs.getInt(ServiceMetricTable.SERVICE_ID.getName());
|
||||
if (!serviceIds.contains(serviceId)) {
|
||||
ServiceMetric serviceMetric = new ServiceMetric();
|
||||
serviceMetric.setId(serviceId);
|
||||
serviceMetric.getService().setId(serviceId);
|
||||
serviceMetric.getService().setApplicationId(applicationId);
|
||||
serviceMetric.setCalls(rs.getLong(ServiceMetricTable.TRANSACTION_CALLS.getName()));
|
||||
serviceMetric.setAvgResponseTime(rs.getInt(ServiceMetricTable.TRANSACTION_AVERAGE_DURATION.getName()));
|
||||
serviceMetrics.add(serviceMetric);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import org.apache.skywalking.apm.collector.core.module.*;
|
|||
import org.apache.skywalking.apm.collector.jetty.manager.JettyManagerModule;
|
||||
import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService;
|
||||
import org.apache.skywalking.apm.collector.receiver.zipkin.define.ZipkinReceiverModule;
|
||||
import org.apache.skywalking.apm.collector.receiver.zipkin.provider.handler.SpanV1JettyHandler;
|
||||
import org.apache.skywalking.apm.collector.receiver.zipkin.provider.handler.SpanV2JettyHandler;
|
||||
import org.apache.skywalking.apm.collector.receiver.zipkin.provider.transform.Zipkin2SkyWalkingTransfer;
|
||||
import org.apache.skywalking.apm.collector.server.jetty.JettyServer;
|
||||
|
|
@ -74,6 +75,7 @@ public class ZipkinReceiverProvider extends ModuleProvider {
|
|||
|
||||
JettyManagerService managerService = getManager().find(JettyManagerModule.NAME).getService(JettyManagerService.class);
|
||||
JettyServer jettyServer = managerService.createIfAbsent(config.getHost(), config.getPort(), config.getContextPath());
|
||||
jettyServer.addHandler(new SpanV1JettyHandler(config, registerServices));
|
||||
jettyServer.addHandler(new SpanV2JettyHandler(config, registerServices));
|
||||
|
||||
ISegmentParseService segmentParseService = getManager().find(AnalysisSegmentParserModule.NAME).getService(ISegmentParseService.class);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ package org.apache.skywalking.apm.collector.receiver.zipkin.provider.handler;
|
|||
import org.apache.skywalking.apm.collector.receiver.zipkin.provider.RegisterServices;
|
||||
import org.apache.skywalking.apm.collector.receiver.zipkin.provider.ZipkinReceiverConfig;
|
||||
import org.apache.skywalking.apm.collector.receiver.zipkin.provider.cache.CacheFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import zipkin2.Span;
|
||||
import zipkin2.codec.SpanBytesDecoder;
|
||||
|
||||
|
|
@ -30,11 +32,23 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
|
||||
public class SpanProcessor {
|
||||
private final Logger logger = LoggerFactory.getLogger(SpanProcessor.class);
|
||||
|
||||
void convert(ZipkinReceiverConfig config, SpanBytesDecoder decoder, HttpServletRequest request, RegisterServices registerServices) throws IOException {
|
||||
int len = request.getContentLength();
|
||||
ServletInputStream iii = request.getInputStream();
|
||||
byte[] buffer = new byte[len];
|
||||
iii.read(buffer, 0, len);
|
||||
|
||||
int readCntTotal = 0;
|
||||
int readCntOnce;
|
||||
while (readCntTotal < len) {
|
||||
readCntOnce = iii.read(buffer, readCntTotal, len - readCntTotal);
|
||||
if (readCntOnce <= 0) {
|
||||
logger.error("Receive spans data failed.");
|
||||
throw new IOException();
|
||||
}
|
||||
readCntTotal += readCntOnce;
|
||||
}
|
||||
|
||||
List<Span> spanList = decoder.decodeList(buffer);
|
||||
|
||||
|
|
|
|||
|
|
@ -86,14 +86,16 @@ public class ApplicationService {
|
|||
long startSecondTimeBucket, long endSecondTimeBucket, Integer topN) {
|
||||
List<ServiceMetric> slowServices = serviceMetricUIDAO.getSlowService(applicationId, step, startTimeBucket, endTimeBucket, topN, MetricSource.Callee);
|
||||
slowServices.forEach(slowService -> {
|
||||
ServiceName serviceName = serviceNameCacheService.get(slowService.getId());
|
||||
ServiceName serviceName = serviceNameCacheService.get(slowService.getService().getId());
|
||||
|
||||
try {
|
||||
slowService.setCpm((int)(slowService.getCalls() / dateBetweenService.minutesBetween(serviceName.getApplicationId(), startSecondTimeBucket, endSecondTimeBucket)));
|
||||
} catch (ParseException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
slowService.setName(serviceName.getServiceName());
|
||||
slowService.getService().setApplicationId(serviceName.getApplicationId());
|
||||
slowService.getService().setApplicationName(applicationCacheService.getApplicationById(serviceName.getApplicationId()).getApplicationCode());
|
||||
slowService.getService().setName(serviceName.getServiceName());
|
||||
});
|
||||
return slowServices;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,8 +109,10 @@ public class ServiceNameService {
|
|||
long startSecondTimeBucket, long endSecondTimeBucket, Integer topN) {
|
||||
List<ServiceMetric> slowServices = serviceMetricUIDAO.getSlowService(0, step, startTimeBucket, endTimeBucket, topN, MetricSource.Callee);
|
||||
slowServices.forEach(slowService -> {
|
||||
ServiceName serviceName = serviceNameCacheService.get(slowService.getId());
|
||||
slowService.setName(serviceName.getServiceName());
|
||||
ServiceName serviceName = serviceNameCacheService.get(slowService.getService().getId());
|
||||
slowService.getService().setName(serviceName.getServiceName());
|
||||
slowService.getService().setApplicationId(serviceName.getApplicationId());
|
||||
slowService.getService().setApplicationName(applicationCacheService.getApplicationById(serviceName.getApplicationId()).getApplicationCode());
|
||||
try {
|
||||
slowService.setCpm((int)(slowService.getCalls() / dateBetweenService.minutesBetween(serviceName.getApplicationId(), startSecondTimeBucket, endSecondTimeBucket)));
|
||||
} catch (ParseException e) {
|
||||
|
|
|
|||
|
|
@ -115,9 +115,9 @@ public class ApplicationServiceTest {
|
|||
when(serviceMetricUIDAO.getSlowService(anyInt(), anyObject(), anyLong(), anyLong(), anyInt(), anyObject())).then(invocation -> {
|
||||
ServiceMetric serviceMetric = new ServiceMetric();
|
||||
serviceMetric.setCalls(200900);
|
||||
serviceMetric.setName("test");
|
||||
serviceMetric.getService().setName("test");
|
||||
serviceMetric.setAvgResponseTime(100);
|
||||
serviceMetric.setId(1);
|
||||
serviceMetric.getService().setId(1);
|
||||
return Collections.singletonList(serviceMetric);
|
||||
});
|
||||
when(serviceNameCacheService.get(anyInt())).then(invocation -> {
|
||||
|
|
@ -125,8 +125,9 @@ public class ApplicationServiceTest {
|
|||
serviceName.setServiceName("serviceName");
|
||||
return serviceName;
|
||||
});
|
||||
mockCache();
|
||||
when(dateBetweenService.minutesBetween(anyInt(), anyLong(), anyLong())).then(invocation -> 20L);
|
||||
List<ServiceMetric> slowService = applicationService.getSlowService(-1, duration.getStep(), startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket, 10);
|
||||
List<ServiceMetric> slowService = applicationService.getSlowService(1, duration.getStep(), startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket, 10);
|
||||
Assert.assertTrue(slowService.get(0).getCpm() > 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.apache.skywalking.apm.collector.ui.service;
|
|||
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService;
|
||||
import org.apache.skywalking.apm.collector.cache.service.*;
|
||||
import org.apache.skywalking.apm.collector.core.module.*;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.ui.*;
|
||||
import org.apache.skywalking.apm.collector.storage.table.register.ServiceName;
|
||||
|
|
@ -42,6 +42,7 @@ public class ServiceNameServiceTest {
|
|||
private IServiceNameServiceUIDAO serviceNameServiceUIDAO;
|
||||
private IServiceMetricUIDAO serviceMetricUIDAO;
|
||||
private ServiceNameCacheService serviceNameCacheService;
|
||||
private ApplicationCacheService applicationCacheService;
|
||||
private DateBetweenService dateBetweenService;
|
||||
private ServiceNameService serverNameService;
|
||||
private Duration duration;
|
||||
|
|
@ -56,9 +57,11 @@ public class ServiceNameServiceTest {
|
|||
when(moduleManager.find(anyString())).then(invocation -> new MockModule());
|
||||
serverNameService = new ServiceNameService(moduleManager);
|
||||
serviceNameCacheService = mock(ServiceNameCacheService.class);
|
||||
applicationCacheService = mock(ApplicationCacheService.class);
|
||||
serviceMetricUIDAO = mock(IServiceMetricUIDAO.class);
|
||||
dateBetweenService = mock(DateBetweenService.class);
|
||||
Whitebox.setInternalState(serverNameService, "serviceNameCacheService", serviceNameCacheService);
|
||||
Whitebox.setInternalState(serverNameService, "applicationCacheService", applicationCacheService);
|
||||
Whitebox.setInternalState(serverNameService, "serviceMetricUIDAO", serviceMetricUIDAO);
|
||||
Whitebox.setInternalState(serverNameService, "dateBetweenService", dateBetweenService);
|
||||
duration = new Duration();
|
||||
|
|
@ -106,9 +109,10 @@ public class ServiceNameServiceTest {
|
|||
when(serviceMetricUIDAO.getSlowService(anyInt(), anyObject(), anyLong(), anyLong(), anyInt(), anyObject())).then(invocation -> {
|
||||
ServiceMetric serviceMetric = new ServiceMetric();
|
||||
serviceMetric.setCalls(200901);
|
||||
serviceMetric.setName("test");
|
||||
serviceMetric.getService().setName("test");
|
||||
serviceMetric.setAvgResponseTime(100);
|
||||
serviceMetric.setId(1);
|
||||
serviceMetric.getService().setApplicationId(1);
|
||||
serviceMetric.getService().setId(1);
|
||||
return Collections.singletonList(serviceMetric);
|
||||
});
|
||||
when(dateBetweenService.minutesBetween(anyInt(), anyLong(), anyLong())).then(invocation -> 20L);
|
||||
|
|
@ -121,7 +125,15 @@ public class ServiceNameServiceTest {
|
|||
Mockito.when(serviceNameCacheService.get(anyInt())).then(invocation -> {
|
||||
ServiceName serviceName = new ServiceName();
|
||||
serviceName.setServiceName("test_name");
|
||||
serviceName.setApplicationId(1);
|
||||
return serviceName;
|
||||
});
|
||||
|
||||
Mockito.when(applicationCacheService.getApplicationById(anyInt())).then(invocation -> {
|
||||
org.apache.skywalking.apm.collector.storage.table.register.Application application = new org.apache.skywalking.apm.collector.storage.table.register.Application();
|
||||
application.setApplicationId(1);
|
||||
application.setApplicationCode("test");
|
||||
return application;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -35,8 +35,7 @@ type ServiceInfo {
|
|||
}
|
||||
|
||||
type ServiceMetric {
|
||||
id: ID!
|
||||
name: String
|
||||
service: ServiceInfo!
|
||||
# The unit is millisecond.
|
||||
avgResponseTime: Int!
|
||||
cpm: Int!
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
- Overview dashboard
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta/Dashboard.png"/>
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta2/Dashboard.png"/>
|
||||
|
||||
- Discovery topological graph of application clusters automatically.
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta/Topology.png"/>
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta2/Topology.png"/>
|
||||
|
||||
- Application overview
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta/application.png"/>
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta2/application.png"/>
|
||||
|
||||
- Process(VM) metrics
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta/server.png"/>
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta2/server.png"/>
|
||||
|
||||
- Service metrics
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta/Service.png"/>
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta2/Service.png"/>
|
||||
|
||||
- Trace
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta/trace_list.png"/>
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta2/trace_list.png"/>
|
||||
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta/trace.png"/>
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta2/trace.png"/>
|
||||
|
||||
- Alarm
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta/application-alarm.png"/>
|
||||
<img src="https://skywalkingtest.github.io/page-resources/5.0.0-beta2/application-alarm.png"/>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ mvn release:prepare -DautoVersionSubmodules=true
|
|||
```
|
||||
mvn release:perform -DskipTests -Ptravis-ci-submodule
|
||||
```
|
||||
1. Set version number as x.y.z, and tag as x.y.z(RCx). `x` in `RCx` is based the number of attempts release, aka `RELEASE_ROUND` in this doc, and starts with 1.
|
||||
1. Set version number as x.y.z, and tag as x.y.z-RCx. `x` in `RCx` is based the number of attempts release, aka `RELEASE_ROUND` in this doc, and starts with 1.
|
||||
1. The release will automatically be inserted into a temporary staging repository for you.
|
||||
|
||||
## Build and sign the source code package
|
||||
|
|
@ -71,7 +71,7 @@ with .asc, .sha512, .md5
|
|||
|
||||
## Upload to Apache svn
|
||||
1. Use ApacheId to login `https://dist.apache.org/repos/dist/dev/incubator/skywalking/`
|
||||
1. Create folder, named by release version and round, such as: x.y.z(RCx)
|
||||
1. Create folder, named by release version and round, such as: x.y.z-RCx
|
||||
1. Upload Source code package to the folder with .asc, .sha512
|
||||
* Package name: apache-skywalking-incubating-x.y.z-src.tar.gz
|
||||
* See Section "Build and sign the source code package" for more details
|
||||
|
|
@ -112,7 +112,7 @@ Maven 2 staging repository:
|
|||
|
||||
Release Tag :
|
||||
|
||||
* (Git Tag) x.y.z(RCx)
|
||||
* (Git Tag) x.y.z-RCx
|
||||
|
||||
Release CommitID :
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ Maven 2 staging repository:
|
|||
|
||||
Release Tag :
|
||||
|
||||
* (Git Tag) x.y.z(RCx)
|
||||
* (Git Tag) x.y.z-RCx
|
||||
|
||||
Release CommitID :
|
||||
|
||||
|
|
@ -247,7 +247,7 @@ Maven 2 staging repository:
|
|||
|
||||
Release Tag :
|
||||
|
||||
* (Git Tag) x.y.z(RCx)
|
||||
* (Git Tag) x.y.z-RCx
|
||||
|
||||
Release CommitID :
|
||||
|
||||
|
|
@ -297,7 +297,7 @@ I will procedd to publish the release and send ANNOUNCE.
|
|||
1. Move source codes tar balls and distributions to `https://dist.apache.org/repos/dist/release/incubator/skywalking/`.
|
||||
```
|
||||
> export SVN_EDITOR=vim
|
||||
> svn mv https://dist.apache.org/repos/dist/dev/incubator/skywalking/x.y.z(RCx) https://dist.apache.org/repos/dist/release/incubator/skywalking
|
||||
> svn mv https://dist.apache.org/repos/dist/dev/incubator/skywalking/x.y.z-RCx https://dist.apache.org/repos/dist/release/incubator/skywalking
|
||||
....
|
||||
enter your apache password
|
||||
....
|
||||
|
|
@ -306,7 +306,7 @@ enter your apache password
|
|||
2. Do release in nexus staging repo.
|
||||
3. Public download URLs under `http://www.apache.org/dyn/closer.cgi/incubator/skywalking/x.y.z`.
|
||||
4. Public KEYS, sigs and sha512 URLs under `https://www.apache.org/dist/incubator/skywalking/xxxx`
|
||||
5. Re-tag on GitHub, tag `x.y.z(RCx)` as `x.y.z`, and publish a GitHub release based on this tag.
|
||||
5. Re-tag on GitHub, tag `x.y.z-RCx` as `x.y.z`, and publish a GitHub release based on this tag.
|
||||
5. Send ANNOUNCE mail to `announce@incubator.apache.org`.
|
||||
```
|
||||
Mail title: [ANNOUNCE] Release Apache SkyWalking (incubating) version x.y.z
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 07edaadb87c3bc73039ef8225d2779e665bfb30a
|
||||
Subproject commit 3ecf33899e28ac106e1d421c089c4c4a4d79c23d
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
|
||||
RELEASE_VERSION=${RELEASE_VERSION}
|
||||
TAG_NAME=${RELEASE_VERSION}(RC${RELEASE_ROUND})
|
||||
TAG_NAME=v${RELEASE_VERSION}-RC${RELEASE_ROUND}
|
||||
PRODUCT_NAME="apache-skywalking-apm-incubating"
|
||||
|
||||
echo "Release version "${RELEASE_VERSION}
|
||||
|
|
@ -72,6 +72,10 @@ tar czf ${PRODUCT_NAME}-src.tgz \
|
|||
--exclude ${PRODUCT_NAME}/.git/ --exclude ${PRODUCT_NAME}/.DS_Store/ \
|
||||
--exclude ${PRODUCT_NAME}/.github/ --exclude ${PRODUCT_NAME}/.gitignore/ \
|
||||
--exclude ${PRODUCT_NAME}/.gitmodules/ --exclude ${PRODUCT_NAME}/.travis.yml \
|
||||
--exclude ${PRODUCT_NAME}/skywalking-ui/.git/ --exclude ${PRODUCT_NAME}/skywalking-ui/.DS_Store/ \
|
||||
--exclude ${PRODUCT_NAME}/skywalking-ui/.github/ --exclude ${PRODUCT_NAME}/skywalking-ui/.gitignore/ \
|
||||
--exclude ${PRODUCT_NAME}/skywalking-ui/.travis.yml/ \
|
||||
--exclude ${PRODUCT_NAME}/apm-protocol/apm-network/src/main/proto/.git/ \
|
||||
${PRODUCT_NAME}
|
||||
|
||||
gpg --armor --detach-sig ${PRODUCT_NAME}-src.tgz
|
||||
|
|
|
|||
Loading…
Reference in New Issue