31 references to InstrumentViewModel
Aspire.Dashboard (26)
Components\Controls\Chart\ChartBase.cs (20)
76
InstrumentViewModel
.AddDataUpdateSubscription(OnInstrumentDataUpdate);
82
InstrumentViewModel
.Instrument is null ||
83
InstrumentViewModel
.MatchedDimensions is null ||
100
var dimensionAttributes =
InstrumentViewModel
.MatchedDimensions.Select(d => d.Attributes).ToList();
101
if (_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;
141
return $"<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))}";
150
Debug.Assert(
InstrumentViewModel
.MatchedDimensions != null);
151
Debug.Assert(
InstrumentViewModel
.Instrument != null);
153
var unit = !
InstrumentViewModel
.ShowCount
154
? GetDisplayedUnit(
InstrumentViewModel
.Instrument)
160
if (
InstrumentViewModel
.Instrument?.Type != OtlpInstrumentType.Histogram ||
InstrumentViewModel
.ShowCount)
162
data = calculator.CalculateChartValues(
InstrumentViewModel
.MatchedDimensions, _currentDataStartTime, TimeProvider.ToLocalDateTimeOffset, unit);
169
data = calculator.CalculateHistogramValues(
InstrumentViewModel
.MatchedDimensions, _currentDataStartTime, TimeProvider.ToLocalDateTimeOffset, unit);
282
InstrumentViewModel
.RemoveDataUpdateSubscription(OnInstrumentDataUpdate);
Components\Controls\Chart\MetricTable.razor.cs (5)
51
if (!Equals(_instrument?.Name,
InstrumentViewModel
.Instrument?.Name) || _showCount !=
InstrumentViewModel
.ShowCount)
58
_instrument =
InstrumentViewModel
.Instrument;
59
_showCount =
InstrumentViewModel
.ShowCount;
106
Instrument =
InstrumentViewModel
.Instrument!
Components\Controls\Chart\PlotlyChart.razor.cs (1)
47
if (
InstrumentViewModel
?.Instrument is { } instrument)
Aspire.Dashboard.Components.Tests (5)
Controls\PlotlyChartTests.cs (2)
35
builder.Add(p => p.
InstrumentViewModel
, model);
90
builder.Add(p => p.
InstrumentViewModel
, model);
Pages\MetricsTests.cs (3)
187
var dimensions = chart.Instance.
InstrumentViewModel
.MatchedDimensions!;
244
Assert.Equal("instrument-2", updatedTable.Instance.
InstrumentViewModel
.Instrument?.Name);
245
Assert.NotEmpty(updatedTable.Instance.
InstrumentViewModel
.MatchedDimensions!);