30 instantiations of DashboardRunDescriptor
Aspire.Dashboard (1)
ServiceClient\DashboardRunStore.cs (1)
658return new DashboardRunDescriptor(
Aspire.Dashboard.Components.Tests (28)
Dialogs\DashboardRunsDialogTests.cs (2)
81var incompatibleRun = new DashboardRunDescriptor( 201new(runId, DashboardRunStore.SchemaVersion, startedAtUtc, endedAtUtc, CleanShutdown: !isCurrent, "TestApp", string.Empty, isCurrent);
Layout\MainLayoutResourceTerminalsTests.cs (2)
63new("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, true), 64new("historical", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, DateTimeOffset.UnixEpoch, true, "TestApp", string.Empty, false)
Layout\MainLayoutTerminalTests.cs (2)
96new("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, true), 97new("historical", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, DateTimeOffset.UnixEpoch, true, "TestApp", string.Empty, false)
Layout\MainLayoutTests.cs (21)
479var historicalRun = new DashboardRunDescriptor( 490new( 583new( 592new( 645new( 682var currentRun = new DashboardRunDescriptor("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true); 683var pinnedRunB = new DashboardRunDescriptor("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 684var pinnedRunA = new DashboardRunDescriptor("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 685var olderPinnedRun = new DashboardRunDescriptor("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 686var unpinnedRun = new DashboardRunDescriptor("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false); 687var incompatibleRun = new DashboardRunDescriptor("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 688var unavailableRun = new DashboardRunDescriptor("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 689var prunedRun = new DashboardRunDescriptor("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true }; 730new("run", DashboardRunStore.SchemaVersion, startedAtUtc, endedAtUtc, CleanShutdown: endedAtUtc is not null, "TestApp", string.Empty, isCurrent); 743new( 787var historicalRun = new DashboardRunDescriptor( 798new( 843new( 852new( 904var historicalRun = new DashboardRunDescriptor( 915new(
Shared\FluentUISetupHelpers.cs (1)
297new(
Aspire.Dashboard.Tests (1)
Shared\TestDashboardDataSource.cs (1)
47[new("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", databasePath ?? string.Empty, IsCurrent: true)])
106 references to DashboardRunDescriptor
Aspire.Dashboard (45)
Components\Controls\DashboardRunMenu.razor.cs (3)
63foreach (var run in runs) 106private void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 118private string FormatRunOption(DashboardRunDescriptor run)
Components\Controls\DashboardRunSelect.razor.cs (7)
48internal static List<DashboardRunDescriptor> GetSortedRuns(IReadOnlyList<DashboardRunDescriptor> storedRuns) 50var runs = new List<DashboardRunDescriptor>(storedRuns.Count); 51foreach (var run in storedRuns) 63private static int CompareRuns(DashboardRunDescriptor left, DashboardRunDescriptor right) 104internal static string? FormatRunDuration(DashboardRunDescriptor run)
Components\Dialogs\DashboardRunsDialog.razor.cs (4)
60internal string GetPinButtonId(DashboardRunDescriptor run) => $"{_idPrefix}-pin-{Uri.EscapeDataString(run.RunId)}"; 62private async Task SelectRunAsync(DashboardRunDescriptor run) 74private void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 87private string FormatRunOption(DashboardRunDescriptor run) => run.IsCurrent
ServiceClient\DashboardDataSource.cs (9)
16DashboardRunDescriptor SelectedRun { get; } 54internal DashboardRunDescriptor SelectedRun { get; private set; } = null!; 76DashboardRunDescriptor IDashboardRunSelection.SelectedRun => SelectedRun; 82var currentRun = _runStore.GetCurrentRun(); 83var selectedRun = runId is not null ? _runStore.GetRunById(runId, onlyCompatible: true) : null; 99var previousRun = SelectedRun; 150private void SelectCurrentRun(DashboardRunDescriptor currentRun) 159private void LogRunSwitch(DashboardRunDescriptor? previousRun, DashboardRunDescriptor selectedRun)
ServiceClient\DashboardDataSourcePool.cs (2)
49var currentRun = _runStore.GetCurrentRun(); 74public Lease? TryAcquire(DashboardRunDescriptor run)
ServiceClient\DashboardRunStore.cs (20)
30IReadOnlyList<DashboardRunDescriptor> GetRuns(); 36DashboardRunDescriptor GetCurrentRun(); 44DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible); 51void SetRunPinned(DashboardRunDescriptor run, bool isPinned); 58IDisposable? TryAcquireRunLease(DashboardRunDescriptor run); 98private readonly Lazy<IReadOnlyList<DashboardRunDescriptor>> _runs; 288public IReadOnlyList<DashboardRunDescriptor> GetRuns() => 291public DashboardRunDescriptor GetCurrentRun() => GetRuns().Single(run => run.IsCurrent); 293public DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible) => 298public void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 300var storedRun = GetRunById(run.RunId, onlyCompatible: false); 319private void UpdatePinnedState(DashboardRunDescriptor run, string runDirectory, bool isPinned) 369public IDisposable? TryAcquireRunLease(DashboardRunDescriptor run) 371var storedRun = GetRunById(run.RunId, onlyCompatible: true); 391private IReadOnlyList<DashboardRunDescriptor> LoadRuns() 393var runs = new List<DashboardRunDescriptor> 420var run = CreateDescriptor(metadata, directory, isCurrent: false); 512foreach (var run in _runs.Value.Where(run => !run.IsPinned).Skip(MaxRuns)) 656private static DashboardRunDescriptor CreateDescriptor(DashboardRunMetadata metadata, string runDirectory, bool isCurrent) 726private sealed class RunLease(DashboardRunStore owner, DashboardRunDescriptor run, FileLock runLock) : IDisposable
Aspire.Dashboard.Components.Tests (32)
Dialogs\DashboardRunsDialogTests.cs (9)
19private static readonly DashboardRunDescriptor s_currentRun = CreateRun("current", DateTimeOffset.UnixEpoch, isCurrent: true); 24var historicalRun = CreateRun( 69var historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch); 81var incompatibleRun = new DashboardRunDescriptor( 84var unavailableRun = CreateRun("unavailable", new DateTimeOffset(2025, 1, 3, 12, 30, 0, TimeSpan.Zero)); 106var historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch); 155var historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch); 179private IRenderedComponent<DashboardRunsDialog> RenderDialog(DashboardRunDescriptor[] runs, string? selectedRunId = null, Action<string?>? onSelect = null) 200private static DashboardRunDescriptor CreateRun(string runId, DateTimeOffset startedAtUtc, DateTimeOffset? endedAtUtc = null, bool isCurrent = false) =>
Layout\MainLayoutTests.cs (12)
479var historicalRun = new DashboardRunDescriptor( 682var currentRun = new DashboardRunDescriptor("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true); 683var pinnedRunB = new DashboardRunDescriptor("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 684var pinnedRunA = new DashboardRunDescriptor("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 685var olderPinnedRun = new DashboardRunDescriptor("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 686var unpinnedRun = new DashboardRunDescriptor("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false); 687var incompatibleRun = new DashboardRunDescriptor("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 688var unavailableRun = new DashboardRunDescriptor("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 689var prunedRun = new DashboardRunDescriptor("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true }; 729DashboardRunDescriptor CreateRun(DateTimeOffset? endedAtUtc, bool isCurrent = false) => 787var historicalRun = new DashboardRunDescriptor( 904var historicalRun = new DashboardRunDescriptor(
Shared\FluentUISetupHelpers.cs (11)
291IEnumerable<DashboardRunDescriptor>? runs = null, 295private readonly IReadOnlyList<DashboardRunDescriptor> _runs = (runs ?? 316public Action<DashboardRunDescriptor, bool>? OnSetRunPinned { get; set; } 318public IReadOnlyList<DashboardRunDescriptor> GetRuns() 324public DashboardRunDescriptor GetCurrentRun() => WithDefaultDatabasePath(_runs.Single(run => run.IsCurrent)); 326public DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible) => 334public void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 340public IDisposable? TryAcquireRunLease(DashboardRunDescriptor run) => null; 342private DashboardRunDescriptor WithDefaultDatabasePath(DashboardRunDescriptor run) => 360public DashboardRunDescriptor SelectedRun { get; private set; } = runStore.GetCurrentRun();
Aspire.Dashboard.Tests (29)
Integration\StartupTests.cs (1)
115var currentRun = app.Services.GetRequiredService<IDashboardRunStore>().GetRuns().Single(run => run.IsCurrent);
Model\DashboardDataSourceTests.cs (20)
294var currentRun = Assert.Single(currentRunStore.GetRuns()); 306var historicalRun = nextRunStore.GetRuns().Single(run => string.Equals(run.RunId, pinnedRunId, StringComparison.Ordinal)); 811var incompatibleRun = Assert.Single( 855var futureRun = Assert.Single( 899var incompatibleRun = Assert.Single( 929var currentRun = runStore.GetCurrentRun(); 960var activeRun = Assert.Single(runs, run => string.Equals(run.RunId, activeRunStore.RunId, StringComparison.Ordinal)); 1050var prunedRun = Assert.Single(runsBeforePruning, run => run.IsPruned); 1080var run = pinningRunStore.GetRuns().Single(run => string.Equals(run.RunId, runId, StringComparison.Ordinal)); 1200var historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal)); 1250var historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal)); 1321var currentRun = Assert.Single(currentRunStore.GetRuns(), run => run.IsCurrent); 1322var malformedRun = currentRun with 1371var currentRun = Assert.Single(currentRunStore.GetRuns()); 1372var historicalRun = currentRun with 1378var malformedRun = currentRun with 1384var unavailableRun = currentRun with 1584var currentRun = Assert.Single(currentRunStore.GetRuns()); 1585var incompatibleRun = currentRun with 1721private static FileStream? TryOpenTestRunLease(DashboardRunDescriptor run)
Shared\TestDashboardDataSource.cs (8)
42IEnumerable<DashboardRunDescriptor>? runs = null, 43Func<DashboardRunDescriptor, IDisposable?>? tryAcquireRunLease = null, 46private readonly IReadOnlyList<DashboardRunDescriptor> _runs = (runs ?? 52public IReadOnlyList<DashboardRunDescriptor> GetRuns() => _runs; 54public DashboardRunDescriptor GetCurrentRun() => _runs.Single(run => run.IsCurrent); 56public DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible) => 62public void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 67public IDisposable? TryAcquireRunLease(DashboardRunDescriptor run) => tryAcquireRunLease?.Invoke(run);