ptupitsyn commented on code in PR #3088:
URL: https://github.com/apache/ignite-3/pull/3088#discussion_r1465074174


##########
modules/platforms/dotnet/Apache.Ignite/MetricNames.cs:
##########
@@ -0,0 +1,174 @@
+/*
+ * 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.
+ */
+
+namespace Apache.Ignite;
+
+using System.Collections.Generic;
+
+/// <summary>
+/// Ignite.NET client metrics.
+/// <para />
+/// CLI usage example:
+/// <code>
+/// dotnet-counters monitor --counters Apache.Ignite,System.Runtime 
--process-id PID
+/// </code>
+/// See 
https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-counters for 
more details.
+/// <para />
+/// Code usage example:
+/// <code>
+/// var meterListener = new MeterListener();
+///
+/// meterListener.InstrumentPublished = (instrument, listener) =>
+/// {
+///     if (instrument.Meter.Name == MetricNames.MeterName)
+///     {
+///         listener.EnableMeasurementEvents(instrument);
+///         Console.WriteLine($"Instrument enabled: {instrument.Name}");
+///     }
+/// };
+///
+/// meterListener.SetMeasurementEventCallback&lt;long&gt;((instrument, 
measurement, tags, state) =>
+///     Console.WriteLine($"{instrument.Name}: {measurement}"));
+///
+/// meterListener.SetMeasurementEventCallback&lt;int&gt;((instrument, 
measurement, tags, state) =>
+///     Console.WriteLine($"{instrument.Name}: {measurement}"));
+///
+/// meterListener.Start();
+/// </code>
+/// See https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics for 
more details.
+/// </summary>
+public static class MetricNames
+{
+    /// <summary>
+    /// Meter name.
+    /// </summary>
+    public const string MeterName = "Apache.Ignite";
+
+    /// <summary>
+    /// Meter version.
+    /// </summary>
+    public const string MeterVersion = "3.0.0";
+
+    /// <summary>
+    /// Currently active connections.
+    /// </summary>
+    public const string ConnectionsActive = "connections-active";
+
+    /// <summary>
+    /// Total number of connections established (unlike <see 
cref="ConnectionsActive"/>, this metric only goes up).
+    /// </summary>
+    public const string ConnectionsEstablished = "connections-established";
+
+    /// <summary>
+    /// Total number of connections lost.
+    /// </summary>
+    public const string ConnectionsLost = "connections-lost";
+
+    /// <summary>
+    /// Total number of connections lost due to a timeout.
+    /// </summary>
+    public const string ConnectionsLostTimeout = "connections-lost-timeout";
+
+    /// <summary>
+    /// Total number of failed handshakes (due to version mismatch, auth 
failure, or other problems).
+    /// </summary>
+    public const string HandshakesFailed = "handshakes-failed";
+
+    /// <summary>
+    /// Total number of failed handshakes due to network timeout.

Review Comment:
   Fixed.



-- 
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