Skip to content
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

fix: missing requests and their timestamps #1405

Merged
merged 1 commit into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified pkg/hooks/bpf_bpfel_arm64.o
Binary file not shown.
5 changes: 2 additions & 3 deletions pkg/hooks/connection/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (conn *Tracker) IsComplete() (bool, []byte, []byte, time.Time, time.Time) {

// // decrease the recTestCounter
conn.decRecordTestCount()
conn.logger.Info("verified recording", zap.Any("recordTraffic", recordTraffic))
conn.logger.Debug("verified recording", zap.Any("recordTraffic", recordTraffic))
} else if conn.lastChunkWasResp && elapsedTime >= uint64(time.Second*2) { // Check if 2 seconds has passed since the last activity.
conn.logger.Debug("might be last request on the connection")

Expand Down Expand Up @@ -233,7 +233,7 @@ func (conn *Tracker) IsComplete() (bool, []byte, []byte, time.Time, time.Time) {
// this can be to avoid potential corruption in the connection
conn.reset()

conn.logger.Info("unverified recording", zap.Any("recordTraffic", recordTraffic))
conn.logger.Debug("unverified recording", zap.Any("recordTraffic", recordTraffic))
}

var reqTimestamps time.Time
Expand Down Expand Up @@ -337,7 +337,6 @@ func (conn *Tracker) AddDataEvent(event structs2.SocketDataEvent) {

//Handling multiple request on same connection to support connection:keep-alive
if conn.firstRequest || conn.lastChunkWasReq {
fmt.Println("req size before getting response is:", conn.reqSize, event.ValidateReadBytes)
conn.userReqSizes = append(conn.userReqSizes, conn.reqSize)
conn.reqSize = 0

Expand Down
1 change: 0 additions & 1 deletion pkg/hooks/ringBufReader.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ func socketDataEventCallback(reader *ringbuf.Reader, connectionFactory *connecti
continue
}

fmt.Println("please delete me from socketDataEventCallback")

data := record.RawSample
if len(data) < eventAttributesSize {
Expand Down
Loading