more perf counters
This commit is contained in:
parent
725980e694
commit
e77fd6e69f
1 changed files with 643 additions and 54 deletions
|
|
@ -103,7 +103,13 @@ class RoutingWorld:
|
|||
self._dynamic_paths.remove_path(net_id)
|
||||
|
||||
def check_move_straight_static(self, start_port: Port, length: float, net_width: float) -> bool:
|
||||
reach = self.ray_cast(start_port, start_port.r, max_dist=length + 0.01, net_width=net_width)
|
||||
reach = self.ray_cast(
|
||||
start_port,
|
||||
start_port.r,
|
||||
max_dist=length + 0.01,
|
||||
net_width=net_width,
|
||||
caller="straight_static",
|
||||
)
|
||||
return reach < length - 0.001
|
||||
|
||||
def _is_in_safety_zone_fast(self, idx: int, start_port: Port | None, end_port: Port | None) -> bool:
|
||||
|
|
@ -393,9 +399,24 @@ class RoutingWorld:
|
|||
angle_deg: float,
|
||||
max_dist: float = 2000.0,
|
||||
net_width: float | None = None,
|
||||
caller: str = "other",
|
||||
) -> float:
|
||||
if self.metrics is not None:
|
||||
self.metrics.total_ray_cast_calls += 1
|
||||
if caller == "straight_static":
|
||||
self.metrics.total_ray_cast_calls_straight_static += 1
|
||||
elif caller == "expand_snap":
|
||||
self.metrics.total_ray_cast_calls_expand_snap += 1
|
||||
elif caller == "expand_forward":
|
||||
self.metrics.total_ray_cast_calls_expand_forward += 1
|
||||
elif caller == "visibility_build":
|
||||
self.metrics.total_ray_cast_calls_visibility_build += 1
|
||||
elif caller == "visibility_query":
|
||||
self.metrics.total_ray_cast_calls_visibility_query += 1
|
||||
elif caller == "visibility_tangent":
|
||||
self.metrics.total_ray_cast_calls_visibility_tangent += 1
|
||||
else:
|
||||
self.metrics.total_ray_cast_calls_other += 1
|
||||
static_obstacles = self._static_obstacles
|
||||
tree: STRtree | None
|
||||
is_rect_array: numpy.ndarray | None
|
||||
|
|
|
|||
Loading…
Reference in a new issue