提交 ce81b2ee 编写于 作者: A ascrutae

移除无用测试类

上级 6c4213a9
package com.a.eye.skywalking.storage;
import com.a.eye.skywalking.storage.data.file.DataFileNameDesc;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
/**
* Created by xin on 2016/11/30.
*/
public class TestFile {
public static void main(String[] args) throws IOException {
// File file = new File("/Users/xin/workbench/data/file", "2016_11_29_23_02_55_517_1000");
// System.out.println(file.length());
//
// FileInputStream byteInputStream = new FileInputStream(file);
// byte[] bytes = new byte[1024];
// int count = 0;
// int length = 0;
// while ((count = byteInputStream.read(bytes)) != -1) {
// length += count;
// }
//
// System.out.println(length);
long startTime = System.currentTimeMillis();
System.out.println(startTime);
System.out.println(new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss_SSS").format(startTime));
}
}
package com.a.eye.skywalking.storage;
import com.a.eye.skywalking.health.report.HealthCollector;
import com.a.eye.skywalking.health.report.HeathReading;
import com.a.eye.skywalking.storage.config.Config;
import com.a.eye.skywalking.storage.data.spandata.RequestSpanData;
import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.RingBuffer;
import com.lmax.disruptor.dsl.Disruptor;
import com.lmax.disruptor.util.DaemonThreadFactory;
/**
* Created by xin on 2016/12/7.
*/
public class TestMain {
public static void main(String[] args) throws InterruptedException {
Disruptor<StringBuilder> requestSpanDataDisruptor = null;
requestSpanDataDisruptor = new Disruptor<StringBuilder>(new StringBuilderFactory(), Config.Disruptor.BUFFER_SIZE, DaemonThreadFactory.INSTANCE);
requestSpanDataDisruptor.handleEventsWith(new EventHandler<StringBuilder>() {
@Override
public void onEvent(StringBuilder event, long sequence, boolean endOfBatch) throws Exception {
System.out.println("AA: " + event);
}
}, new EventHandler<StringBuilder>() {
@Override
public void onEvent(StringBuilder event, long sequence, boolean endOfBatch) throws Exception {
System.out.println("BB: " + event);
}
});
requestSpanDataDisruptor.start();
RingBuffer<StringBuilder> stringBuilderRingBuffer = requestSpanDataDisruptor.getRingBuffer();
long sequence = stringBuilderRingBuffer.next(); // Grab the next sequence
try {
StringBuilder data = stringBuilderRingBuffer.get(sequence);
data.append("A");
} catch (Exception e) {
} finally {
stringBuilderRingBuffer.publish(sequence);
}
Thread.sleep(1000);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册