-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
IGNITE-21156 : [IEP-114] Custom metrics introduction - IgniteMetricRegistry #11223
IGNITE-21156 : [IEP-114] Custom metrics introduction - IgniteMetricRegistry #11223
Conversation
modules/core/src/main/java/org/apache/ignite/metric/IgniteMetricRegistry.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/apache/ignite/metric/IgniteMetricRegistry.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/apache/ignite/metric/IgniteMetrics.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/apache/ignite/metric/IgniteMetrics.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/apache/ignite/metric/IgniteMetrics.java
Outdated
Show resolved
Hide resolved
Maybe we should use "user provided metrics" or "user metrics" instead of "custom"? |
* @see ReadOnlyMetricRegistry | ||
*/ | ||
@IgniteExperimental | ||
public interface IgniteMetricRegistry extends ReadOnlyMetricRegistry { |
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 doubt about naming here - IgniteMetricRegistry
is something that belongs to Ignite.
But, here it used for registry that will be managed and fullfillled by the user.
maybe we can use just MetricRegistry
here.
And rename internal implementation to MetricRegistryImpl
?
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.
@Vladsz83 Let's decide on this suggestion before proceed with the merge.
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.
We've discussed remaning internal MetricRegistry -> MetricRegistryImpl here : https://github.com/apache/ignite/pull/11216/files . Also, we tried to temporary keep two internal and external interfaces MetricRegistry to avoid related tons of code cnahges : https://github.com/apache/ignite/pull/11221/files . The decision was that twe need more exposed, available for internal usage metric interfaces, internal code remenings and code cleanup before using 'MetricRegistry'. Since we declare the interface as @IgniteExperimental, we could rename it later.
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.
Also, we plan to expose internal read-only metrics as noted before using the same API, findRegistry(String name)
. They belong to Ignite.
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.
Also, we plan to expose internal read-only metrics as noted before using the same API
Then method must return ReadOnlyMetricRegistry
.
to avoid related tons of code cnahges
I don't think "tons of changes" is the right reason to use bad naming.
Let's make API more clear by using clear naming.
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.
Then method must return ReadOnlyMetricRegistry.
Yes, but not IgniteReadOnlyMetricRegistry. Ok, I'll try to rename and make use MetricRegistry (not MetricRegistryImpl) as much as possible
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, I prepared another PR with the renaming internal class MetricRegistry
-> class MetricRegistryImpl
and new interface IgniteMetricRegistry
-> interface MetricRegistry
: https://github.com/apache/ignite/pull/11293/files .
Used MetricRegistry
instead of MetricRegistryImpl
where is possible. We planned to add methods like longMetric
to the new registry interface in a next PR. Then, we could refactor to more internal usage of interface MetricRegistry
.
I recalled one problem that we discussed: CdcConsumer
. It is @IgniteExperimental
but also a public API. And this feature look crucial. It uses internal org.apache.ignite.internal.processors.metric.MetricRegistry
. Renaming to MetricRegistryImpl
will break at least the extensions. And any external code which uses CdcConsumer
and probably related org.apache.ignite.internal.processors.metric.MetricRegistry
(CdcConsumer#start(MetricRegistry mreg)
). IMHO, keeping @IgniteExperimental IgniteMetricRegistry
for a while and possible later renaming to @IgniteExperimental MetricRegistry
is a less evil. WDYT?
@Vladsz83 Thanks for the updates. Overall looks good. Let's agree on naming - I left some suggestions in PR. |
@nizhikov where exactly? Other famous databases operate with 'custom metrics'. |
In comments, method naming, etc.
Can you, please, provide an example? |
You can take the examples from the IEP within 'Motivation' section: https://cwiki.apache.org/confluence/display/IGNITE/IEP-114+Custom+metrics#IEP114Custommetrics-Motivation |
I see - so "custom metric" is commonly used naming. OK, let's keep it. |
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summary
whereXXXX
- number of JIRA issue.(see the Maintainers list)
the
green visa
attached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email [email protected] or ask anу advice on http://asf.slack.com #ignite channel.