39 instantiations of DashboardRunDescriptor
Aspire.Dashboard (1)
ServiceClient\DashboardRunStore.cs (1)
599
return new
DashboardRunDescriptor
(
Aspire.Dashboard.Components.Tests (37)
Layout\MainLayoutResourceTerminalsTests.cs (2)
64
new
("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, true),
65
new
("historical", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, DateTimeOffset.UnixEpoch, true, "TestApp", string.Empty, false)
Layout\MainLayoutTerminalTests.cs (2)
97
new
("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, true),
98
new
("historical", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, DateTimeOffset.UnixEpoch, true, "TestApp", string.Empty, false)
Layout\MainLayoutTests.cs (32)
317
var historicalRun = new
DashboardRunDescriptor
(
328
new
(
365
var incompatibleRun = new
DashboardRunDescriptor
(
374
var currentRun = new
DashboardRunDescriptor
(
383
var unavailableRun = new
DashboardRunDescriptor
(
435
new
(
469
var historicalRun = new
DashboardRunDescriptor
(
480
new
(
676
new
(
685
new
(
738
var currentRun = new
DashboardRunDescriptor
(
747
var historicalRun = new
DashboardRunDescriptor
(
792
var currentRun = new
DashboardRunDescriptor
("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true);
793
var pinnedRunB = new
DashboardRunDescriptor
("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
794
var pinnedRunA = new
DashboardRunDescriptor
("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
795
var olderPinnedRun = new
DashboardRunDescriptor
("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
796
var unpinnedRun = new
DashboardRunDescriptor
("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false);
797
var incompatibleRun = new
DashboardRunDescriptor
("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
798
var unavailableRun = new
DashboardRunDescriptor
("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
799
var prunedRun = new
DashboardRunDescriptor
("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true };
821
var currentRun = new
DashboardRunDescriptor
(
832
new
DashboardRunDescriptor
("unpinned-b", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 12, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false),
833
new
DashboardRunDescriptor
("pinned-b", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 11, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false),
834
new
DashboardRunDescriptor
("unpinned-a", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 9, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false),
835
new
DashboardRunDescriptor
("pinned-a", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 10, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false)
916
new
(
960
var historicalRun = new
DashboardRunDescriptor
(
971
new
(
1014
new
(
1023
new
(
1073
var historicalRun = new
DashboardRunDescriptor
(
1084
new
(
Shared\FluentUISetupHelpers.cs (1)
271
new
(
Aspire.Dashboard.Tests (1)
Shared\TestDashboardDataSource.cs (1)
47
[
new
("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", databasePath ?? string.Empty, IsCurrent: true)])
97 references to DashboardRunDescriptor
Aspire.Dashboard (40)
Components\Controls\DashboardRunSelect.razor.cs (9)
59
foreach (
var
run in runs)
102
internal static List<
DashboardRunDescriptor
> GetSortedRuns(IReadOnlyList<
DashboardRunDescriptor
> storedRuns)
104
var runs = new List<
DashboardRunDescriptor
>(storedRuns.Count);
105
foreach (
var
run in storedRuns)
117
private static int CompareRuns(
DashboardRunDescriptor
left,
DashboardRunDescriptor
right)
136
private void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned)
148
private string FormatRunOption(
DashboardRunDescriptor
run)
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);
94
private readonly Lazy<IReadOnlyList<
DashboardRunDescriptor
>> _runs;
293
public IReadOnlyList<
DashboardRunDescriptor
> GetRuns() =>
296
public
DashboardRunDescriptor
GetCurrentRun() => GetRuns().Single(run => run.IsCurrent);
298
public
DashboardRunDescriptor
? GetRunById(string runId, bool onlyCompatible) =>
303
public void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned)
305
var
storedRun = GetRunById(run.RunId, onlyCompatible: false);
324
private void UpdatePinnedState(
DashboardRunDescriptor
run, string runDirectory, bool isPinned)
374
public IDisposable? TryAcquireRunLease(
DashboardRunDescriptor
run)
376
var
storedRun = GetRunById(run.RunId, onlyCompatible: true);
396
private IReadOnlyList<
DashboardRunDescriptor
> LoadRuns()
398
var runs = new List<
DashboardRunDescriptor
>
425
var
run = CreateDescriptor(metadata, directory, isCurrent: false);
517
foreach (
var
run in _runs.Value.Where(run => !run.IsPinned).Skip(MaxRuns))
597
private static
DashboardRunDescriptor
CreateDescriptor(DashboardRunMetadata metadata, string runDirectory, bool isCurrent)
667
private sealed class RunLease(DashboardRunStore owner,
DashboardRunDescriptor
run, FileLock runLock) : IDisposable
Aspire.Dashboard.Components.Tests (28)
Layout\MainLayoutTests.cs (19)
317
var
historicalRun = new DashboardRunDescriptor(
365
var
incompatibleRun = new DashboardRunDescriptor(
374
var
currentRun = new DashboardRunDescriptor(
383
var
unavailableRun = new DashboardRunDescriptor(
469
var
historicalRun = new DashboardRunDescriptor(
592
var
currentRun = runStore.GetRuns().Single(run => run.IsCurrent);
738
var
currentRun = new DashboardRunDescriptor(
747
var
historicalRun = new DashboardRunDescriptor(
792
var
currentRun = new DashboardRunDescriptor("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true);
793
var
pinnedRunB = new DashboardRunDescriptor("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
794
var
pinnedRunA = new DashboardRunDescriptor("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
795
var
olderPinnedRun = new DashboardRunDescriptor("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true };
796
var
unpinnedRun = new DashboardRunDescriptor("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false);
797
var
incompatibleRun = new DashboardRunDescriptor("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
798
var
unavailableRun = new DashboardRunDescriptor("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false };
799
var
prunedRun = new DashboardRunDescriptor("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true };
821
var
currentRun = new DashboardRunDescriptor(
960
var
historicalRun = new DashboardRunDescriptor(
1073
var
historicalRun = new DashboardRunDescriptor(
Shared\FluentUISetupHelpers.cs (9)
265
IEnumerable<
DashboardRunDescriptor
>? runs = null,
269
private readonly IReadOnlyList<
DashboardRunDescriptor
> _runs = (runs ??
284
public Action<
DashboardRunDescriptor
, bool>? OnSetRunPinned { get; set; }
286
public IReadOnlyList<
DashboardRunDescriptor
> GetRuns()
292
public
DashboardRunDescriptor
GetCurrentRun() => _runs.Single(run => run.IsCurrent);
294
public
DashboardRunDescriptor
? GetRunById(string runId, bool onlyCompatible) =>
300
public void SetRunPinned(
DashboardRunDescriptor
run, bool isPinned)
306
public IDisposable? TryAcquireRunLease(
DashboardRunDescriptor
run) => null;
321
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)
250
var
currentRun = Assert.Single(currentRunStore.GetRuns());
262
var
historicalRun = nextRunStore.GetRuns().Single(run => string.Equals(run.RunId, pinnedRunId, StringComparison.Ordinal));
767
var
incompatibleRun = Assert.Single(
811
var
futureRun = Assert.Single(
855
var
incompatibleRun = Assert.Single(
885
var
currentRun = runStore.GetCurrentRun();
916
var
activeRun = Assert.Single(runs, run => string.Equals(run.RunId, activeRunStore.RunId, StringComparison.Ordinal));
1006
var
prunedRun = Assert.Single(runsBeforePruning, run => run.IsPruned);
1036
var
run = pinningRunStore.GetRuns().Single(run => string.Equals(run.RunId, runId, StringComparison.Ordinal));
1156
var
historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal));
1206
var
historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal));
1277
var
currentRun = Assert.Single(currentRunStore.GetRuns(), run => run.IsCurrent);
1278
var
malformedRun = currentRun with
1327
var
currentRun = Assert.Single(currentRunStore.GetRuns());
1328
var
historicalRun = currentRun with
1334
var
malformedRun = currentRun with
1340
var
unavailableRun = currentRun with
1540
var
currentRun = Assert.Single(currentRunStore.GetRuns());
1541
var
incompatibleRun = currentRun with
1677
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);