Skip to content

delay_serialization: implement feature#277

Merged
remeh merged 1 commit into
DataDog:masterfrom
pudiva:delay_serialization
Jul 5, 2023
Merged

delay_serialization: implement feature#277
remeh merged 1 commit into
DataDog:masterfrom
pudiva:delay_serialization

Conversation

@pudiva

@pudiva pudiva commented Jun 7, 2023

Copy link
Copy Markdown
Contributor

Add the delay_serialization option, allowing users to delay expensive serialization until a more convenient time, such as after an HTTP request has completed. In multi-threaded mode, it causes serialization to happen inside the sender thread.

Also, support the sender_queue_size in single_thread mode, so that it can benefit from the new delay_serialization option. Messages are now queued (possibly unserialized) until sender_queue_size is reached or #flush is called. It may be set to Float::INFINITY, so that messages are indefinitely queued until an explicit #flush.

Fix #271

@pudiva
pudiva requested a review from remeh as a code owner June 7, 2023 17:21
@pudiva
pudiva force-pushed the delay_serialization branch 4 times, most recently from 2e51125 to d457d9e Compare June 7, 2023 18:42
@pudiva

pudiva commented Jun 7, 2023

Copy link
Copy Markdown
Contributor Author

cc @BlakeWilliams

@pudiva
pudiva force-pushed the delay_serialization branch from d457d9e to 378d519 Compare June 7, 2023 18:45
@remeh

remeh commented Jun 13, 2023

Copy link
Copy Markdown
Contributor

Hey @pudiva, thanks a lot for the PR. I'll do my best to give it a look soon 🙇

@remeh remeh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot for the quality PR. I don't have anything major to report, it's elegantly integrated to the current codebase. I just left a remark, let me know WDYT and then we'll merge this one!

Comment thread lib/datadog/statsd/single_thread_sender.rb Outdated
Comment thread CHANGELOG.md
Comment thread README.md Outdated
@pudiva
pudiva force-pushed the delay_serialization branch from 378d519 to 57f3b23 Compare July 4, 2023 21:53
Add the `delay_serialization` option, allowing users to delay expensive
serialization until a more convenient time, such as after an HTTP
request has completed. In multi-threaded mode, it causes serialization
to happen inside the sender thread.

Also, support the `sender_queue_size` in `single_thread` mode, so that
it can benefit from the new `delay_serialization` option. Messages are
now queued (possibly unserialized) until `sender_queue_size` is reached
or `#flush` is called. It may be set to `Float::INFINITY`, so that
messages are indefinitely queued until an explicit `#flush`.

Fix DataDog#271

Co-Authored-By: Blake Williams <[email protected]>
@pudiva
pudiva force-pushed the delay_serialization branch from 57f3b23 to 2f65360 Compare July 5, 2023 10:16
@remeh
remeh merged commit 0bea929 into DataDog:master Jul 5, 2023
@remeh

remeh commented Jul 5, 2023

Copy link
Copy Markdown
Contributor

This will be part of next release (which should happen before the end of next week). Thanks again!

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.

Delay metric serialisation until flush

2 participants