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

metric(multiprocessing): Add metric to track time it takes to prepare and submit batch #352

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ayirr7
Copy link
Member

@ayirr7 ayirr7 commented Apr 10, 2024

No description provided.

@ayirr7 ayirr7 requested review from a team as code owners April 10, 2024 18:03
if self.__last_batch_time == 0.0:
self.__last_batch_time = time.time()
else:
self.__metrics.timing("arroyo.strategies.run_task_with_multiprocessing.batch.build_and_submit_time", time.time() - self.__last_batch_time)
Copy link
Member

@nikhars nikhars Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you also need to reset self.__last_batch_time to 0 here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops forgot that line. I think we need to reset it to the current time (so that we have the time that the previous batch was submitted)

@ayirr7
Copy link
Member Author

ayirr7 commented Apr 10, 2024

Need to fix the tests since the test_run_task_with_multiprocessing asserts against all metrics calls.

@@ -98,4 +98,6 @@
"arroyo.processing.strategies.healthcheck.touch",
# Number of messages dropped in the FilterStep strategy
"arroyo.strategies.filter.dropped_messages",
# The amount of time it takes for the multiprocessing batch to be built and submitted to subprocesses
"arroyo.strategies.run_task_with_multiprocessing.batch.build_and_submit_time"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"arroyo.strategies.run_task_with_multiprocessing.batch.build_and_submit_time"
"arroyo.strategies.run_task_with_multiprocessing.batch_build_and_submit_time"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants