30 instantiations of DashboardRunDescriptor
Aspire.Dashboard (1)
ServiceClient\DashboardRunStore.cs (1)
658
return new
DashboardRunDescriptor
(
Aspire.Dashboard.Components.Tests (28)
Dialogs\DashboardRunsDialogTests.cs (2)
81
var incompatibleRun = new
DashboardRunDescriptor
(
201
new
(runId, DashboardRunStore.SchemaVersion, startedAtUtc, endedAtUtc, CleanShutdown: !isCurrent, "TestApp", string.Empty, isCurrent);
Layout\MainLayoutResourceTerminalsTests.cs (2)
63
new
("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, true),
64
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)
479
var historicalRun = new
DashboardRunDescriptor
(
490
new
(
583
new
(
592
new
(
645
new
(
682
var currentRun = new
DashboardRunDescriptor
("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true);
683
var pinnedRunB = new
DashboardRunDescriptor
("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
684
var pinnedRunA = new
DashboardRunDescriptor
("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
685
var olderPinnedRun = new
DashboardRunDescriptor
("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
686
var unpinnedRun = new
DashboardRunDescriptor
("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false);
687
var incompatibleRun = new
DashboardRunDescriptor
("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
688
var unavailableRun = new
DashboardRunDescriptor
("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
689
var prunedRun = new
DashboardRunDescriptor
("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true };
730
new
("run", DashboardRunStore.SchemaVersion, startedAtUtc, endedAtUtc, CleanShutdown: endedAtUtc is not null, "TestApp", string.Empty, isCurrent);
743
new
(
787
var historicalRun = new
DashboardRunDescriptor
(
798
new
(
843
new
(
852
new
(
904
var historicalRun = new
DashboardRunDescriptor
(
915
new
(
Shared\FluentUISetupHelpers.cs (1)
297
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)
104
internal static string? FormatRunDuration(
DashboardRunDescriptor
run)
Components\Dialogs\DashboardRunsDialog.razor.cs (4)
60
internal string GetPinButtonId(
DashboardRunDescriptor
run) => $"{_idPrefix}-pin-{Uri.EscapeDataString(run.RunId)}";
62
private async Task SelectRunAsync(
DashboardRunDescriptor
run)
74
private void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned)
87
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;
288
public IReadOnlyList<
DashboardRunDescriptor
> GetRuns() =>
291
public
DashboardRunDescriptor
GetCurrentRun() => GetRuns().Single(run => run.IsCurrent);
293
public
DashboardRunDescriptor
? GetRunById(string runId, bool onlyCompatible) =>
298
public void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned)
300
var
storedRun = GetRunById(run.RunId, onlyCompatible: false);
319
private void UpdatePinnedState(
DashboardRunDescriptor
run, string runDirectory, bool isPinned)
369
public IDisposable? TryAcquireRunLease(
DashboardRunDescriptor
run)
371
var
storedRun = GetRunById(run.RunId, onlyCompatible: true);
391
private IReadOnlyList<
DashboardRunDescriptor
> LoadRuns()
393
var runs = new List<
DashboardRunDescriptor
>
420
var
run = CreateDescriptor(metadata, directory, isCurrent: false);
512
foreach (
var
run in _runs.Value.Where(run => !run.IsPinned).Skip(MaxRuns))
656
private static
DashboardRunDescriptor
CreateDescriptor(DashboardRunMetadata metadata, string runDirectory, bool isCurrent)
726
private sealed class RunLease(DashboardRunStore owner,
DashboardRunDescriptor
run, FileLock runLock) : IDisposable
Aspire.Dashboard.Components.Tests (32)
Dialogs\DashboardRunsDialogTests.cs (9)
19
private static readonly
DashboardRunDescriptor
s_currentRun = CreateRun("current", DateTimeOffset.UnixEpoch, isCurrent: true);
24
var
historicalRun = CreateRun(
69
var
historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch);
81
var
incompatibleRun = new DashboardRunDescriptor(
84
var
unavailableRun = CreateRun("unavailable", new DateTimeOffset(2025, 1, 3, 12, 30, 0, TimeSpan.Zero));
106
var
historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch);
155
var
historicalRun = CreateRun("historical", DateTimeOffset.UnixEpoch, endedAtUtc: DateTimeOffset.UnixEpoch);
179
private IRenderedComponent<DashboardRunsDialog> RenderDialog(
DashboardRunDescriptor
[] runs, string? selectedRunId = null, Action<string?>? onSelect = null)
200
private static
DashboardRunDescriptor
CreateRun(string runId, DateTimeOffset startedAtUtc, DateTimeOffset? endedAtUtc = null, bool isCurrent = false) =>
Layout\MainLayoutTests.cs (12)
479
var
historicalRun = new DashboardRunDescriptor(
682
var
currentRun = new DashboardRunDescriptor("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true);
683
var
pinnedRunB = new DashboardRunDescriptor("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
684
var
pinnedRunA = new DashboardRunDescriptor("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
685
var
olderPinnedRun = new DashboardRunDescriptor("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
686
var
unpinnedRun = new DashboardRunDescriptor("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false);
687
var
incompatibleRun = new DashboardRunDescriptor("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
688
var
unavailableRun = new DashboardRunDescriptor("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
689
var
prunedRun = new DashboardRunDescriptor("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true };
729
DashboardRunDescriptor
CreateRun(DateTimeOffset? endedAtUtc, bool isCurrent = false) =>
787
var
historicalRun = new DashboardRunDescriptor(
904
var
historicalRun = new DashboardRunDescriptor(
Shared\FluentUISetupHelpers.cs (11)
291
IEnumerable<
DashboardRunDescriptor
>? runs = null,
295
private readonly IReadOnlyList<
DashboardRunDescriptor
> _runs = (runs ??
316
public Action<
DashboardRunDescriptor
, bool>? OnSetRunPinned { get; set; }
318
public IReadOnlyList<
DashboardRunDescriptor
> GetRuns()
324
public
DashboardRunDescriptor
GetCurrentRun() => WithDefaultDatabasePath(_runs.Single(run => run.IsCurrent));
326
public
DashboardRunDescriptor
? GetRunById(string runId, bool onlyCompatible) =>
334
public void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned)
340
public IDisposable? TryAcquireRunLease(
DashboardRunDescriptor
run) => null;
342
private
DashboardRunDescriptor
WithDefaultDatabasePath(
DashboardRunDescriptor
run) =>
360
public
DashboardRunDescriptor
SelectedRun { get; private set; } = runStore.GetCurrentRun();
Aspire.Dashboard.Tests (29)
Integration\StartupTests.cs (1)
115
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));
811
var
incompatibleRun = Assert.Single(
855
var
futureRun = Assert.Single(
899
var
incompatibleRun = Assert.Single(
929
var
currentRun = runStore.GetCurrentRun();
960
var
activeRun = Assert.Single(runs, run => string.Equals(run.RunId, activeRunStore.RunId, StringComparison.Ordinal));
1050
var
prunedRun = Assert.Single(runsBeforePruning, run => run.IsPruned);
1080
var
run = pinningRunStore.GetRuns().Single(run => string.Equals(run.RunId, runId, StringComparison.Ordinal));
1200
var
historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal));
1250
var
historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal));
1321
var
currentRun = Assert.Single(currentRunStore.GetRuns(), run => run.IsCurrent);
1322
var
malformedRun = currentRun with
1371
var
currentRun = Assert.Single(currentRunStore.GetRuns());
1372
var
historicalRun = currentRun with
1378
var
malformedRun = currentRun with
1384
var
unavailableRun = currentRun with
1584
var
currentRun = Assert.Single(currentRunStore.GetRuns());
1585
var
incompatibleRun = currentRun with
1721
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);