31 references to InstrumentViewModel
Aspire.Dashboard (26)
Components\Controls\Chart\ChartBase.cs (20)
76InstrumentViewModel.AddDataUpdateSubscription(OnInstrumentDataUpdate); 82InstrumentViewModel.Instrument is null || 83InstrumentViewModel.MatchedDimensions is null || 100var dimensionAttributes = InstrumentViewModel.MatchedDimensions.Select(d => d.Attributes).ToList(); 101if (_renderedInstrument is null || _renderedInstrument != InstrumentViewModel.Instrument.GetKey() || 103_renderedTheme != InstrumentViewModel.Theme || 104_renderedShowCount != InstrumentViewModel.ShowCount) 107_renderedInstrument = InstrumentViewModel.Instrument.GetKey(); 109_renderedTheme = InstrumentViewModel.Theme; 110_renderedShowCount = InstrumentViewModel.ShowCount; 141return $"<b>{HttpUtility.HtmlEncode(InstrumentViewModel.Instrument?.Name)}</b><br />{HttpUtility.HtmlEncode(name)}: {FormatHelpers.FormatNumberWithOptionalDecimalPlaces(yValue, maxDecimalPlaces: 6, CultureInfo.CurrentCulture)}<br />Time: {FormatHelpers.FormatTime(TimeProvider, TimeProvider.ToLocal(xValue))}"; 150Debug.Assert(InstrumentViewModel.MatchedDimensions != null); 151Debug.Assert(InstrumentViewModel.Instrument != null); 153var unit = !InstrumentViewModel.ShowCount 154? GetDisplayedUnit(InstrumentViewModel.Instrument) 160if (InstrumentViewModel.Instrument?.Type != OtlpInstrumentType.Histogram || InstrumentViewModel.ShowCount) 162data = calculator.CalculateChartValues(InstrumentViewModel.MatchedDimensions, _currentDataStartTime, TimeProvider.ToLocalDateTimeOffset, unit); 169data = calculator.CalculateHistogramValues(InstrumentViewModel.MatchedDimensions, _currentDataStartTime, TimeProvider.ToLocalDateTimeOffset, unit); 282InstrumentViewModel.RemoveDataUpdateSubscription(OnInstrumentDataUpdate);
Components\Controls\Chart\MetricTable.razor.cs (5)
51if (!Equals(_instrument?.Name, InstrumentViewModel.Instrument?.Name) || _showCount != InstrumentViewModel.ShowCount) 58_instrument = InstrumentViewModel.Instrument; 59_showCount = InstrumentViewModel.ShowCount; 106Instrument = InstrumentViewModel.Instrument!
Components\Controls\Chart\PlotlyChart.razor.cs (1)
47if (InstrumentViewModel?.Instrument is { } instrument)
Aspire.Dashboard.Components.Tests (5)
Controls\PlotlyChartTests.cs (2)
35builder.Add(p => p.InstrumentViewModel, model); 90builder.Add(p => p.InstrumentViewModel, model);
Pages\MetricsTests.cs (3)
187var dimensions = chart.Instance.InstrumentViewModel.MatchedDimensions!; 244Assert.Equal("instrument-2", updatedTable.Instance.InstrumentViewModel.Instrument?.Name); 245Assert.NotEmpty(updatedTable.Instance.InstrumentViewModel.MatchedDimensions!);