Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
5b65fa5a
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 1 年多
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5b65fa5a
编写于
11月 27, 2016
作者:
wu-sheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lock cause by zkclient
上级
f3539eae
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
15 deletion
+8
-15
skywalking-network/src/main/java/com/a/eye/skywalking/network/grpc/client/SpanStorageClient.java
...eye/skywalking/network/grpc/client/SpanStorageClient.java
+2
-11
skywalking-storage-center/skywalking-storage/src/test/java/StorageClient.java
...enter/skywalking-storage/src/test/java/StorageClient.java
+1
-1
skywalking-storage-center/skywalking-storage/src/test/java/StorageThread.java
...enter/skywalking-storage/src/test/java/StorageThread.java
+5
-3
未找到文件。
skywalking-network/src/main/java/com/a/eye/skywalking/network/grpc/client/SpanStorageClient.java
浏览文件 @
5b65fa5a
...
...
@@ -27,6 +27,7 @@ public class SpanStorageClient {
StreamObserver
<
RequestSpan
>
requestSpanStreamObserver
=
spanStorageStub
.
storageRequestSpan
(
new
StreamObserver
<
SendResult
>()
{
@Override
public
void
onNext
(
SendResult
sendResult
)
{
listener
.
onBatchFinished
();
}
@Override
...
...
@@ -36,7 +37,6 @@ public class SpanStorageClient {
@Override
public
void
onCompleted
()
{
listener
.
onBatchFinished
();
}
});
...
...
@@ -44,10 +44,6 @@ public class SpanStorageClient {
requestSpanStreamObserver
.
onNext
(
span
);
}
while
(!((
CallStreamObserver
<
RequestSpan
>)
requestSpanStreamObserver
).
isReady
())
{
LockSupport
.
parkNanos
(
1
);
}
requestSpanStreamObserver
.
onCompleted
();
}
...
...
@@ -55,7 +51,7 @@ public class SpanStorageClient {
StreamObserver
<
AckSpan
>
ackSpanStreamObserver
=
spanStorageStub
.
storageACKSpan
(
new
StreamObserver
<
SendResult
>()
{
@Override
public
void
onNext
(
SendResult
sendResult
)
{
listener
.
onBatchFinished
();
}
@Override
...
...
@@ -65,7 +61,6 @@ public class SpanStorageClient {
@Override
public
void
onCompleted
()
{
listener
.
onBatchFinished
();
}
});
...
...
@@ -73,10 +68,6 @@ public class SpanStorageClient {
ackSpanStreamObserver
.
onNext
(
span
);
}
while
(!((
CallStreamObserver
<
AckSpan
>)
ackSpanStreamObserver
).
isReady
())
{
LockSupport
.
parkNanos
(
1
);
}
ackSpanStreamObserver
.
onCompleted
();
}
...
...
skywalking-storage-center/skywalking-storage/src/test/java/StorageClient.java
浏览文件 @
5b65fa5a
...
...
@@ -11,7 +11,7 @@ public class StorageClient {
CountDownLatch
countDownLatch
=
new
CountDownLatch
(
THREAD_COUNT
);
for
(
int
i
=
0
;
i
<
THREAD_COUNT
;
i
++)
{
new
StorageThread
(
COUNT
,
countDownLatch
).
start
();
new
StorageThread
(
COUNT
,
countDownLatch
,
i
).
start
();
}
countDownLatch
.
await
();
...
...
skywalking-storage-center/skywalking-storage/src/test/java/StorageThread.java
浏览文件 @
5b65fa5a
...
...
@@ -18,13 +18,15 @@ public class StorageThread extends Thread {
private
long
count
;
private
CountDownLatch
countDownLatch
;
private
MyStorageClientListener
listener
;
private
int
index
;
StorageThread
(
long
count
,
CountDownLatch
countDownLatch
)
{
StorageThread
(
long
count
,
CountDownLatch
countDownLatch
,
int
index
)
{
listener
=
new
MyStorageClientListener
();
client
=
new
Client
(
"127.0.0.1"
,
34000
).
newSpanStorageClient
(
listener
);
this
.
count
=
count
;
this
.
countDownLatch
=
countDownLatch
;
this
.
index
=
index
;
}
@Override
...
...
@@ -44,7 +46,7 @@ public class StorageThread extends Thread {
TraceId
.
newBuilder
().
addSegments
(
201611
).
addSegments
(
value
).
addSegments
(
8504828
).
addSegments
(
2277
).
addSegments
(
Thread
.
currentThread
().
getId
()).
addSegments
(
3
)
.
build
()).
setStatusCode
(
0
).
setViewpointId
(
"http://localhost:8080/wwww/test/helloWorld"
).
build
();
if
(
cycle
==
10
)
{
if
(
cycle
==
10
0
)
{
client
.
sendACKSpan
(
ackSpanList
);
client
.
sendRequestSpan
(
requestSpanList
);
cycle
=
0
;
...
...
@@ -62,7 +64,7 @@ public class StorageThread extends Thread {
cycle
++;
if
(
i
%
10_000
==
0
)
{
System
.
out
.
println
(
i
+
" "
+
value
);
System
.
out
.
println
(
"index-"
+
index
+
" num="
+
i
+
" "
+
value
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录