Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
tuohai666 committed May 15, 2019
2 parents 8bf4705 + d9b868b commit abe5ff7
Show file tree
Hide file tree
Showing 308 changed files with 3,968 additions and 2,738 deletions.
12 changes: 6 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Release Notes.
**Performance improved, especially in CPU limited environment. 3x improvement in service mesh scenario(no trace) in 8C16G VM.
Significantly cost less CPU in low payload.**

- Support database metric and SLOW SQL detection.
- Support database metrics and SLOW SQL detection.
- Support to set max size of metadata query. And change default to 5000 from 100.
- Support ElasticSearch template for new feature in the future.
- Support shutdown Zipkin trace analysis, because it doesn't fit production environment.
Expand All @@ -42,10 +42,10 @@ Significantly cost less CPU in low payload.**
- Support group endpoint name by regax rules in mesh receiver.
- Support `disable` statement in OAL.
- Support basic auth in ElasticSearch connection.
- Support metric exporter module and gRPC implementor.
- Support metrics exporter module and gRPC implementor.
- Support `>, <, >=, <=` in OAL.
- Support role mode in backend.
- Support Envoy metric.
- Support Envoy metrics.
- Support query segment by service instance.
- Support to set host/port manually at cluster coordinator, rather than based on core settings.
- Make sure OAP shutdown when it faces startup error.
Expand All @@ -62,7 +62,7 @@ Significantly cost less CPU in low payload.**

#### UI
- RocketBot UI has been accepted and bind in this release.
- Support CLR metric.
- Support CLR metrics.

#### Document
- Documents updated, matching Top Level Project requirement.
Expand Down Expand Up @@ -183,10 +183,10 @@ The core and most important features in v6 are
1. Support to collect telemetry data from different sources, such as multiple language agents and service mesh.
1. Extensible stream analysis core. Make SQL and cache analysis available in core level, although haven't
provided in this release.
1. Provide **Observability Analysis Language(OAL)** to make analysis metric customization available.
1. Provide **Observability Analysis Language(OAL)** to make analysis metrics customization available.
1. New GraphQL query protocol. Not binding with UI now.
1. UI topology is better now.
1. New alarm core provided. In alpha, only on service related metric.
1. New alarm core provided. In alpha, only on service related metrics.

All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/29?closed=1)

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The core features are following.
- Slow services and endpoints detected
- Performance optimization
- Distributed tracing and context propagation
- Database access metric. Detect slow database access statements(including SQL statements).
- Database access metrics. Detect slow database access statements(including SQL statements).
- Alarm


Expand All @@ -38,7 +38,7 @@ including
1. Istio telemetry format
1. Zipkin v1/v2 format
1. Jaeger gRPC format.
1. Envoy metrics format (the metric entries itself is prometheus client [metric family](https://github.com/prometheus/client_model/blob/fd36f4220a901265f90734c3183c5f0c91daa0b8/metrics.proto#L77))
1. Envoy metrics format (the metrics entries itself is prometheus client [metrics family](https://github.com/prometheus/client_model/blob/fd36f4220a901265f90734c3183c5f0c91daa0b8/metrics.proto#L77))


# Document
Expand Down Expand Up @@ -84,7 +84,7 @@ Follow this [document](docs/en/guides/How-to-build.md).
* Submit an [issue](https://github.com/apache/skywalking/issues)
* Mail list: **[email protected]**. Mail to `[email protected]`, follow the reply to subscribe the mail list.
* Join `#skywalking` channel at [Apache Slack](https://join.slack.com/t/the-asf/shared_invite/enQtNDQ3OTEwNzE1MDg5LWY2NjkwMTEzMGI2ZTI1NzUzMDk0MzJmMWM1NWVmODg0MzBjNjAxYzUwMjIwNDI3MjlhZWRjNmNhOTM5NmIxNDk)
* QQ Group: 392443393
* QQ Group: 392443393, 901167865

# Who Uses SkyWalking?
A wide variety of companies and organizations use SkyWalking for research, production and commercial product.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,24 @@
*/
public class ActiveSpan {
/**
* @param key tag key
* @param key tag key
* @param value tag value
*/
public static void tag(String key, String value) {
}

public static void error() {
}

public static void error(String errorMsg) {
}

public static void error(Throwable throwable) {
}

public static void debug(String debugMsg) {
}

public static void info(String infoMsg) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.skywalking.apm.commons.datacarrier.partition.IDataPartitioner;

/**
* Channels of Buffer It contais all buffer data which belongs to this channel. It supports several strategy when buffer
* Channels of Buffer It contains all buffer data which belongs to this channel. It supports several strategy when buffer
* is full. The Default is BLOCKING <p> Created by wusheng on 2016/10/25.
*/
public class Channels<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,33 @@

package org.apache.skywalking.apm.commons.datacarrier;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import java.lang.reflect.Field;
import java.util.Map;

import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;

/**
* @author dengming
* 2019-04-20
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest(EnvUtil.class)
public class EnvUtilTest {

private Map<String, String> writableEnv;
@Before
public void before() {
try {
Map<String, String> env = System.getenv();
Class<?> cl = env.getClass();
Field field = cl.getDeclaredField("m");
field.setAccessible(true);
writableEnv = (Map<String, String>) field.get(env);
writableEnv.put("myInt", "123");
writableEnv.put("wrongInt", "wrong123");
writableEnv.put("myLong", "12345678901234567");
writableEnv.put("wrongLong", "wrong123");
} catch (Exception e) {
throw new IllegalStateException("Failed to set environment variable", e);
}

PowerMockito.mockStatic(System.class);

when(System.getenv("myInt")).thenReturn("123");
when(System.getenv("wrongInt")).thenReturn("wrong123");
when(System.getenv("myLong")).thenReturn("12345678901234567");
when(System.getenv("wrongLong")).thenReturn("wrong123");
}

@Test
Expand All @@ -63,14 +59,4 @@ public void getLong() {
assertEquals(987654321987654321L, EnvUtil.getLong("wrongLong", 987654321987654321L));
}

@After
public void after() {
writableEnv.remove("myInt");
writableEnv.remove("wrongInt");
writableEnv.remove("myLong");
writableEnv.remove("wrongLong");
assertNull(System.getenv("myInt"));
}


}
2 changes: 2 additions & 0 deletions apm-dist/release-docs/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ The text of each license is also included at licenses/LICENSE-[project].txt.

Apache: groovy 2.4.5-indy: https://github.com/apache/groovy, Apache 2.0
Apache: httpcomponents 4.x.x: http://hc.apache.org/index.html, Apache 2.0
Apache: fastjson 1.2.47: https://github.com/alibaba/fastjson, Apache 2.0

========================================================================
Apache 2.0 licenses
Expand Down Expand Up @@ -307,6 +308,7 @@ The text of each license is the standard Apache 2.0 license.
consul-client 1.2.6: https://github.com/rickfast/consul-client, Apache 2.0
okhttp 3.9.0: https://github.com/square/okhttp, Apache 2.0
prometheus client_java 0.6.0: https://github.com/prometheus/client_java, Apache 2.0
nacos 1.0.0: https://github.com/alibaba/nacos, Apache 2.0
proto files from istio/istio: https://github.com/istio/istio Apache 2.0
proto files from istio/api: https://github.com/istio/api Apache 2.0
proto files from envoyproxy/data-plane-api: https://github.com/envoyproxy/data-plane-api Apache 2.0
Expand Down
38 changes: 38 additions & 0 deletions apm-dist/release-docs/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -831,3 +831,41 @@ from and not be held liable to the user for any such damages as noted
above as far as the program is concerned.

------

===========================================================================
nacos-1.0.0 Notice
===========================================================================
Nacos
Copyright 2018-2019 The Apache Software Foundation

This product includes software developed at
The Alibaba MiddleWare Group.

------
This product has a bundle Spring Boot:
The Spring Boot Project
=================

Please visit the Spring Boot web site for more information:

* https://spring.io/projects/spring-boot

Copyright 2014 The Spring Boot Project

The Spring Boot Project 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.

Also, please refer to each LICENSE.<component>.txt file, which is located in
the 'license' directory of the distribution file, for the license terms of the
components that this product depends on.

------
13 changes: 13 additions & 0 deletions apm-dist/release-docs/licenses/LICENSE-fastjson.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 1999-2019 Alibaba Group Holding Ltd.

Licensed 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.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void run() {
jvmBuilder.setTime(currentTimeMillis);
jvmBuilder.setCpu(CPUProvider.INSTANCE.getCpuMetric());
jvmBuilder.addAllMemory(MemoryProvider.INSTANCE.getMemoryMetricList());
jvmBuilder.addAllMemoryPool(MemoryPoolProvider.INSTANCE.getMemoryPoolMetricList());
jvmBuilder.addAllMemoryPool(MemoryPoolProvider.INSTANCE.getMemoryPoolMetricsList());
jvmBuilder.addAllGc(GCProvider.INSTANCE.getGCList());

JVMMetric jvmMetric = jvmBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@
package org.apache.skywalking.apm.agent.core.jvm.cpu;

import org.apache.skywalking.apm.network.common.CPU;
import org.apache.skywalking.apm.network.language.agent.*;

/**
* @author wusheng
*/
public abstract class CPUMetricAccessor {
public abstract class CPUMetricsAccessor {
private long lastCPUTimeNs;
private long lastSampleTimeNs;
private final int cpuCoreNum;

public CPUMetricAccessor(int cpuCoreNum) {
public CPUMetricsAccessor(int cpuCoreNum) {
this.cpuCoreNum = cpuCoreNum;
}

Expand All @@ -41,7 +40,7 @@ protected void init() {

protected abstract long getCpuTime();

public CPU getCPUMetric() {
public CPU getCPUMetrics() {
long cpuTime = this.getCpuTime();
long cpuCost = cpuTime - lastCPUTimeNs;
long now = System.nanoTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,28 @@
import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
import org.apache.skywalking.apm.agent.core.os.ProcessorUtil;
import org.apache.skywalking.apm.network.common.CPU;
import org.apache.skywalking.apm.network.language.agent.*;

/**
* @author wusheng
*/
public enum CPUProvider {
INSTANCE;
private CPUMetricAccessor cpuMetricAccessor;
private CPUMetricsAccessor cpuMetricsAccessor;

CPUProvider() {
int processorNum = ProcessorUtil.getNumberOfProcessors();
try {
this.cpuMetricAccessor =
(CPUMetricAccessor)CPUProvider.class.getClassLoader().loadClass("org.apache.skywalking.apm.agent.core.jvm.cpu.SunCpuAccessor")
this.cpuMetricsAccessor =
(CPUMetricsAccessor)CPUProvider.class.getClassLoader().loadClass("org.apache.skywalking.apm.agent.core.jvm.cpu.SunCpuAccessor")
.getConstructor(int.class).newInstance(processorNum);
} catch (Exception e) {
this.cpuMetricAccessor = new NoSupportedCPUAccessor(processorNum);
this.cpuMetricsAccessor = new NoSupportedCPUAccessor(processorNum);
ILog logger = LogManager.getLogger(CPUProvider.class);
logger.error(e, "Only support accessing CPU metric in SUN JVM platform.");
logger.error(e, "Only support accessing CPU metrics in SUN JVM platform.");
}
}

public CPU getCpuMetric() {
return cpuMetricAccessor.getCPUMetric();
return cpuMetricsAccessor.getCPUMetrics();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* @author wusheng
*/
public class NoSupportedCPUAccessor extends CPUMetricAccessor {
public class NoSupportedCPUAccessor extends CPUMetricsAccessor {
public NoSupportedCPUAccessor(int cpuCoreNum) {
super(cpuCoreNum);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @author wusheng
*/
public class SunCpuAccessor extends CPUMetricAccessor {
public class SunCpuAccessor extends CPUMetricsAccessor {
private final OperatingSystemMXBean osMBean;

public SunCpuAccessor(int cpuCoreNum) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
*
*/


package org.apache.skywalking.apm.agent.core.jvm.memorypool;

import java.util.List;
import org.apache.skywalking.apm.network.language.agent.*;
import org.apache.skywalking.apm.network.language.agent.MemoryPool;

/**
* @author wusheng
*/
public interface MemoryPoolMetricAccessor {
List<MemoryPool> getMemoryPoolMetricList();
public interface MemoryPoolMetricsAccessor {
List<MemoryPool> getMemoryPoolMetricsList();
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,24 @@
*
*/


package org.apache.skywalking.apm.agent.core.jvm.memorypool;

import java.lang.management.MemoryPoolMXBean;
import java.lang.management.MemoryUsage;
import java.util.LinkedList;
import java.util.List;
import java.lang.management.*;
import java.util.*;
import org.apache.skywalking.apm.network.language.agent.*;

/**
* @author wusheng
*/
public abstract class MemoryPoolModule implements MemoryPoolMetricAccessor {
public abstract class MemoryPoolModule implements MemoryPoolMetricsAccessor {
private List<MemoryPoolMXBean> beans;

public MemoryPoolModule(List<MemoryPoolMXBean> beans) {
this.beans = beans;
}

@Override
public List<MemoryPool> getMemoryPoolMetricList() {
public List<MemoryPool> getMemoryPoolMetricsList() {
List<MemoryPool> poolList = new LinkedList<MemoryPool>();
for (MemoryPoolMXBean bean : beans) {
String name = bean.getName();
Expand Down
Loading

0 comments on commit abe5ff7

Please sign in to comment.