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

Graceful handling of exception thrown by genai-perf if metrics url is unreachable #47

Merged
merged 5 commits into from
Aug 27, 2024

Conversation

lkomali
Copy link
Contributor

@lkomali lkomali commented Aug 21, 2024

This is a small PR to gracefully handle the exception thrown by GenAI-Perf and it is logged as a warning that the url is not reachable.

image

@lkomali lkomali changed the title Fix exception thrown by genai-perf if metrics url is unreachable Graceful handling of exception thrown by genai-perf if metrics url is unreachable Aug 21, 2024
Copy link
Contributor

@dyastremsky dyastremsky left a comment

Choose a reason for hiding this comment

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

Fantastic work! I left some comments.

telemetry_data_collector.start()
else:
logger.warning(
f"The metrics url ({telemetry_data_collector.metrics_url}) is unreachable, cannot collect telemetry data"
Copy link
Contributor

Choose a reason for hiding this comment

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

A little too long. Also a run-on sentence. We might want to make it shorter.
Something like:

The metrics url ({telemetry_data_collector.metrics_url}) is unreachable.
GenAI-Perf cannot collect telemetry data.

genai-perf/tests/test_telemetry_data_collector.py Outdated Show resolved Hide resolved
telemetry_data_collector.start()
else:
logger.warning(
f"The metrics URL ({telemetry_data_collector.metrics_url}) is unreachable."
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Could you add a space at the end of this? Otherwise, there won't be one.

E.g.

f"The metrics URL ({telemetry_data_collector.metrics_url}) is unreachable. "
"GenAI-Perf cannot collect telemetry data."

This makes it so that instead of "...unreachable.GenAI-Perf...", the message reads "...unreachable. GenAI-Perf..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the space.

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you push it? I don't see it on my end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I did. Let me know if you still cannot see the change. There was some problem initially when I tried to update my branch and this change was overwritten I think.

Copy link
Contributor

@dyastremsky dyastremsky left a comment

Choose a reason for hiding this comment

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

One nit, then everything looks good from my end.

Have you run it and received the error message? Does the error message look good? If so, it'd be nice to add a screenshot to this PR but is not mandatory.

@lkomali
Copy link
Contributor Author

lkomali commented Aug 26, 2024

Attached the screenshot of how the error message looks on the console.

@lkomali lkomali merged commit 0c48710 into main Aug 27, 2024
7 checks passed
@lkomali lkomali deleted the lkomali-fix-metrics-url-exception branch August 27, 2024 18:02
lkomali added a commit that referenced this pull request Aug 27, 2024
… unreachable (#47)

* Fix exception thrown by genai-perf if metrics url is unreachable

* Fix comments

* Fix comments

* Fix comments

* Add space in error message
lkomali added a commit that referenced this pull request Aug 27, 2024
… unreachable (#47)

* Fix exception thrown by genai-perf if metrics url is unreachable

* Fix comments

* Fix comments

* Fix comments

* Add space in error message
dyastremsky pushed a commit that referenced this pull request Aug 27, 2024
… unreachable (#47)

* Fix exception thrown by genai-perf if metrics url is unreachable

* Fix comments

* Fix comments

* Fix comments

* Add space in error message
lkomali added a commit that referenced this pull request Aug 28, 2024
* Add CLI argument for server-metrics-url

* Remove print statement

* Fix pre-commit error

* Graceful handling of exception thrown by genai-perf if metrics url is unreachable  (#47)

* Fix exception thrown by genai-perf if metrics url is unreachable

* Fix comments

* Fix comments

* Fix comments

* Add space in error message

* Add CLI argument for server-metrics-url

* Fix pre-commit error and remove duplicates

* Remove unnecessary print

* Fix comments

* Fix pytest error

* Fix comments

* Refactor test function names

* Fix comments

* Fix comment in test_profile_handler

* Cleanup test_profile_handler.py test

* Move MockArgs outside TestProfileHandler

* Move test triton metrics url to a variable
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.

2 participants