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
@@ -547,12 +547,9 @@ class Compute:
|
||||
data = json.dumps(data).encode("utf-8")
|
||||
try:
|
||||
log.debug(f"Attempting request to compute: {method} {url} {headers}")
|
||||
_t0 = time.time()
|
||||
response = await self._session().request(
|
||||
method, url, headers=headers, data=data, auth=self._auth, params=params, chunked=chunked, timeout=timeout
|
||||
)
|
||||
log.info(f"[CTRL-TIMING] compute._session.request DONE {method} {url.split('/v3')[1] if '/v3' in url else url} "
|
||||
f"status={response.status} elapsed={time.time()-_t0:.3f}s")
|
||||
except asyncio.TimeoutError:
|
||||
raise ComputeError(f"Timeout error for {method} call to {url} after {timeout}s")
|
||||
except (
|
||||
|
||||
@@ -402,8 +402,6 @@ class Node:
|
||||
"""
|
||||
Create the node on the compute
|
||||
"""
|
||||
import time as _time
|
||||
_t0 = _time.time()
|
||||
data = self._node_data()
|
||||
data["node_id"] = self._id
|
||||
if self._node_type == "docker":
|
||||
@@ -416,8 +414,6 @@ class Node:
|
||||
response = await self._compute.post(
|
||||
f"/projects/{self._project.id}/{self._node_type}/nodes", data=data, timeout=timeout
|
||||
)
|
||||
log.info(f"[CTRL-TIMING] Node.create compute_post DONE name={self._name} "
|
||||
f"type={self._node_type} elapsed={_time.time()-_t0:.3f}s")
|
||||
except ComputeConflictError as e:
|
||||
response = e.response()
|
||||
if response.get("exception") == "ImageMissingError":
|
||||
|
||||
@@ -563,9 +563,6 @@ class Project:
|
||||
"""
|
||||
Create a node from a template.
|
||||
"""
|
||||
import time as _time
|
||||
_t0 = _time.time()
|
||||
|
||||
template["x"] = x
|
||||
template["y"] = y
|
||||
node_type = template.pop("template_type")
|
||||
@@ -581,15 +578,11 @@ class Project:
|
||||
name = default_name_format.replace("{name}", template_name)
|
||||
node_id = str(uuid.uuid4())
|
||||
node = await self.add_node(compute, name, node_id, node_type=node_type, **template)
|
||||
log.info(f"[CTRL-TIMING] add_node_from_template DONE name={name} elapsed={_time.time()-_t0:.3f}s")
|
||||
return node
|
||||
|
||||
async def _create_node(self, compute, name, node_id, node_type=None, **kwargs):
|
||||
import time as _time
|
||||
_t0 = _time.time()
|
||||
|
||||
node = Node(self, compute, name, node_id=node_id, node_type=node_type, **kwargs)
|
||||
_t1 = _time.time()
|
||||
if compute not in self._project_created_on_compute:
|
||||
if compute.id == "local":
|
||||
data = {"name": self._name, "project_id": self._id, "path": self._path}
|
||||
@@ -599,12 +592,9 @@ class Project:
|
||||
data["variables"] = self._variables
|
||||
await compute.post("/projects", data=data)
|
||||
self._project_created_on_compute.add(compute)
|
||||
log.info(f"[CTRL-TIMING] _create_node project_setup name={name} elapsed={_time.time()-_t0:.3f}s"
|
||||
f" (node_init={_t1-_t0:.3f}s)")
|
||||
|
||||
await node.create()
|
||||
self._nodes[node.id] = node
|
||||
log.info(f"[CTRL-TIMING] _create_node node.create DONE name={name} elapsed={_time.time()-_t0:.3f}s")
|
||||
|
||||
return node
|
||||
|
||||
|
||||
Reference in new issue
Block a user