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

Add CLI argument for server-metrics-url #39

Merged
merged 17 commits into from
Aug 28, 2024
Merged

Add CLI argument for server-metrics-url #39

merged 17 commits into from
Aug 28, 2024

Conversation

lkomali
Copy link
Contributor

@lkomali lkomali commented Aug 15, 2024

This is a new PR for adding a CLI argument to get server-metrics-url to collect telemetry data when the server is running on a different machine than genai-perf.

  1. Add a new endpoint arg --server-metrics-url
  2. Add checks for server-metrics-url
  3. Add a check if url is reachable.
  4. Unit tests

lkomali and others added 5 commits August 27, 2024 11:29
… unreachable (#47)

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

* Fix comments

* Fix comments

* Fix comments

* Add space in error message
genai-perf/genai_perf/parser.py Outdated Show resolved Hide resolved
genai-perf/genai_perf/parser.py Outdated Show resolved Hide resolved
genai-perf/genai_perf/wrapper.py Outdated Show resolved Hide resolved
genai-perf/tests/test_cli.py Outdated Show resolved Hide resolved
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.

Great work! A couple of comments.

@@ -917,3 +917,75 @@ def test_get_extra_inputs_as_dict(self, extra_inputs_list, expected_dict):
namespace.extra_inputs = extra_inputs_list
actual_dict = parser.get_extra_inputs_as_dict(namespace)
assert actual_dict == expected_dict

TEST_TRITON_METRICS_URL = "http://custom-metrics-url:8002/metrics"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for creating these global variables? I feel like this could be confusing. I'd need to scroll down quite a bit to see why they are used. It'd be better to have these as local variables inside the one test.

):
monkeypatch.setattr("sys.argv", args_list)

if expected_error:
Copy link
Contributor

Choose a reason for hiding this comment

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

When you start using branching logic like this, it suggests this should be two tests. Do you want to add the valid test to the test_cli valid arg test and then have a separate one just for the error testing? That assumes there's not a generic error test that you can reuse... which if we don't have, we should refactor sometime soon to add.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have test_conditional_errors, that handles error scenarios.
We can use it for the invalid url case, I think

@lkomali lkomali merged commit 16e6d33 into main Aug 28, 2024
7 checks passed
@lkomali lkomali deleted the lkomali-tpa-275 branch August 28, 2024 17:13
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.

3 participants