Skip to content

LCORE-1249: Benchmarks for retrieving conversation for one user#1140

Merged
tisnik merged 1 commit into
lightspeed-core:mainfrom
tisnik:lcore-1249-benchmarks-for-retrieve-conversation-for-one-user
Feb 12, 2026
Merged

LCORE-1249: Benchmarks for retrieving conversation for one user#1140
tisnik merged 1 commit into
lightspeed-core:mainfrom
tisnik:lcore-1249-benchmarks-for-retrieve-conversation-for-one-user

Conversation

@tisnik
Copy link
Copy Markdown
Contributor

@tisnik tisnik commented Feb 12, 2026

Description

LCORE-1249: Benchmarks for retrieving conversation for one user

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

  • Assisted-by: N/A
  • Generated by: N/A

Related Tickets & Documents

  • Related Issue #LCORE-1249

Summary by CodeRabbit

  • Tests
    • Added performance benchmarks for single-user conversation retrieval across multiple database sizes to track query performance metrics.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 12, 2026

Walkthrough

This PR adds benchmark tests for retrieving user-scoped conversations from the database. A helper function queries UserConversation by conversation ID and user ID, with a benchmark function and four test entry points exercising the operation across empty, small, middle, and large database sizes.

Changes

Cohort / File(s) Summary
Benchmark Tests for User-Scoped Conversation Retrieval
tests/benchmarks/test_app_database.py
Introduces retrieve_conversation_for_one_user() helper to query conversations filtered by both user ID and conversation ID. Adds benchmark_retrieve_conversation_for_one_user() benchmark function and four test entry points (test_retrieve_conversation_for_one_user_empty_db, test_retrieve_conversation_for_one_user_small_db, test_retrieve_conversation_for_one_user_middle_db, test_retrieve_conversation_for_one_user_large_db) to measure performance across various database scales.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding benchmarks for retrieving conversation for one user, which matches the PR content.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
tests/benchmarks/test_app_database.py (1)

337-341: Incomplete docstring — parameters user_id, conversation_id, and should_be_none are undocumented.

The docstring only documents session but the function takes four parameters. The existing retrieve_conversation has the same gap, but since this is new code it's a good opportunity to document all parameters.

📝 Proposed docstring fix
     """Query and assert retrieval of one conversation.

     This helper function retrieves one given conversation from a database. It
     is intended for use in a benchmark that measures the listing performance.

     Parameters:
         session (Session): SQLAlchemy session used to query conversations.
+        user_id (str): User ID to filter on.
+        conversation_id (str): Conversation ID to filter on.
+        should_be_none (bool): If True, assert the result is None; otherwise
+            assert it is not None.

     Returns:
         None
     """

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tisnik
Copy link
Copy Markdown
Contributor Author

tisnik commented Feb 12, 2026

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tisnik tisnik merged commit 6747f34 into lightspeed-core:main Feb 12, 2026
22 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Feb 15, 2026
16 tasks
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