8 instantiations of OtlpInstrumentKey
Aspire.Dashboard (1)
Otlp\Model\OtlpInstrument.cs (1)
26public OtlpInstrumentKey GetKey() => new(Parent.Name, Name);
Aspire.Dashboard.Components.Tests (3)
Pages\MetricsTests.cs (3)
1406Assert.Equal([new OtlpInstrumentKey("test-meter", "test-instrument-b")], Services.GetRequiredService<MetricPinStore>().GetPins()); 1430Services.GetRequiredService<MetricPinStore>().SetPinned(new OtlpInstrumentKey("test-meter", "test-instrument-b"), pinned: true); 1755Services.GetRequiredService<MetricPinStore>().SetPinned(new OtlpInstrumentKey("test-meter2", "queue.length"), pinned: true);
Aspire.Dashboard.Tests (4)
Model\MetricPinStoreTests.cs (4)
20private static readonly OtlpInstrumentKey s_duration = new("Microsoft.AspNetCore.Hosting", "http.server.request.duration"); 21private static readonly OtlpInstrumentKey s_heap = new("System.Runtime", "dotnet.gc.heap.total_allocated"); 22private static readonly OtlpInstrumentKey s_cpu = new("System.Runtime", "dotnet.process.cpu.time"); 114var unpinned = CreateInstrument(new OtlpInstrumentKey("System.Runtime", "dotnet.exceptions"));
23 references to OtlpInstrumentKey
Aspire.Dashboard (19)
Components\Controls\Chart\ChartBase.cs (1)
29private OtlpInstrumentKey? _renderedInstrument;
Components\Controls\Chart\LiveSparklinesBase.cs (6)
34private Dictionary<(ResourceKey, OtlpInstrumentKey), SparklineData> _sparklines = new(); 47private HashSet<(ResourceKey, OtlpInstrumentKey)>? _visibleInstruments; 50private readonly HashSet<(ResourceKey, OtlpInstrumentKey)> _staleInstruments = new(); 226var refreshed = new List<((ResourceKey, OtlpInstrumentKey) Key, SparklineData Data)>(instruments.Count); 233var sparklines = replaceAll ? new Dictionary<(ResourceKey, OtlpInstrumentKey), SparklineData>() : new Dictionary<(ResourceKey, OtlpInstrumentKey), SparklineData>(_sparklines);
Model\MetricPinStore.cs (10)
29private readonly LocalStorageSetting<List<OtlpInstrumentKey>> _setting; 50public IReadOnlyList<OtlpInstrumentKey> GetPins() => _setting.Read(pins => pins.ToArray()); 63public bool IsPinned(OtlpInstrumentKey key) => _setting.Read(pins => pins.Contains(key)); 68public void SetPinned(OtlpInstrumentKey key, bool pinned) 73private static bool AddPin(List<OtlpInstrumentKey> pins, OtlpInstrumentKey key) 85private static List<OtlpInstrumentKey> NormalizePins(List<OtlpInstrumentKey>? stored) 87var pins = new List<OtlpInstrumentKey>(); 88foreach (var key in stored ?? [])
Otlp\Model\OtlpInstrument.cs (1)
26public OtlpInstrumentKey GetKey() => new(Parent.Name, Name);
Serialization\DashboardJsonSerializerContext.cs (1)
42[JsonSerializable(typeof(List<OtlpInstrumentKey>))]
Aspire.Dashboard.Tests (4)
Model\MetricPinStoreTests.cs (4)
20private static readonly OtlpInstrumentKey s_duration = new("Microsoft.AspNetCore.Hosting", "http.server.request.duration"); 21private static readonly OtlpInstrumentKey s_heap = new("System.Runtime", "dotnet.gc.heap.total_allocated"); 22private static readonly OtlpInstrumentKey s_cpu = new("System.Runtime", "dotnet.process.cpu.time"); 119private static OtlpInstrumentSummary CreateInstrument(OtlpInstrumentKey key)