Search Results for

    Show / Hide Table of Contents

    Class NodeMetrics.Types.Metric

    Metrics key/value.

    Equality of Metric is based on its name index.

    Inheritance
    object
    NodeMetrics.Types.Metric
    Implements
    IEquatable<NodeMetrics.Types.Metric>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Cluster.Metrics.Serialization
    Assembly: Akka.Cluster.Metrics.dll
    Syntax
    public sealed class NodeMetrics.Types.Metric : IEquatable<NodeMetrics.Types.Metric>

    Constructors

    | Edit this page View Source

    Metric(string, AnyNumber, Option<EWMA>)

    Metrics key/value.

    Declaration
    public Metric(string name, AnyNumber value, Option<NodeMetrics.Types.EWMA> average)
    Parameters
    Type Name Description
    string name

    The metric name

    AnyNumber value

    The metric value, which must be a valid numerical value, a valid value is neither negative nor NaN/Infinite.

    Option<NodeMetrics.Types.EWMA> average

    The data stream of the metric value, for trending over time. Metrics that are already averages (e.g. system load average) or finite (e.g. as number of processors), are not trended.

    Properties

    | Edit this page View Source

    Average

    Metric average value

    Declaration
    public Option<NodeMetrics.Types.EWMA> Average { get; }
    Property Value
    Type Description
    Option<NodeMetrics.Types.EWMA>
    | Edit this page View Source

    IsSmooth

    Returns true if this value is smoothed

    Declaration
    public bool IsSmooth { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Name

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    SmoothValue

    The numerical value of the average, if defined, otherwise the latest value

    Declaration
    public double SmoothValue { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    Value

    Declaration
    public AnyNumber Value { get; }
    Property Value
    Type Description
    AnyNumber

    Methods

    | Edit this page View Source

    Add(Metric)

    Updates the data point, and if defined, updates the data stream (average). Returns the updated metric.

    Declaration
    public NodeMetrics.Types.Metric Add(NodeMetrics.Types.Metric latest)
    Parameters
    Type Name Description
    NodeMetrics.Types.Metric latest
    Returns
    Type Description
    NodeMetrics.Types.Metric
    | Edit this page View Source

    Create(string, AnyNumber)

    Creates a new Metric instance if the value is valid, otherwise None is returned. Invalid numeric values are negative and NaN/Infinite.

    Declaration
    public static Option<NodeMetrics.Types.Metric> Create(string name, AnyNumber value)
    Parameters
    Type Name Description
    string name
    AnyNumber value
    Returns
    Type Description
    Option<NodeMetrics.Types.Metric>
    | Edit this page View Source

    Create(string, AnyNumber, Option<double>)

    Creates a new Metric instance if the value is valid, otherwise None is returned. Invalid numeric values are negative and NaN/Infinite.

    Declaration
    public static Option<NodeMetrics.Types.Metric> Create(string name, AnyNumber value, Option<double> decayFactor)
    Parameters
    Type Name Description
    string name
    AnyNumber value
    Option<double> decayFactor
    Returns
    Type Description
    Option<NodeMetrics.Types.Metric>
    | Edit this page View Source

    Create(string, Try<AnyNumber>, Option<double>)

    Creates a new Metric instance if the Try is successful and the value is valid, otherwise None is returned. Invalid numeric values are negative and NaN/Infinite.

    Declaration
    public static Option<NodeMetrics.Types.Metric> Create(string name, Try<AnyNumber> value, Option<double> decayFactor)
    Parameters
    Type Name Description
    string name
    Try<AnyNumber> value
    Option<double> decayFactor
    Returns
    Type Description
    Option<NodeMetrics.Types.Metric>
    | Edit this page View Source

    CreateEWMA(AnyNumber, Option<double>)

    Creates NodeMetrics.Types.EWMA if decat factor is set, otherwise None is returned

    Declaration
    public static Option<NodeMetrics.Types.EWMA> CreateEWMA(AnyNumber value, Option<double> decayFactor)
    Parameters
    Type Name Description
    AnyNumber value
    Option<double> decayFactor
    Returns
    Type Description
    Option<NodeMetrics.Types.EWMA>
    | Edit this page View Source

    Equals(Metric?)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public bool Equals(NodeMetrics.Types.Metric? other)
    Parameters
    Type Name Description
    NodeMetrics.Types.Metric other

    An object to compare with this object.

    Returns
    Type Description
    bool

    true if the current object is equal to the other parameter; otherwise, false.

    | Edit this page View Source

    Equals(object?)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current object.

    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    object.Equals(object)
    | Edit this page View Source

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    object.GetHashCode()
    | Edit this page View Source

    SameAs(Metric)

    Returns true if 
    
    that

    is tracking the same metric as this.

    Declaration
    public bool SameAs(NodeMetrics.Types.Metric that)
    Parameters
    Type Name Description
    NodeMetrics.Types.Metric that
    Returns
    Type Description
    bool

    Operators

    | Edit this page View Source

    operator +(Metric, Metric)

    Updates the data point, and if defined, updates the data stream (average). Returns the updated metric.

    Declaration
    public static NodeMetrics.Types.Metric operator +(NodeMetrics.Types.Metric m1, NodeMetrics.Types.Metric m2)
    Parameters
    Type Name Description
    NodeMetrics.Types.Metric m1
    NodeMetrics.Types.Metric m2
    Returns
    Type Description
    NodeMetrics.Types.Metric

    Implements

    IEquatable<T>

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET