We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, users can POST /humbug/reports with sync=true or sync=false.
POST /humbug/reports
sync=true
sync=false
When sync=true, response is only sent after report is written into database.
When sync=false, response is sent after report is written to redis queue (with fallback to database).
This doesn't result in a significant speedup - the sync=false takes ~83% of the time that sync=true takes:
"bash" "-c" "time for i in {1..100}; do curl -s -H \"Content-Type: application/json\" -H \"Authorization: Bearer 6924ac70-f2b4-4444-a26b-7db8c15bf694\" -X POST https://spire.bugout.dev/humbug/reports -d \"{\\\"title\\\": \\\"Report (postgres) lol\\\", \\\"content\\\": \\\"content 5\\\", \\\"tags\\\": [\\\"a\\\", \\\"b\\\"]}\" >/dev/null ; done" real 0m35.016s user 0m0.777s sys 0m0.343s
"bash" "-c" "time for i in {1..100}; do curl -s -H \"Content-Type: application/json\" -H \"Authorization: Bearer 6924ac70-f2b4-4444-a26b-7db8c15bf694\" -X POST https://spire.bugout.dev/humbug/reports?sync=true -d \"{\\\"title\\\": \\\"Report (postgres) lol\\\", \\\"content\\\": \\\"content 5\\\", \\\"tags\\\": [\\\"a\\\", \\\"b\\\"]}\" >/dev/null ; done" real 0m42.723s user 0m0.878s sys 0m0.279s
(although it may be faster when requests are made concurrently).
I propose we change sync={true|false} to syncMode={async|enqueue|commit}.
sync={true|false}
syncMode={async|enqueue|commit}
If syncMode=async, the report will be published as a background task and the endpoint will immediately return 200.
syncMode=async
If syncMode=enqueue, then we will do what sync=false currently does.
syncMode=enqueue
If syncMode=commit, then we will do what sync=true currently does.
syncMode=commit
The text was updated successfully, but these errors were encountered:
Andrei-Dolgolev
No branches or pull requests
Currently, users can
POST /humbug/reports
withsync=true
orsync=false
.When
sync=true
, response is only sent after report is written into database.When
sync=false
, response is sent after report is written to redis queue (with fallback to database).This doesn't result in a significant speedup - the
sync=false
takes ~83% of the time thatsync=true
takes:(although it may be faster when requests are made concurrently).
I propose we change
sync={true|false}
tosyncMode={async|enqueue|commit}
.If
syncMode=async
, the report will be published as a background task and the endpoint will immediately return 200.If
syncMode=enqueue
, then we will do whatsync=false
currently does.If
syncMode=commit
, then we will do whatsync=true
currently does.The text was updated successfully, but these errors were encountered: