biocore / biocore/microsetta-public-api

Capture timings of requests

Open
#28 6 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
2
Forks
4
PR merge metrics
No merged PRs in 30d

Description

See discussion in #26 .

It would be nice to register some hooks with flask `before_request` and `after_request` that register timing information about the request:

`before_request`:
* request ID (likely using [`uuid.uuid4`](https://docs.python.org/3/library/uuid.html))
* start time
* Take into consideration time-zones etc...
* url for request (difference between endpoint, and parameters)
* number of samples being requested (maybe not applicable everywhere)
* API version

`after_request`:
* end time
* timing considerations should be the same
* maybe some job information, such as number of samples, that is not known until complete

See [this helpful SO post](https://stackoverflow.com/questions/10434599/get-the-data-received-in-a-flask-request) for a quick overview on the `flask.request` module, which should provide a lot of utilities for getting the above information.

Also see the [`flask.Request` docs](https://flask.palletsprojects.com/en/1.1.x/api/#flask.Request).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading discussion #26 and the Flask before_request, after_request, and Request documentation linked in the issue. Identify the application's request-handling entry points, then define how request IDs, timestamps, URLs, API versions, sample counts, and completion data are recorded; the work is done when the agreed timing information is captured consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.