Vladsz83 commented on code in PR #11223:
URL: https://github.com/apache/ignite/pull/11223#discussion_r1542686526


##########
modules/core/src/main/java/org/apache/ignite/metric/IgniteMetrics.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.metric;
+
+import org.apache.ignite.lang.IgniteExperimental;
+import org.apache.ignite.spi.metric.ReadOnlyMetricRegistry;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Allows to manage custom metrics.
+ * <p>
+ * Metrics are grouped into registries (groups). Every metric has full name 
which is the conjunction of registry name
+ * and the metric short name. Within a registry metric has only its own short 
name.
+ * <p>
+ * Note: Names of custom metric registries are required to start with 
'custom.' (lower case) and may have additional
+ * dot-separated qualifiers. The prefix is automatically added if missed. For 
example, if provided custom registry name
+ * is "a.b.c.mname", it is automatically extended to "custom.a.b.c.mname".
+ * <p>
+ * Note: Custom metric are registered on demand and aren't stored. If node 
restarts, the metrics require registration anew.
+ * <p>
+ * Any name or dot-separated name part must not be empty and cannot have 
spaces.
+ * Examples of custom metric registry names: "custom.admin.sessions", 
"custom.processes", "custom.processes.proc_1", etc.
+ *
+ * @see ReadOnlyMetricRegistry
+ * @see IgniteMetricRegistry
+ */
+@IgniteExperimental
+public interface IgniteMetrics extends Iterable<ReadOnlyMetricRegistry> {
+    /**
+     * Gets or creates custom metric registry named "custom." + {@code 
registryName}.
+     *
+     * @param registryName name part to add to the prefix "custom.".
+     * @return {@link IgniteMetricRegistry} registry.
+     */
+    IgniteMetricRegistry customRegistry(String registryName);

Review Comment:
   We want give a user the abilities to create, remove and get its own metrics 
and metric registries. We want to prevent affecting internal metrics by a user. 
User should cleary see it can change only custom metrics. In future, we plan to 
provide an ability to get read-only internal metrics as described in 
IGNITE-12553. That we have 'findRegistry()'. It will expose internal metric 
too, but not change them.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to