Skip to content

Use EnumSet to classify lettuce-5 commands - #12288

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
masterfrom
andrea.marziali/test-lettuce
Aug 26, 2026
Merged

Use EnumSet to classify lettuce-5 commands#12288
gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
masterfrom
andrea.marziali/test-lettuce

Conversation

@amarziali

Copy link
Copy Markdown
Contributor

What Does This Do

Replaces the String-based NON_INSTRUMENTING_COMMAND_WORDS/AGENT_CRASHING_COMMANDS_WORDS sets in lettuce-5.0's LettuceInstrumentationUtil with EnumSet, guarded by instanceof CommandType (matching the existing lettuce-4.0 pattern, since RedisCommand.getType() returns the ProtocolKeyword interface and custom/user-dispatched commands aren't guaranteed to be CommandType).

This avoids a per-command toString()/trim() string allocation plus hash-based lookup on every single Redis command, replaced with an allocation-free enum bit-test.

JMH run:

Scenario Old (Set<String>) New (EnumSet<CommandType>) Δ
Miss (GET/SET/etc. — ~100% of real traffic) 277.9M ± 3.3M ops/s 308.3M ± 1.6M ops/s +10.9%
Hit (DEBUG/SHUTDOWN — rare in practice) 377.8M ± 1.7M ops/s 537.7M ± 2.0M ops/s +42.3%

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@amarziali

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 039ef26f94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 69.74% (+10.95%)

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

@dd-octo-sts

dd-octo-sts Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.04 s 13.87 s [+0.5%; +2.0%] (maybe worse)
startup:insecure-bank:tracing:Agent 12.90 s 12.95 s [-1.1%; +0.3%] (no difference)
startup:petclinic:appsec:Agent 17.54 s 17.31 s [+0.2%; +2.4%] (maybe worse)
startup:petclinic:iast:Agent 17.49 s 17.03 s [-2.9%; +8.3%] (unstable)
startup:petclinic:profiling:Agent 17.46 s 17.44 s [-1.0%; +1.3%] (no difference)
startup:petclinic:sca:Agent 17.38 s 17.30 s [-0.6%; +1.5%] (no difference)
startup:petclinic:tracing:Agent 16.52 s 16.77 s [-2.6%; -0.5%] (maybe better)

Commit: f2408b5e · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@amarziali

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: df04581fb3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@amarziali
amarziali marked this pull request as ready for review August 25, 2026 17:51
@amarziali
amarziali requested review from a team as code owners August 25, 2026 17:51
@amarziali
amarziali requested review from sarahchen6 and vandonr and removed request for a team August 25, 2026 17:51
@dd-octo-sts

dd-octo-sts Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@sarahchen6 sarahchen6 added type: feature Enhancements and improvements inst: lettuce Lettuce instrumentation labels Aug 25, 2026

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot 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.

Datadog Autotest: PASS

More details

The enum checks keep the prior command classes. The fallback keeps the prior string behavior for custom protocol keywords.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit df04581 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@sarahchen6 sarahchen6 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.

Nice!

@vandonr vandonr 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.

looks good modulo a little bit of duplication that I think we could get rid of

@bric3 bric3 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.

Pre-approving.

With this comment it looks good too : #12288 (comment)

@amarziali

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 26, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-26 14:36:38 UTC ℹ️ Start processing command /merge


2026-08-26 14:36:43 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 2h (p90).


2026-08-26 15:43:08 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit a0d6094 into master Aug 26, 2026
600 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the andrea.marziali/test-lettuce branch August 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: lettuce Lettuce instrumentation type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants