-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add more data to Server-Timing
header
#2983
Conversation
4d12745
to
763887b
Compare
dead code error at https://github.com/PostgREST/postgrest/actions/runs/6418699702/job/17427023445?pr=2983#step:4:119, the matchHeaderPresent gets unused after my PR; I'd say it's a handy matcher, I'd leave it, but don't know how |
@develop7 Interesting! So doing: # PGRST_DB_PLAN_ENABLED="true" postgrest-with-postgresql-15 postgrest-run
$ curl 'localhost:3000/projects?select=*,clients(*)' -I
Server-Timing: jwt;dur=16.0, render;dur=8.8, plan;dur=16956.1, query;dur=763.5
$ curl 'localhost:3000/projects?select=*,clients(*)' -I
Server-Timing: jwt;dur=13.3, render;dur=7.5, plan;dur=118.7, query;dur=1156.1
$ curl 'localhost:3000/projects?select=*,clients(*)' -I
Server-Timing: jwt;dur=34.3, render;dur=11.9, plan;dur=283.7, query;dur=1121.3
$ curl 'localhost:3000/projects?select=*,clients(*)' -I
Server-Timing: jwt;dur=15.4, render;dur=5.0, plan;dur=119.0, query;dur=478.7
$ curl 'localhost:3000/projects?select=*,clients(*)' -I
Server-Timing: jwt;dur=30.4, render;dur=9.8, plan;dur=274.1, query;dur=1165.8 Shows that:
Yeah, maybe just comment it for now? |
Please don't. The dead code checker is there for exactly this reason: To remove dead code. If you comment it out... the code is still dead. The point of removing dead code is to reduce maintenance effort. And commenting out does not help with it. |
Good point, although the above matcher still can be handy later, can it? Ideally, it belongs if not |
Of course it can be handy later. But nothing stops you from adding it later, again. The point about maintainability is: You can't make sure to have dead code (commented out code is even worse) to stay in sync with the remaining application - because it's dead. Are you sure the helper will work exactly the same when commenting it in again in a year or two? Maybe yes, maybe no. In this case the chance of a yes might be quite high.. but this is much more general than that: You can never be sure. And it reduces readability, too. If I have to skip over commented out code everywhere... that's just much harder for me to parse visually. Commenting out code should be a no-go, once you check for dead code... |
68ba613
to
b575ae2
Compare
@wolfgangwalther agree. Deleted it. |
I also wonder if we should adopt prometheus support… oh, there's #1526 about that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@develop7 Great work! The new modules and test helpers are really clean too 👍.
Don't forget to add an entry to the CHANGELOG!
84819b3
to
d904291
Compare
@steve-chavez changelog done, rebasing done. Hit it! |
Introduces the performance metrics' collection and rendering in
Server-Timing
headerfixes #2771
query
jwt
plan
render