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

Slow Query Logging #232

Merged
merged 5 commits into from
Dec 26, 2021
Merged

Slow Query Logging #232

merged 5 commits into from
Dec 26, 2021

Conversation

patinthehat
Copy link
Contributor

This PR adds the ability to send slow queries to Ray by using a showSlowQueries($timeInMs) method. This method causes queries that take longer than $timeInMs milliseconds to execute to be sent to the Ray app.

The following methods have been added to the Ray class:

  • showSlowQueries()
  • slowQueries() (alias for showSlowQueries)
  • stopShowingSlowQueries()

Complete unit tests for the new feature are also included in this PR.
Additionally, a setting named send_slow_queries_to_ray has been added to the default settings and the settings stub file; its value is read from an environment variable named SEND_SLOW_QUERIES_TO_RAY and defaults to false.

Upon merging of this PR, I will open another PR for documentation of the new feature in the spatie/ray repository.

This feature was added in response to #230.

@freekmurze freekmurze merged commit b0c3d13 into spatie:main Dec 26, 2021
@freekmurze
Copy link
Member

Very nice, thanks again Patrick!

Looking forward to the PR with documentation.

@patinthehat
Copy link
Contributor Author

Looking forward to the PR with documentation.

@freekmurze - see this PR which adds documentation for this feature.

@patinthehat patinthehat deleted the add-slow-query-log branch January 7, 2022 08:08
@freekmurze
Copy link
Member

Thanks! 🙌

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