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

perf: improve /logs concurrent access #2633

Merged
merged 4 commits into from
Jul 11, 2024

Conversation

nicoloboschi
Copy link
Contributor

Some improvements:

  • instead of using an ordered dict we use a simple deque. The messages are already ordered by loguru.
  • Locking is necessary for readers too since it could lead to incosistent data view and duplicate data
  • /logs endpoint was returning empty with some combinations of parameters
  • timestamp are now millis instead of float epoch
  • keepalive is sent every 5 seconds instead of 1
  • /logs always return messages sorted by time desc for consistency

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. python Pull requests that update Python code labels Jul 11, 2024
Copy link
Contributor

Pull Request Validation Report

This comment is automatically generated by Conventional PR

Whitelist Report

Whitelist Active Result
Pull request is a draft and should be ignored
Pull request is made by a whitelisted user and should be ignored
Pull request is submitted by a bot and should be ignored
Pull request is submitted by administrators and should be ignored

Result

Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated.

Validation Report

Validation Active Result
All commits in this pull request has valid messages
Pull request does not introduce too many changes
Pull request has a valid title
Pull request has mentioned issues
Pull request has valid branch name
Pull request should have a non-empty body

Result

Pull request satisfies all enabled pull request rules.

Last Modified at 11 Jul 24 11:42 UTC

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 11, 2024
@nicoloboschi nicoloboschi enabled auto-merge (squash) July 11, 2024 14:57
@github-actions github-actions bot added the performance Maintenance tasks and housekeeping label Jul 11, 2024
@nicoloboschi nicoloboschi merged commit ab0ab5f into langflow-ai:main Jul 11, 2024
30 checks passed
nicoloboschi added a commit to datastax/ragstack-ai-langflow that referenced this pull request Jul 11, 2024
* perf: improve /logs concurrent access

* perf: improve /logs concurrency access

* fix

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
(cherry picked from commit ab0ab5f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer performance Maintenance tasks and housekeeping python Pull requests that update Python code size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants