Skip to content

Singleton Metrics.All is mutable #7732

Open
@YohDeadfall

Description

@YohDeadfall

The idea of any singleton to be immutable if it serves an idea of a constant value, but unfortunately, it doesn't apply to Metric exposing values as a HashSet<string>:

public static Metrics All { get; } = new("_all");

A potential solution is to use an immutable collection or IReadOnlySet interface which limits mutability, but that can be allowed through methods added to Metrics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions