7 instantiations of MetricPin
Aspire.Dashboard (1)
Model\MetricPinStore.cs (1)
87? AddPin(pins, new MetricPin(name, key.MeterName, key.InstrumentName))
Aspire.Dashboard.Components.Tests (5)
Pages\MetricsTests.cs (5)
419Assert.Equal([new MetricPin("app1", "test-meter", "requests"), new MetricPin("app2", "test-meter", "requests")], store.GetPins()); 464[new MetricPin("api", "test-meter", "requests"), new MetricPin("worker", "test-meter", "requests")], store.GetPins())); 1518Assert.Equal([new MetricPin("TestApp", "test-meter", "test-instrument-b")], Services.GetRequiredService<MetricPinStore>().GetPins());
Aspire.Dashboard.Tests (1)
Model\MetricPinStoreTests.cs (1)
158private static MetricPin Pin(string resourceName, OtlpInstrumentKey key) => new(resourceName, key.MeterName, key.InstrumentName);
11 references to MetricPin
Aspire.Dashboard (10)
Model\MetricPinStore.cs (9)
16/// An instrument is pinned for a resource (see <see cref="MetricPin"/>). Pinning applies to the resources of the current 30private readonly LocalStorageSetting<List<MetricPin>> _setting; 51public IReadOnlyList<MetricPin> GetPins() => _setting.Read(pins => pins.ToArray()); 95private static bool AddPin(List<MetricPin> pins, MetricPin pin) 109private static List<MetricPin> NormalizePins(List<MetricPin>? stored) 111var pins = new List<MetricPin>(); 112foreach (var pin in stored ?? [])
Serialization\DashboardJsonSerializerContext.cs (1)
41[JsonSerializable(typeof(List<MetricPin>))]
Aspire.Dashboard.Tests (1)
Model\MetricPinStoreTests.cs (1)
158private static MetricPin Pin(string resourceName, OtlpInstrumentKey key) => new(resourceName, key.MeterName, key.InstrumentName);