mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Clean up all timing/debug logs
Remove all [MCP-TIMING] and [CTRL-TIMING] log lines, timing middleware, and related import time statements across 11 files.
This commit is contained in:
11 files changed
+1
-79
No files matched your search
@@ -45,7 +45,6 @@ async def get_user_from_token(
|
||||
|
||||
import time
|
||||
_t0 = time.time()
|
||||
log.info(f"[CTRL-TIMING] get_user_from_token ENTER bearer={bool(bearer_token)}")
|
||||
|
||||
if bearer_token:
|
||||
# bearer token is used first, then any token passed as a URL parameter
|
||||
@@ -61,7 +60,6 @@ async def get_user_from_token(
|
||||
# API Key authentication — format: gns3_<api_key_id>_<random_secret>
|
||||
# Direct lookup by UUID avoids O(n) scan of all keys.
|
||||
if token.startswith("gns3_"):
|
||||
log.info(f"[CTRL-TIMING] get_user_from_token API_KEY auth elapsed={time.time()-_t0:.3f}s")
|
||||
parts = token.split("_", 2)
|
||||
if len(parts) != 3:
|
||||
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid API key format")
|
||||
@@ -100,7 +98,6 @@ async def get_user_from_token(
|
||||
detail=f"Token has been revoked for '{token_data.username}'",
|
||||
headers={"WWW-Authenticate": "Bearer"},
|
||||
)
|
||||
log.info(f"[CTRL-TIMING] get_user_from_token DONE elapsed={time.time()-_t0:.3f}s user={user.username}")
|
||||
return user
|
||||
|
||||
|
||||
|
||||
@@ -30,10 +30,8 @@ async def get_db_session(request: HTTPConnection) -> AsyncSession:
|
||||
|
||||
import time
|
||||
_t0 = time.time()
|
||||
log.info(f"[CTRL-TIMING] get_db_session ENTER")
|
||||
async with AsyncSession(request.app.state._db_engine, expire_on_commit=False) as session:
|
||||
try:
|
||||
log.info(f"[CTRL-TIMING] get_db_session SESSION_READY elapsed={time.time()-_t0:.3f}s")
|
||||
yield session
|
||||
finally:
|
||||
await session.close()
|
||||
|
||||
@@ -609,12 +609,9 @@ async def create_node_from_template(
|
||||
|
||||
Required privilege: Node.Allocate
|
||||
"""
|
||||
import time as _time
|
||||
_t0 = _time.time()
|
||||
log.info(f"[CTRL-TIMING] create_node_from_template ENTER template_id={template_id}")
|
||||
|
||||
template = await TemplatesService(templates_repo).get_template(template_id)
|
||||
log.info(f"[CTRL-TIMING] get_template done elapsed={_time.time()-_t0:.3f}s")
|
||||
|
||||
controller = Controller.instance()
|
||||
project = controller.get_project(str(project_id))
|
||||
@@ -622,8 +619,6 @@ async def create_node_from_template(
|
||||
node = await project.add_node_from_template(
|
||||
template, x=template_usage.x, y=template_usage.y, compute_id=template_usage.compute_id
|
||||
)
|
||||
log.info(f"[CTRL-TIMING] add_node_from_template done elapsed={_time.time()-_t0:.3f}s")
|
||||
|
||||
result = node.asdict()
|
||||
log.info(f"[CTRL-TIMING] create_node_from_template DONE total={_time.time()-_t0:.3f}s")
|
||||
return result
|
||||
Reference in new issue
Block a user