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

Provide timing info to ProfilerMiddleware filename_format #2777

Conversation

joshwilson-dbx
Copy link
Contributor

@joshwilson-dbx joshwilson-dbx commented Aug 31, 2023

This provides the elapsed and time values to the
ProfileMiddleware(filename_format=...) function. Prior to this change,
one could not replicate the format string format, much less modify how
it would render the timestamp or elapsed time values.

These new values can be found under the werkzeug.profiler key in the
WSGI environ dict passed into the filename_format() function.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@davidism
Copy link
Member

davidism commented Sep 5, 2023

The next version will be 3.0, not 2.4, can you fix that and squash all your commits.

@davidism davidism added this to the 3.0.0 milestone Sep 5, 2023
This provides the `elapsed` and `time` values to the
`ProfileMiddleware(filename_format=...)` function. Prior to this change,
one could not replicate the format string format, much less modify how
it would render the timestamp or elapsed time values.

These new values can be found under the `werkzeug.profiler` key in the
WSGI environ dict passed into the `filename_format()` function.

Addresses pallets#2775
@joshwilson-dbx joshwilson-dbx force-pushed the pass-timing-info-to-profiler-filename-format branch from 7c0d1e9 to c7087f2 Compare September 20, 2023 17:28
@joshwilson-dbx joshwilson-dbx changed the title Pass elapsed and timestamp info to filename_format Provide elapsed and timestamp info to ProfilerMiddleware filename_format Sep 20, 2023
@joshwilson-dbx joshwilson-dbx changed the title Provide elapsed and timestamp info to ProfilerMiddleware filename_format Provide more info to ProfilerMiddleware filename_format Sep 20, 2023
@joshwilson-dbx
Copy link
Contributor Author

The next version will be 3.0, not 2.4, can you fix that and squash all your commits.

Should be good now.

Are there plans to do a 2.3.8 release? It should now be safe to include in a minor or bugfix release now that these changes are backwards compatible.

@joshwilson-dbx joshwilson-dbx changed the title Provide more info to ProfilerMiddleware filename_format Provide timing info to ProfilerMiddleware filename_format Sep 20, 2023
@pgjones pgjones merged commit 4820d8c into pallets:main Sep 24, 2023
9 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elapsed and timestamp values are not available to filename_format function
3 participants