30 instantiations of DashboardRunDescriptor
Aspire.Dashboard (1)
ServiceClient\DashboardRunStore.cs (1)
659return new DashboardRunDescriptor(
Aspire.Dashboard.Components.Tests (28)
Dialogs\DashboardRunsDialogTests.cs (2)
78var incompatibleRun = new DashboardRunDescriptor( 198new(runId, DashboardRunStore.SchemaVersion, startedAtUtc, endedAtUtc, CleanShutdown: !isCurrent, "TestApp", string.Empty, isCurrent);
Layout\MainLayoutResourceTerminalsTests.cs (2)
88new("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, true), 89new("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)
625var historicalRun = new DashboardRunDescriptor( 636new( 725new( 734new( 787new( 822var currentRun = new DashboardRunDescriptor("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true); 823var pinnedRunB = new DashboardRunDescriptor("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 824var pinnedRunA = new DashboardRunDescriptor("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 825var olderPinnedRun = new DashboardRunDescriptor("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 826var unpinnedRun = new DashboardRunDescriptor("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false); 827var incompatibleRun = new DashboardRunDescriptor("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 828var unavailableRun = new DashboardRunDescriptor("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 829var prunedRun = new DashboardRunDescriptor("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true }; 853new("run", DashboardRunStore.SchemaVersion, startedAtUtc, endedAtUtc, CleanShutdown: endedAtUtc is not null, "TestApp", string.Empty, isCurrent); 866new( 904var historicalRun = new DashboardRunDescriptor( 915new( 958new( 967new( 1017var historicalRun = new DashboardRunDescriptor( 1028new(
Shared\FluentUISetupHelpers.cs (1)
298new(
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) 84internal static string? FormatRunDuration(DashboardRunDescriptor run)
Components\Dialogs\DashboardRunsDialog.razor.cs (4)
59internal string GetPinButtonId(DashboardRunDescriptor run) => $"{_idPrefix}-pin-{Uri.EscapeDataString(run.RunId)}"; 61private async Task SelectRunAsync(DashboardRunDescriptor run) 73private void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 86private 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; 289public IReadOnlyList<DashboardRunDescriptor> GetRuns() => 292public DashboardRunDescriptor GetCurrentRun() => GetRuns().Single(run => run.IsCurrent); 294public DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible) => 299public void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 301var storedRun = GetRunById(run.RunId, onlyCompatible: false); 320private void UpdatePinnedState(DashboardRunDescriptor run, string runDirectory, bool isPinned) 370public IDisposable? TryAcquireRunLease(DashboardRunDescriptor run) 372var storedRun = GetRunById(run.RunId, onlyCompatible: true); 392private IReadOnlyList<DashboardRunDescriptor> LoadRuns() 394var runs = new List<DashboardRunDescriptor> 421var run = CreateDescriptor(metadata, directory, isCurrent: false); 513foreach (var run in _runs.Value.Where(run => !run.IsPinned).Skip(MaxRuns)) 657private static DashboardRunDescriptor CreateDescriptor(DashboardRunMetadata metadata, string runDirectory, bool isCurrent) 727private sealed class RunLease(DashboardRunStore owner, DashboardRunDescriptor run, FileLock runLock) : IDisposable
Aspire.Dashboard.Components.Tests (32)
Dialogs\DashboardRunsDialogTests.cs (9)
18private static readonly DashboardRunDescriptor s_currentRun = CreateRun("current", DateTimeOffset.UnixEpoch, isCurrent: true); 23var historicalRun = CreateRun( 66var historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch); 78var incompatibleRun = new DashboardRunDescriptor( 81var unavailableRun = CreateRun("unavailable", new DateTimeOffset(2025, 1, 3, 12, 30, 0, TimeSpan.Zero)); 103var historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch); 152var historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch); 176private IRenderedComponent<DashboardRunsDialog> RenderDialog(DashboardRunDescriptor[] runs, string? selectedRunId = null, Action<string?>? onSelect = null) 197private static DashboardRunDescriptor CreateRun(string runId, DateTimeOffset startedAtUtc, DateTimeOffset? endedAtUtc = null, bool isCurrent = false) =>
Layout\MainLayoutTests.cs (12)
625var historicalRun = new DashboardRunDescriptor( 822var currentRun = new DashboardRunDescriptor("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true); 823var pinnedRunB = new DashboardRunDescriptor("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 824var pinnedRunA = new DashboardRunDescriptor("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 825var olderPinnedRun = new DashboardRunDescriptor("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 826var unpinnedRun = new DashboardRunDescriptor("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false); 827var incompatibleRun = new DashboardRunDescriptor("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 828var unavailableRun = new DashboardRunDescriptor("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 829var prunedRun = new DashboardRunDescriptor("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true }; 852DashboardRunDescriptor CreateRun(DateTimeOffset? endedAtUtc, bool isCurrent = false) => 904var historicalRun = new DashboardRunDescriptor( 1017var historicalRun = new DashboardRunDescriptor(
Shared\FluentUISetupHelpers.cs (11)
292IEnumerable<DashboardRunDescriptor>? runs = null, 296private readonly IReadOnlyList<DashboardRunDescriptor> _runs = (runs ?? 317public Action<DashboardRunDescriptor, bool>? OnSetRunPinned { get; set; } 319public IReadOnlyList<DashboardRunDescriptor> GetRuns() 325public DashboardRunDescriptor GetCurrentRun() => WithDefaultDatabasePath(_runs.Single(run => run.IsCurrent)); 327public DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible) => 335public void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 341public IDisposable? TryAcquireRunLease(DashboardRunDescriptor run) => null; 343private DashboardRunDescriptor WithDefaultDatabasePath(DashboardRunDescriptor run) => 361public DashboardRunDescriptor SelectedRun { get; private set; } = runStore.GetCurrentRun();
Aspire.Dashboard.Tests (29)
Integration\StartupTests.cs (1)
165var 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)); 814var incompatibleRun = Assert.Single( 858var futureRun = Assert.Single( 902var incompatibleRun = Assert.Single( 932var currentRun = runStore.GetCurrentRun(); 963var activeRun = Assert.Single(runs, run => string.Equals(run.RunId, activeRunStore.RunId, StringComparison.Ordinal)); 1053var prunedRun = Assert.Single(runsBeforePruning, run => run.IsPruned); 1083var run = pinningRunStore.GetRuns().Single(run => string.Equals(run.RunId, runId, StringComparison.Ordinal)); 1205var historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal)); 1255var historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal)); 1327var currentRun = Assert.Single(currentRunStore.GetRuns(), run => run.IsCurrent); 1328var malformedRun = currentRun with 1377var currentRun = Assert.Single(currentRunStore.GetRuns()); 1378var historicalRun = currentRun with 1384var malformedRun = currentRun with 1390var unavailableRun = currentRun with 1590var currentRun = Assert.Single(currentRunStore.GetRuns()); 1591var incompatibleRun = currentRun with 1727private 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);