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

IGNITE-21156 : [IEP-114] Custom metrics introduction - IgniteMetricRegistry #11223

Closed

Conversation

Vladsz83
Copy link
Contributor

@Vladsz83 Vladsz83 commented Feb 5, 2024

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

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    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.

@nizhikov
Copy link
Contributor

Maybe we should use "user provided metrics" or "user metrics" instead of "custom"?

* @see ReadOnlyMetricRegistry
*/
@IgniteExperimental
public interface IgniteMetricRegistry extends ReadOnlyMetricRegistry {
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

@Vladsz83 Vladsz83 Mar 29, 2024

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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?

@nizhikov
Copy link
Contributor

@Vladsz83 Thanks for the updates. Overall looks good. Let's agree on naming - I left some suggestions in PR.

@Vladsz83
Copy link
Contributor Author

Maybe we should use "user provided metrics" or "user metrics" instead of "custom"?

@nizhikov where exactly? Other famous databases operate with 'custom metrics'.

@nizhikov
Copy link
Contributor

where exactly?

In comments, method naming, etc.

Other famous databases operate with 'custom metrics'.

Can you, please, provide an example?

@Vladsz83
Copy link
Contributor Author

where exactly?

In comments, method naming, etc.

Other famous databases operate with 'custom metrics'.

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

@nizhikov
Copy link
Contributor

I see - so "custom metric" is commonly used naming. OK, let's keep it.

@Vladsz83 Vladsz83 closed this Apr 18, 2024
@Vladsz83 Vladsz83 deleted the CustomMetricsFirst_IgniteMetricRegistry branch April 18, 2024 12:44
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