mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-16 23:03:51 +00:00
Move the request-response matcher's scope from global-level to TCP stream-level (#793)
* Create a new request-response matcher for each TCP stream * Fix the `ident` formats in request-response matchers * Don't sort the items in the HTTP tests * Update tap/extensions/kafka/matcher.go Co-authored-by: gadotroee <55343099+gadotroee@users.noreply.github.com> * Temporarily change the bucket folder to the new expected * Bring back the `deleteOlderThan` method * Use `api.RequestResponseMatcher` instead of `interface{}` as type * Use `api.RequestResponseMatcher` instead of `interface{}` as type (more) * Update the key format comments Co-authored-by: gadotroee <55343099+gadotroee@users.noreply.github.com>
This commit is contained in:
@@ -7,16 +7,17 @@ import (
|
||||
"github.com/up9inc/mizu/tap/api"
|
||||
)
|
||||
|
||||
var reqResMatcher = createResponseRequestMatcher() // global
|
||||
|
||||
// Key is `{stream_id}_{src_ip}:{dst_ip}_{src_ip}:{src_port}_{incremental_counter}`
|
||||
// Key is `{src_ip}_{dst_ip}_{src_ip}_{src_port}_{incremental_counter}`
|
||||
type requestResponseMatcher struct {
|
||||
openMessagesMap *sync.Map
|
||||
}
|
||||
|
||||
func createResponseRequestMatcher() requestResponseMatcher {
|
||||
newMatcher := &requestResponseMatcher{openMessagesMap: &sync.Map{}}
|
||||
return *newMatcher
|
||||
func createResponseRequestMatcher() api.RequestResponseMatcher {
|
||||
return &requestResponseMatcher{openMessagesMap: &sync.Map{}}
|
||||
}
|
||||
|
||||
func (matcher *requestResponseMatcher) GetMap() *sync.Map {
|
||||
return matcher.openMessagesMap
|
||||
}
|
||||
|
||||
func (matcher *requestResponseMatcher) registerRequest(ident string, request *RedisPacket, captureTime time.Time) *api.OutputChannelItem {
|
||||
|
Reference in New Issue
Block a user