30 instantiations of DashboardRunDescriptor
Aspire.Dashboard (1)
ServiceClient\DashboardRunStore.cs (1)
659
return new
DashboardRunDescriptor
(
Aspire.Dashboard.Components.Tests (28)
Dialogs\DashboardRunsDialogTests.cs (2)
78
var incompatibleRun = new
DashboardRunDescriptor
(
198
new
(runId, DashboardRunStore.SchemaVersion, startedAtUtc, endedAtUtc, CleanShutdown: !isCurrent, "TestApp", string.Empty, isCurrent);
Layout\MainLayoutResourceTerminalsTests.cs (2)
88
new
("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, true),
89
new
("historical", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, DateTimeOffset.UnixEpoch, true, "TestApp", string.Empty, false)
Layout\MainLayoutTerminalTests.cs (2)
96
new
("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, true),
97
new
("historical", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, DateTimeOffset.UnixEpoch, true, "TestApp", string.Empty, false)
Layout\MainLayoutTests.cs (21)
625
var historicalRun = new
DashboardRunDescriptor
(
636
new
(
725
new
(
734
new
(
787
new
(
822
var currentRun = new
DashboardRunDescriptor
("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true);
823
var pinnedRunB = new
DashboardRunDescriptor
("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
824
var pinnedRunA = new
DashboardRunDescriptor
("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
825
var olderPinnedRun = new
DashboardRunDescriptor
("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
826
var unpinnedRun = new
DashboardRunDescriptor
("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false);
827
var incompatibleRun = new
DashboardRunDescriptor
("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
828
var unavailableRun = new
DashboardRunDescriptor
("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
829
var prunedRun = new
DashboardRunDescriptor
("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true };
853
new
("run", DashboardRunStore.SchemaVersion, startedAtUtc, endedAtUtc, CleanShutdown: endedAtUtc is not null, "TestApp", string.Empty, isCurrent);
866
new
(
904
var historicalRun = new
DashboardRunDescriptor
(
915
new
(
958
new
(
967
new
(
1017
var historicalRun = new
DashboardRunDescriptor
(
1028
new
(
Shared\FluentUISetupHelpers.cs (1)
298
new
(
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)
63
foreach (
var
run in runs)
106
private void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned)
118
private string FormatRunOption(
DashboardRunDescriptor
run)
Components\Controls\DashboardRunSelect.razor.cs (7)
48
internal static List<
DashboardRunDescriptor
> GetSortedRuns(IReadOnlyList<
DashboardRunDescriptor
> storedRuns)
50
var runs = new List<
DashboardRunDescriptor
>(storedRuns.Count);
51
foreach (
var
run in storedRuns)
63
private static int CompareRuns(
DashboardRunDescriptor
left,
DashboardRunDescriptor
right)
84
internal static string? FormatRunDuration(
DashboardRunDescriptor
run)
Components\Dialogs\DashboardRunsDialog.razor.cs (4)
59
internal string GetPinButtonId(
DashboardRunDescriptor
run) => $"{_idPrefix}-pin-{Uri.EscapeDataString(run.RunId)}";
61
private async Task SelectRunAsync(
DashboardRunDescriptor
run)
73
private void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned)
86
private string FormatRunOption(
DashboardRunDescriptor
run) => run.IsCurrent
ServiceClient\DashboardDataSource.cs (9)
16
DashboardRunDescriptor
SelectedRun { get; }
54
internal
DashboardRunDescriptor
SelectedRun { get; private set; } = null!;
76
DashboardRunDescriptor
IDashboardRunSelection.SelectedRun => SelectedRun;
82
var
currentRun = _runStore.GetCurrentRun();
83
var
selectedRun = runId is not null ? _runStore.GetRunById(runId, onlyCompatible: true) : null;
99
var
previousRun = SelectedRun;
150
private void SelectCurrentRun(
DashboardRunDescriptor
currentRun)
159
private void LogRunSwitch(
DashboardRunDescriptor
? previousRun,
DashboardRunDescriptor
selectedRun)
ServiceClient\DashboardDataSourcePool.cs (2)
49
var
currentRun = _runStore.GetCurrentRun();
74
public Lease? TryAcquire(
DashboardRunDescriptor
run)
ServiceClient\DashboardRunStore.cs (20)
30
IReadOnlyList<
DashboardRunDescriptor
> GetRuns();
36
DashboardRunDescriptor
GetCurrentRun();
44
DashboardRunDescriptor
? GetRunById(string runId, bool onlyCompatible);
51
void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned);
58
IDisposable? TryAcquireRunLease(
DashboardRunDescriptor
run);
98
private readonly Lazy<IReadOnlyList<
DashboardRunDescriptor
>> _runs;
289
public IReadOnlyList<
DashboardRunDescriptor
> GetRuns() =>
292
public
DashboardRunDescriptor
GetCurrentRun() => GetRuns().Single(run => run.IsCurrent);
294
public
DashboardRunDescriptor
? GetRunById(string runId, bool onlyCompatible) =>
299
public void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned)
301
var
storedRun = GetRunById(run.RunId, onlyCompatible: false);
320
private void UpdatePinnedState(
DashboardRunDescriptor
run, string runDirectory, bool isPinned)
370
public IDisposable? TryAcquireRunLease(
DashboardRunDescriptor
run)
372
var
storedRun = GetRunById(run.RunId, onlyCompatible: true);
392
private IReadOnlyList<
DashboardRunDescriptor
> LoadRuns()
394
var runs = new List<
DashboardRunDescriptor
>
421
var
run = CreateDescriptor(metadata, directory, isCurrent: false);
513
foreach (
var
run in _runs.Value.Where(run => !run.IsPinned).Skip(MaxRuns))
657
private static
DashboardRunDescriptor
CreateDescriptor(DashboardRunMetadata metadata, string runDirectory, bool isCurrent)
727
private sealed class RunLease(DashboardRunStore owner,
DashboardRunDescriptor
run, FileLock runLock) : IDisposable
Aspire.Dashboard.Components.Tests (32)
Dialogs\DashboardRunsDialogTests.cs (9)
18
private static readonly
DashboardRunDescriptor
s_currentRun = CreateRun("current", DateTimeOffset.UnixEpoch, isCurrent: true);
23
var
historicalRun = CreateRun(
66
var
historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch);
78
var
incompatibleRun = new DashboardRunDescriptor(
81
var
unavailableRun = CreateRun("unavailable", new DateTimeOffset(2025, 1, 3, 12, 30, 0, TimeSpan.Zero));
103
var
historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch);
152
var
historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch);
176
private IRenderedComponent<DashboardRunsDialog> RenderDialog(
DashboardRunDescriptor
[] runs, string? selectedRunId = null, Action<string?>? onSelect = null)
197
private static
DashboardRunDescriptor
CreateRun(string runId, DateTimeOffset startedAtUtc, DateTimeOffset? endedAtUtc = null, bool isCurrent = false) =>
Layout\MainLayoutTests.cs (12)
625
var
historicalRun = new DashboardRunDescriptor(
822
var
currentRun = new DashboardRunDescriptor("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true);
823
var
pinnedRunB = new DashboardRunDescriptor("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
824
var
pinnedRunA = new DashboardRunDescriptor("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
825
var
olderPinnedRun = new DashboardRunDescriptor("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
826
var
unpinnedRun = new DashboardRunDescriptor("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false);
827
var
incompatibleRun = new DashboardRunDescriptor("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
828
var
unavailableRun = new DashboardRunDescriptor("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
829
var
prunedRun = new DashboardRunDescriptor("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true };
852
DashboardRunDescriptor
CreateRun(DateTimeOffset? endedAtUtc, bool isCurrent = false) =>
904
var
historicalRun = new DashboardRunDescriptor(
1017
var
historicalRun = new DashboardRunDescriptor(
Shared\FluentUISetupHelpers.cs (11)
292
IEnumerable<
DashboardRunDescriptor
>? runs = null,
296
private readonly IReadOnlyList<
DashboardRunDescriptor
> _runs = (runs ??
317
public Action<
DashboardRunDescriptor
, bool>? OnSetRunPinned { get; set; }
319
public IReadOnlyList<
DashboardRunDescriptor
> GetRuns()
325
public
DashboardRunDescriptor
GetCurrentRun() => WithDefaultDatabasePath(_runs.Single(run => run.IsCurrent));
327
public
DashboardRunDescriptor
? GetRunById(string runId, bool onlyCompatible) =>
335
public void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned)
341
public IDisposable? TryAcquireRunLease(
DashboardRunDescriptor
run) => null;
343
private
DashboardRunDescriptor
WithDefaultDatabasePath(
DashboardRunDescriptor
run) =>
361
public
DashboardRunDescriptor
SelectedRun { get; private set; } = runStore.GetCurrentRun();
Aspire.Dashboard.Tests (29)
Integration\StartupTests.cs (1)
165
var
currentRun = app.Services.GetRequiredService<IDashboardRunStore>().GetRuns().Single(run => run.IsCurrent);
Model\DashboardDataSourceTests.cs (20)
294
var
currentRun = Assert.Single(currentRunStore.GetRuns());
306
var
historicalRun = nextRunStore.GetRuns().Single(run => string.Equals(run.RunId, pinnedRunId, StringComparison.Ordinal));
814
var
incompatibleRun = Assert.Single(
858
var
futureRun = Assert.Single(
902
var
incompatibleRun = Assert.Single(
932
var
currentRun = runStore.GetCurrentRun();
963
var
activeRun = Assert.Single(runs, run => string.Equals(run.RunId, activeRunStore.RunId, StringComparison.Ordinal));
1053
var
prunedRun = Assert.Single(runsBeforePruning, run => run.IsPruned);
1083
var
run = pinningRunStore.GetRuns().Single(run => string.Equals(run.RunId, runId, StringComparison.Ordinal));
1205
var
historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal));
1255
var
historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal));
1327
var
currentRun = Assert.Single(currentRunStore.GetRuns(), run => run.IsCurrent);
1328
var
malformedRun = currentRun with
1377
var
currentRun = Assert.Single(currentRunStore.GetRuns());
1378
var
historicalRun = currentRun with
1384
var
malformedRun = currentRun with
1390
var
unavailableRun = currentRun with
1590
var
currentRun = Assert.Single(currentRunStore.GetRuns());
1591
var
incompatibleRun = currentRun with
1727
private static FileStream? TryOpenTestRunLease(
DashboardRunDescriptor
run)
Shared\TestDashboardDataSource.cs (8)
42
IEnumerable<
DashboardRunDescriptor
>? runs = null,
43
Func<
DashboardRunDescriptor
, IDisposable?>? tryAcquireRunLease = null,
46
private readonly IReadOnlyList<
DashboardRunDescriptor
> _runs = (runs ??
52
public IReadOnlyList<
DashboardRunDescriptor
> GetRuns() => _runs;
54
public
DashboardRunDescriptor
GetCurrentRun() => _runs.Single(run => run.IsCurrent);
56
public
DashboardRunDescriptor
? GetRunById(string runId, bool onlyCompatible) =>
62
public void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned)
67
public IDisposable? TryAcquireRunLease(
DashboardRunDescriptor
run) => tryAcquireRunLease?.Invoke(run);