mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
add metrics concept
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
__all__ = ["get_time_of_pre_cycle_setup"]
|
||||
|
||||
|
||||
from argenta.metrics.main import get_time_of_pre_cycle_setup
|
||||
@@ -0,0 +1,26 @@
|
||||
import io
|
||||
from contextlib import redirect_stdout
|
||||
from time import time
|
||||
|
||||
from argenta.router import Router
|
||||
from argenta.command import Command
|
||||
from argenta.response import Response
|
||||
from argenta.response.status import Status
|
||||
from argenta.command.flag import Flag, Flags
|
||||
from argenta.app import App
|
||||
|
||||
|
||||
def get_time_of_pre_cycle_setup(app: App) -> float:
|
||||
start = time()
|
||||
with redirect_stdout(io.StringIO()):
|
||||
app.pre_cycle_setup()
|
||||
end = time()
|
||||
return end - start
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user