-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support rocketMQ #231
Open
XmchxUp
wants to merge
19
commits into
hengyoush:main
Choose a base branch
from
XmchxUp:xmchx/feat_support_rocketmq
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
1e0025c
update
XmchxUp fc38964
update
XmchxUp 28798f3
docs: introduce `prettier` and `md-padding` to format all docs (#221)
spencercjh f677d60
fix: add fallback logic to calculate totaltime when nicin event misse…
hengyoush 537a08a
test: introduce a script to test flag `--comm` (#222)
spencercjh fc80653
update
XmchxUp 5b99af1
Merge branch 'hengyoush:main' into xmchx/feat_support_rocketmq
XmchxUp d8f722c
update
XmchxUp 810f58e
Merge branch 'hengyoush:main' into xmchx/feat_support_rocketmq
XmchxUp 6f32563
update
XmchxUp 541008b
update
XmchxUp 63345cf
update
XmchxUp 2e22617
update
XmchxUp 47d46ca
update
XmchxUp 94a107e
Merge branch 'hengyoush:main' into xmchx/feat_support_rocketmq
XmchxUp 1b7d62b
update
XmchxUp 1b874e7
update
XmchxUp c4d4adc
Merge branch 'hengyoush:main' into xmchx/feat_support_rocketmq
XmchxUp f0bf0d4
update
XmchxUp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package rocketmq | ||
|
||
import ( | ||
"kyanos/agent/protocol" | ||
"kyanos/bpf" | ||
) | ||
|
||
type Filter struct { | ||
} | ||
|
||
func (m Filter) Filter(req protocol.ParsedMessage, resp protocol.ParsedMessage) bool { | ||
return true | ||
} | ||
|
||
func (m Filter) FilterByProtocol(p bpf.AgentTrafficProtocolT) bool { | ||
return p == bpf.AgentTrafficProtocolTKProtocolRocketMQ | ||
} | ||
|
||
func (m Filter) FilterByRequest() bool { | ||
return false | ||
} | ||
|
||
func (m Filter) FilterByResponse() bool { | ||
return false | ||
} | ||
|
||
var _ protocol.ProtocolFilter = Filter{} |
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,105 @@ | ||
package rocketmq | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
) | ||
|
||
type LanguageCode byte | ||
|
||
const ( | ||
JAVA LanguageCode = iota // 0 | ||
CPP // 1 | ||
DOTNET // 2 | ||
PYTHON // 3 | ||
DELPHI // 4 | ||
ERLANG // 5 | ||
RUBY // 6 | ||
OTHER // 7 | ||
HTTP // 8 | ||
GO // 9 | ||
PHP // 10 | ||
OMS // 11 | ||
RUST // 12 | ||
NODE_JS // 13 | ||
UNKNOWN | ||
) | ||
|
||
// convertToLanguageCode converts a string to a LanguageCode. | ||
func convertToLanguageCode(language string) (LanguageCode, error) { | ||
switch language { | ||
case "JAVA": | ||
return JAVA, nil | ||
case "CPP": | ||
return CPP, nil | ||
case "DOTNET": | ||
return DOTNET, nil | ||
case "PYTHON": | ||
return PYTHON, nil | ||
case "DELPHI": | ||
return DELPHI, nil | ||
case "ERLANG": | ||
return ERLANG, nil | ||
case "RUBY": | ||
return RUBY, nil | ||
case "OTHER": | ||
return OTHER, nil | ||
case "HTTP": | ||
return HTTP, nil | ||
case "GO": | ||
return GO, nil | ||
case "PHP": | ||
return PHP, nil | ||
case "OMS": | ||
return OMS, nil | ||
case "RUST": | ||
return RUST, nil | ||
case "NODE_JS": | ||
return NODE_JS, nil | ||
default: | ||
return 13, errors.New("unknown language: " + language) | ||
} | ||
} | ||
|
||
// convertToLanguageCodeFromByte converts a byte to a LanguageCode. | ||
func convertToLanguageCodeFromByte(flag byte) (LanguageCode, error) { | ||
if flag > 13 { | ||
return 0, errors.New("unknown language flag: " + fmt.Sprint(flag)) | ||
} | ||
return LanguageCode(flag), nil | ||
} | ||
|
||
func (lc LanguageCode) String() string { | ||
switch lc { | ||
case JAVA: | ||
return "JAVA" | ||
case CPP: | ||
return "CPP" | ||
case DOTNET: | ||
return "DOTNET" | ||
case PYTHON: | ||
return "PYTHON" | ||
case DELPHI: | ||
return "DELPHI" | ||
case ERLANG: | ||
return "ERLANG" | ||
case RUBY: | ||
return "RUBY" | ||
case OTHER: | ||
return "OTHER" | ||
case HTTP: | ||
return "HTTP" | ||
case GO: | ||
return "GO" | ||
case PHP: | ||
return "PHP" | ||
case OMS: | ||
return "OMS" | ||
case RUST: | ||
return "RUST" | ||
case NODE_JS: | ||
return "NODE_JS" | ||
default: | ||
return "UNKNOWN" | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add some filter options and implement the filter logic here.