Skip to content

Commit 5b6fa6b

Browse files
thomasywangmeta-codesync[bot]
authored andcommitted
Move endpoint calling event upstream (#2165)
Summary: Pull Request resolved: #2165 This is more honest about when a call/broadcast is actually being initiated Reviewed By: moonli Differential Revision: D89411458 fbshipit-source-id: 352489df799226d4d20df6f93ee0d5e97cf54539
1 parent dc11aa5 commit 5b6fa6b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

python/monarch/_src/actor/actor_mesh.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,6 @@ def _send(
595595
),
596596
buffer,
597597
)
598-
instant_event(f"sending {self._get_method_name()} message")
599598
self._actor_mesh.cast(
600599
message, selection, context().actor_instance._as_rust()
601600
)

python/monarch/_src/actor/endpoint.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ def call(self, *args: P.args, **kwargs: P.kwargs) -> "Future[ValueMesh[R]]":
275275
start_time: int = time.monotonic_ns()
276276
# Track throughput at method entry
277277
method_name: str = self._get_method_name()
278+
instant_event(f"calling {method_name} message")
278279
endpoint_call_throughput_counter.add(1, attributes={"method": method_name})
279280
p, unranked = self._port()
280281
r: RankedPortReceiver[R] = unranked.ranked()
@@ -354,6 +355,7 @@ def broadcast(self, *args: P.args, **kwargs: P.kwargs) -> None:
354355
from monarch._src.actor.actor_mesh import send
355356

356357
method_name: str = self._get_method_name()
358+
instant_event(f"broadcasting {method_name} message")
357359
attributes = {
358360
"method": method_name,
359361
"actor_count": 0, # broadcast doesn't track specific count

0 commit comments

Comments
 (0)