Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make telemetry batch size configurable and add time-based flush #622

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

Open
wants to merge 4 commits into
base: telemetry
Choose a base branch
from

Conversation

saishreeeee
Copy link
Collaborator

@saishreeeee saishreeeee commented Jul 1, 2025

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Other

Description

The flush timer is centralized in TelemetryClientFactory, single background thread to manage all connections. Keeping it in TelemetryClient would mean creating a timer thread per connection.

Used threading.Thread with threading.Event. The threading.Event acts as a thread-safe shutdown signal, and its wait(timeout) method allows the thread to wait for the next flush interval while remaining immediately responsive to a shutdown command.
While threading.Timer could be used, it would create a new thread every flush interval as we need to create a timer after each execution.

How is this tested?

  • Unit tests
  • E2E Tests
  • Manually
  • N/A

Related Tickets & Documents

design doc

Signed-off-by: Sai Shree Pradhan <[email protected]>
…TelemetryClientFactory

Signed-off-by: Sai Shree Pradhan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant