41 references to InstrumentViewModel
Aspire.Dashboard (30)
Components\Controls\Chart\ChartBase.cs (24)
83
InstrumentViewModel
.AddDataUpdateSubscription(OnInstrumentDataUpdate);
89
InstrumentViewModel
.Instrument is null ||
90
InstrumentViewModel
.MatchedDimensions is null ||
107
var dimensionAttributes =
InstrumentViewModel
.MatchedDimensions.Select(d => d.Attributes).ToList();
108
if (_renderedInstrument is null || _renderedInstrument !=
InstrumentViewModel
.Instrument.GetKey() ||
110
_renderedTheme !=
InstrumentViewModel
.Theme ||
111
_renderedShowCount !=
InstrumentViewModel
.ShowCount)
114
_renderedInstrument =
InstrumentViewModel
.Instrument.GetKey();
116
_renderedTheme =
InstrumentViewModel
.Theme;
117
_renderedShowCount =
InstrumentViewModel
.ShowCount;
148
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))}";
157
Debug.Assert(
InstrumentViewModel
.MatchedDimensions != null);
158
Debug.Assert(
InstrumentViewModel
.Instrument != null);
160
var unit = !
InstrumentViewModel
.ShowCount
161
? GetDisplayedUnit(
InstrumentViewModel
.Instrument)
167
if (
InstrumentViewModel
.Instrument?.Type != OtlpInstrumentType.Histogram ||
InstrumentViewModel
.ShowCount)
169
data = calculator.CalculateChartValues(
InstrumentViewModel
.MatchedDimensions, _currentDataStartTime, TimeProvider.ToLocalDateTimeOffset, unit);
176
data = calculator.CalculateHistogramValues(
InstrumentViewModel
.MatchedDimensions, _currentDataStartTime, TimeProvider.ToLocalDateTimeOffset, unit);
179
var instrumentChanged =
InstrumentViewModel
.HasIncompatibleHistogramBounds != data.HasIncompatibleHistogramBounds ||
180
_renderedHasOverflow !=
InstrumentViewModel
.HasOverflow;
181
InstrumentViewModel
.HasIncompatibleHistogramBounds = data.HasIncompatibleHistogramBounds;
182
_renderedHasOverflow =
InstrumentViewModel
.HasOverflow;
299
InstrumentViewModel
.RemoveDataUpdateSubscription(OnInstrumentDataUpdate);
Components\Controls\Chart\MetricTable.razor.cs (5)
50
if (!Equals(_instrument?.Name,
InstrumentViewModel
.Instrument?.Name) || _showCount !=
InstrumentViewModel
.ShowCount)
57
_instrument =
InstrumentViewModel
.Instrument;
58
_showCount =
InstrumentViewModel
.ShowCount;
105
Instrument =
InstrumentViewModel
.Instrument!
Components\Controls\Chart\PlotlyChart.razor.cs (1)
47
if (
InstrumentViewModel
?.Instrument is { } instrument)
Aspire.Dashboard.Components.Tests (11)
Controls\PlotlyChartTests.cs (3)
58
builder.Add(p => p.
InstrumentViewModel
, model);
94
builder.Add(p => p.
InstrumentViewModel
, model);
149
builder.Add(p => p.
InstrumentViewModel
, model);
Pages\MetricsTests.cs (8)
132
? cut.FindComponent<PlotlyChart>().Instance.
InstrumentViewModel
133
: cut.FindComponent<MetricTable>().Instance.
InstrumentViewModel
;
146
Assert.True(cut.FindComponent<PlotlyChart>().Instance.
InstrumentViewModel
.ShowCount);
154
Assert.True(cut.FindComponent<MetricTable>().Instance.
InstrumentViewModel
.ShowCount);
255
var instrumentViewModel = table.Instance.
InstrumentViewModel
;
465
var dimensions = chart.Instance.
InstrumentViewModel
.MatchedDimensions!;
522
Assert.Equal("instrument-2", updatedTable.Instance.
InstrumentViewModel
.Instrument?.Name);
523
Assert.NotEmpty(updatedTable.Instance.
InstrumentViewModel
.MatchedDimensions!);