priyanshu-panwar / fastapi-utilities

🎨⚡️🔥 Reusable Utilities for FastAPI
https://youtu.be/ZIggeTU8JhQ?si=SO1B0Is0RdXDkbCa
MIT License
40 stars 1 forks source link

📦️ v0.1.2 #5

Closed priyanshu-panwar closed 1 year ago

priyanshu-panwar commented 1 year ago

import asyncio
from fastapi import FastAPI, Request
from fastapi_utilities import add_timer_middleware

app = FastAPI()
add_timer_middleware(app, show_avg=True)

@app.get("/")
def read_root():
    return {"message": "Hello, World!"}

Response Logs:

INFO:     (fastapi-utilities) "GET - /" :: Time Taken :: 0.97 ms
INFO:     :: Average Response Time :: 0.97 ms
codecov[bot] commented 1 year ago

Codecov Report

Merging #5 (af3443f) into master (d1d2c3a) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##            master        #5   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines           93        93           
=========================================
  Hits            93        93           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more