-
Notifications
You must be signed in to change notification settings - Fork 328
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] Add ray metrics implementation #2749
Conversation
Need to add tests under Ray. Try use |
Thanks for your reminder. There are ray metrics tests in |
5a719c6
to
a459abc
Compare
a459abc
to
175c978
Compare
2215089
to
2cf7ca8
Compare
|
||
class RayMetricMixin(AbstractMetric): | ||
def _init(self): | ||
if ray_metrics: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Append a # pragma: no branch
at the end of the line to avoid branch coverage report. What's more, it is recommended to use ray_metrics is None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Thanks!
def _record(self, value=1, tags: Optional[Dict[str, str]] = None): | ||
if RAY_GAUGE_SET_AVAILABLE: | ||
self._metric.set(value, tags) | ||
elif ray_metrics: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What do these changes do?
This pr adds ray metrics implementation which can be used when mars on ray. And we can use ray's metric backend to record and report metrics data to external system in this scenario.
We can use ray metrics as follows:
Related issue number
Issue #2743
Check code requirements