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

Add Double Buffering for Live Metrics Document. #39828

Merged

Conversation

rajkumar-rangaraj
Copy link
Contributor

Added a double buffering system to enable writing to one buffer while simultaneously reading from another. Added the DocumentBuffer class for managing document ingress, along with the DoubleBuffer class to implement the double-buffering mechanism, allowing for concurrent writes to one buffer while the other is being read.

Usage

  • To add documents: WriteDocument(DocumentIngress document)
  • To flip buffers and process documents: FlipDocumentBuffers()

Impact

  • Performance: Double buffering minimizes lock contention, leading to improved throughput and lower latency in high-concurrency environments.
  • Reliability: Separates the concerns of writing and reading, reducing the complexity of synchronization.
  • Maintainability: Encapsulates buffering logic within two clear methods, promoting cleaner code.

Copy link
Contributor

@TimothyMothra TimothyMothra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left one minor comment

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@rajkumar-rangaraj rajkumar-rangaraj merged commit 8c51300 into Azure:main Nov 8, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants