-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix networkanalyzer nil pointer if the protocol is NOSUPPORT with nil…
… attributes (#416) Signed-off-by: huxiangyuan <huxiangyuan@harmonycloud.cn>
- Loading branch information
1 parent
b86eb37
commit 400d7ce
Showing
5 changed files
with
96 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,5 @@ analyzers: | |
slow_threshold: 100 | ||
- key: "rocketmq" | ||
slow_threshold: 500 | ||
- key: "NOSUPPORT" | ||
ports: [ 1111 ] |
25 changes: 25 additions & 0 deletions
25
collector/pkg/component/analyzer/network/protocol/testdata/nosupport/server-event.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# localhost:49368 -> localhost:1111 | ||
eventCommon: | ||
# SYSCALL_EXIT | ||
source: 2 | ||
# CAT_NET | ||
category: 3 | ||
ctx: | ||
thread_info: | ||
pid: 100 | ||
tid: 101 | ||
uid: 1 | ||
gid: 1 | ||
comm: "test" | ||
fd_info: | ||
num: 4 | ||
# FD_IPV4_SOCK | ||
type_fd: 3 | ||
# TCP | ||
protocol: 1 | ||
# IsServer | ||
role: true | ||
sip: [16777343] | ||
sport: 49368 | ||
dip: [16777343] | ||
dport: 1111 |
51 changes: 51 additions & 0 deletions
51
collector/pkg/component/analyzer/network/protocol/testdata/nosupport/server-trace-normal.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
trace: | ||
key: normal | ||
requests: | ||
- | ||
name: "recvfrom" | ||
timestamp: 100000000 | ||
user_attributes: | ||
latency: 2000 | ||
res: 15 | ||
data: | ||
- "This is a query" | ||
responses: | ||
- | ||
name: "sendto" | ||
timestamp: 100020000 | ||
user_attributes: | ||
latency: 15000 | ||
res: 18 | ||
data: | ||
- "This is a response" | ||
expects: | ||
- | ||
Timestamp: 99998000 | ||
Values: | ||
request_total_time: 22000 | ||
connect_time: 0 | ||
request_sent_time: 2000 | ||
waiting_ttfb_time: 5000 | ||
content_download_time: 15000 | ||
request_io: 15 | ||
response_io: 18 | ||
Labels: | ||
comm: "test" | ||
pid: 100 | ||
request_tid: 101 | ||
response_tid: 101 | ||
src_ip: "127.0.0.1" | ||
src_port: 49368 | ||
dst_ip: "127.0.0.1" | ||
dst_port: 1111 | ||
dnat_ip: "" | ||
dnat_port: -1 | ||
container_id: "" | ||
is_slow: false | ||
is_server: true | ||
protocol: "NOSUPPORT" | ||
request_payload: "This is a query" | ||
response_payload: "This is a response" | ||
is_error: false | ||
error_type: 0 | ||
end_timestamp: 100020000 |