1. 修改配置
This commit is contained in:
parent
30adda16a8
commit
8c721e2cd9
|
|
@ -18,6 +18,11 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-auth</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ public class CallChainD {
|
|||
|
||||
@Tracing
|
||||
public void doBusiness() {
|
||||
System.out.println("three");
|
||||
//System.out.println("three");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ public class CallChainE {
|
|||
|
||||
@Tracing
|
||||
public void doBusiness() {
|
||||
System.out.println("I'm here");
|
||||
// System.out.println("I'm here");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ public class CallChainF {
|
|||
|
||||
@Tracing
|
||||
public void doBusiness() {
|
||||
System.out.println("me too");
|
||||
//System.out.println("me too");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,56 @@ package com.ai.cloud.skywalking.plugin.spring.common;
|
|||
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
public class TestBuriedPoint {
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public static void main(String[] args) {
|
||||
public class TestBuriedPoint extends Thread {
|
||||
|
||||
private static final int MAX_THREAD_SIZE = 1;
|
||||
private CallChainA callChainA;
|
||||
AtomicInteger atomicInteger = new AtomicInteger();
|
||||
|
||||
public TestBuriedPoint(CallChainA callChainA) {
|
||||
this.callChainA = callChainA;
|
||||
}
|
||||
|
||||
private Timer timer = new Timer(Thread.currentThread().getName());
|
||||
|
||||
public TestBuriedPoint() {
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(atomicInteger.get());
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
while (true) {
|
||||
try {
|
||||
Thread.sleep(2L);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
callChainA.doBusiness();
|
||||
System.out.println(Thread.currentThread().getName() + "\t" + atomicInteger.incrementAndGet());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("classpath*:springConfig-common.xml");
|
||||
CallChainA callChainA = classPathXmlApplicationContext.getBean(CallChainA.class);
|
||||
callChainA.doBusiness();
|
||||
CountDownLatch countDownLatch = new CountDownLatch(10);
|
||||
for (int i = 0; i < MAX_THREAD_SIZE; i++) {
|
||||
new TestBuriedPoint(callChainA).start();
|
||||
}
|
||||
|
||||
countDownLatch.await();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue