Skip to content

perf(metrics): remove per-send completion promises - #820

Merged
joeyzhao2018 merged 4 commits into
mainfrom
BridgeAR/2026-08-28-metrics-completion
Sep 1, 2026
Merged

perf(metrics): remove per-send completion promises#820
joeyzhao2018 merged 4 commits into
mainfrom
BridgeAR/2026-08-28-metrics-completion

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Track DogStatsD completion through socket callbacks instead of allocating and retaining one promise per send. A flush creates one promise and timeout only while sends remain.

A generation counter isolates callbacks from timed-out flushes. Sampled allocations decreased by 18.60 MiB across 5,000 invocations (1.835%).

Each DogStatsD send allocated a promise although dgram already reports completion through its callback. A generation counter prevents late callbacks from a timed-out flush from completing a later flush.

Sampled allocations decreased by 18.60 MiB across 5,000 invocations (1.835%).
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 28, 2026

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 1 Pipeline job failed

DataDog/datadog-lambda-js | publish layer sandbox (node24): [us-west-2]

View more details · View in GitLab

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0961d23 | Docs | View more details | Give us feedback!

Error callbacks and synchronous send failures must settle without falling through to the flush timeout.
@BridgeAR
BridgeAR marked this pull request as ready for review August 28, 2026 20:54
@BridgeAR
BridgeAR requested review from a team as code owners August 28, 2026 20:54
@BridgeAR
BridgeAR requested a review from lym953 August 28, 2026 20:54
@joeyzhao2018
joeyzhao2018 merged commit 965c99f into main Sep 1, 2026
52 of 54 checks passed
@joeyzhao2018
joeyzhao2018 deleted the BridgeAR/2026-08-28-metrics-completion branch September 1, 2026 18:34
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.

2 participants