mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Add [CTRL-TIMING] logs to controller create_node flow
Timing logs cover: - create_node_from_template (entry, get_template, add_node, total) - add_node_from_template (entry to done) - _create_node (project_setup, node.create, total) - Node.create (compute_post timing) - compute._session.request (actual HTTP to compute)
This commit is contained in:
4 files changed
+28
-5
No files matched your search
@@ -609,11 +609,21 @@ 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))
|
||||
|
||||
node = await project.add_node_from_template(
|
||||
template, x=template_usage.x, y=template_usage.y, compute_id=template_usage.compute_id
|
||||
)
|
||||
return node.asdict()
|
||||
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