Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(api, performance-metrics): clean up performance-metrics tracking #15289

Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: underlying function exception was not being raised
  • Loading branch information
DerekMaggio committed May 30, 2024
commit 2e010fea0c7a0ed00e5208ce341ed56a5d5f472b
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ async def track(self, func_to_track: Callable, state: RobotContextState, *args,
if inspect.iscoroutinefunction(func_to_track):
try:
result = await func_to_track(*args, **kwargs)
except Exception as e:
result = e
finally:
duration_end_time = perf_counter_ns()
else:
try:
result = func_to_track(*args, **kwargs)
except Exception as e:
result = e
finally:
duration_end_time = perf_counter_ns()

Expand All @@ -99,7 +103,11 @@ async def track(self, func_to_track: Callable, state: RobotContextState, *args,
state=state,
)
)
return result

if isinstance(result, Exception):
raise result
else:
return result



Expand Down