57 references to InstrumentViewModel
Aspire.Dashboard (42)
Components\Controls\Chart\ChartBase.cs (36)
87
InstrumentViewModel
.AddDataUpdateSubscription(OnInstrumentDataUpdate);
93
InstrumentViewModel
.Instrument is null ||
94
InstrumentViewModel
.MatchedDimensions is null ||
111
var dimensionAttributes =
InstrumentViewModel
.MatchedDimensions.Select(d => d.Attributes).ToList();
116
if (_renderedInstrument is null || _renderedInstrument !=
InstrumentViewModel
.Instrument.GetKey() ||
117
_renderedInstrumentUnit !=
InstrumentViewModel
.Instrument.Unit ||
118
_renderedInstrumentType !=
InstrumentViewModel
.Instrument.Type ||
119
_renderedInstrumentIsMonotonic !=
InstrumentViewModel
.Instrument.IsMonotonic ||
121
_renderedTheme !=
InstrumentViewModel
.Theme ||
122
_renderedShowCount !=
InstrumentViewModel
.ShowCount ||
123
_renderedShowRunningTotal !=
InstrumentViewModel
.ShowRunningTotal)
126
_renderedInstrument =
InstrumentViewModel
.Instrument.GetKey();
127
_renderedInstrumentUnit =
InstrumentViewModel
.Instrument.Unit;
128
_renderedInstrumentType =
InstrumentViewModel
.Instrument.Type;
129
_renderedInstrumentIsMonotonic =
InstrumentViewModel
.Instrument.IsMonotonic;
131
_renderedTheme =
InstrumentViewModel
.Theme;
132
_renderedShowCount =
InstrumentViewModel
.ShowCount;
133
_renderedShowRunningTotal =
InstrumentViewModel
.ShowRunningTotal;
186
return $"<b>{HttpUtility.HtmlEncode(
InstrumentViewModel
.Instrument?.Name)}</b><br />{HttpUtility.HtmlEncode(name)}: {FormatHelpers.FormatNumberWithOptionalDecimalPlaces(yValue, maxDecimalPlaces: 6, CultureInfo.CurrentCulture)}<br />Time: {FormatHelpers.FormatTime(TimeProvider, xValue)}";
195
Debug.Assert(
InstrumentViewModel
.MatchedDimensions != null);
196
Debug.Assert(
InstrumentViewModel
.Instrument != null);
198
var unit = !
InstrumentViewModel
.ShowCount
199
? GetDisplayedUnit(
InstrumentViewModel
.Instrument)
202
var showChangePerInterval = ChartDataCalculator.IsMonotonicCounter(
InstrumentViewModel
.Instrument) && !
InstrumentViewModel
.ShowRunningTotal;
212
if (
InstrumentViewModel
.Instrument?.Type != OtlpInstrumentType.Histogram ||
InstrumentViewModel
.ShowCount)
214
data = calculator.CalculateChartValues(
InstrumentViewModel
.MatchedDimensions, _currentDataStartTime, TimeProvider.ToLocalDateTimeOffset, unit);
224
var increases = calculator.CalculateCounterIncreaseValues(
InstrumentViewModel
.MatchedDimensions, _currentDataStartTime,
InstrumentViewModel
.Instrument!.AggregationTemporality);
233
data = calculator.CalculateHistogramValues(
InstrumentViewModel
.MatchedDimensions, _currentDataStartTime, TimeProvider.ToLocalDateTimeOffset, unit);
236
var instrumentChanged =
InstrumentViewModel
.HasIncompatibleHistogramBounds != data.HasIncompatibleHistogramBounds ||
237
_renderedHasOverflow !=
InstrumentViewModel
.HasOverflow;
238
InstrumentViewModel
.HasIncompatibleHistogramBounds = data.HasIncompatibleHistogramBounds;
239
_renderedHasOverflow =
InstrumentViewModel
.HasOverflow;
356
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 (15)
Controls\PlotlyChartTests.cs (6)
59
builder.Add(p => p.
InstrumentViewModel
, model);
95
builder.Add(p => p.
InstrumentViewModel
, model);
152
builder.Add(p => p.
InstrumentViewModel
, model);
210
builder.Add(p => p.
InstrumentViewModel
, model);
269
builder.Add(p => p.
InstrumentViewModel
, model);
319
builder.Add(p => p.
InstrumentViewModel
, model);
Pages\MetricsTests.cs (9)
138
? cut.FindComponent<PlotlyChart>().Instance.
InstrumentViewModel
139
: cut.FindComponent<MetricTable>().Instance.
InstrumentViewModel
;
152
Assert.True(cut.FindComponent<PlotlyChart>().Instance.
InstrumentViewModel
.ShowCount);
160
Assert.True(cut.FindComponent<MetricTable>().Instance.
InstrumentViewModel
.ShowCount);
266
var instrumentViewModel = table.Instance.
InstrumentViewModel
;
631
var dimensions = chart.Instance.
InstrumentViewModel
.MatchedDimensions!;
686
Assert.Equal(!showOption, cut.FindComponent<MetricTable>().Instance.
InstrumentViewModel
.ShowRunningTotal);
744
Assert.Equal("instrument-2", updatedTable.Instance.
InstrumentViewModel
.Instrument?.Name);
745
Assert.NotEmpty(updatedTable.Instance.
InstrumentViewModel
.MatchedDimensions!);