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

Stop capturing data from kernel when collected records num reached --max-records option #226

Open
hengyoush opened this issue Dec 29, 2024 · 0 comments
Labels
enhancement New feature or request feature-request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@hengyoush
Copy link
Owner

Is your feature request related to a problem? Please describe.
Currently when the collected records num reached --max-records still capture data from kernel, we need to stop collection or close bpf program directly.

Describe the solution you'd like
One solution may be modifying the conn.RecordFunc at agent.go:

conn.RecordFunc = func(r protocol.Record, c *conn.Connection4) error {
        // Add some logic here: when reached the  `--max-records`, invoke `_bf.Close()`
	return statRecorder.ReceiveRecord(r, c, recordsChannel)
}
@hengyoush hengyoush added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Dec 29, 2024
@hengyoush hengyoush changed the title Stopping capture data from kernel when collected records num reached --max-records option Stop capturing data from kernel when collected records num reached --max-records option Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature-request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant