8 instantiations of DashboardRunStore
Aspire.Dashboard.Tests (8)
Model\DashboardDataSourceTests.cs (8)
191
using var runStore = new
DashboardRunStore
(
358
using var runStore = new
DashboardRunStore
(
385
using var secondRunStore = new
DashboardRunStore
(options, logger, TimeProvider.System);
430
using var secondRunStore = new
DashboardRunStore
(options, logger, TimeProvider.System);
771
using var pruningRunStore = new
DashboardRunStore
(
782
using var nextPruningRunStore = new
DashboardRunStore
(
891
using var currentRunStore = new
DashboardRunStore
(
1274
return new
DashboardRunStore
(options, NullLogger<DashboardRunStore>.Instance, timeProvider ?? TimeProvider.System);
141 references to DashboardRunStore
Aspire.Dashboard (9)
DashboardWebApplication.cs (2)
320
builder.Services.AddSingleton<
DashboardRunStore
>();
321
builder.Services.AddSingleton<IDashboardRunStore>(services => services.GetRequiredService<
DashboardRunStore
>());
Model\DashboardSqliteOutgoingPeerResolver.cs (3)
14
var isDashboardSqlite = string.Equals(attributes.GetValue(OtlpSpan.PeerServiceAttributeKey),
DashboardRunStore
.DatabaseFileName, StringComparison.Ordinal) &&
16
string.Equals(attributes.GetValue("db.namespace"),
DashboardRunStore
.DatabaseFileName, StringComparison.Ordinal);
18
name = isDashboardSqlite ?
DashboardRunStore
.DatabaseFileName : null;
ServiceClient\DashboardRunStore.cs (4)
84
private readonly ILogger<
DashboardRunStore
> _logger;
91
public DashboardRunStore(IOptions<DashboardOptions> options, ILogger<
DashboardRunStore
> logger, TimeProvider timeProvider)
98
ILogger<
DashboardRunStore
> logger,
587
private sealed class RunLease(
DashboardRunStore
owner, DashboardRunDescriptor run, FileLock runLock) : IDisposable
Aspire.Dashboard.Components.Tests (22)
Layout\MainLayoutTests.cs (21)
315
SchemaVersion:
DashboardRunStore
.SchemaVersion,
326
SchemaVersion:
DashboardRunStore
.SchemaVersion,
361
SchemaVersion:
DashboardRunStore
.SchemaVersion,
395
SchemaVersion:
DashboardRunStore
.SchemaVersion,
406
SchemaVersion:
DashboardRunStore
.SchemaVersion,
573
SchemaVersion:
DashboardRunStore
.SchemaVersion,
582
SchemaVersion:
DashboardRunStore
.SchemaVersion,
634
SchemaVersion:
DashboardRunStore
.SchemaVersion,
643
SchemaVersion:
DashboardRunStore
.SchemaVersion,
688
SchemaVersion:
DashboardRunStore
.SchemaVersion,
697
new DashboardRunDescriptor("unpinned-b",
DashboardRunStore
.SchemaVersion, new(2025, 1, 2, 12, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false),
698
new DashboardRunDescriptor("pinned-b",
DashboardRunStore
.SchemaVersion, new(2025, 1, 2, 11, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false),
699
new DashboardRunDescriptor("unpinned-a",
DashboardRunStore
.SchemaVersion, new(2025, 1, 2, 9, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false),
700
new DashboardRunDescriptor("pinned-a",
DashboardRunStore
.SchemaVersion, new(2025, 1, 2, 10, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false)
752
SchemaVersion:
DashboardRunStore
.SchemaVersion,
796
SchemaVersion:
DashboardRunStore
.SchemaVersion,
807
SchemaVersion:
DashboardRunStore
.SchemaVersion,
850
SchemaVersion:
DashboardRunStore
.SchemaVersion,
859
SchemaVersion:
DashboardRunStore
.SchemaVersion,
909
SchemaVersion:
DashboardRunStore
.SchemaVersion,
920
SchemaVersion:
DashboardRunStore
.SchemaVersion,
Shared\FluentUISetupHelpers.cs (1)
259
SchemaVersion:
DashboardRunStore
.SchemaVersion,
Aspire.Dashboard.Tests (110)
Integration\StartupTests.cs (1)
1073
DashboardRunStore
.GetApplicationDirectory(workspace.Path, applicationName),
Model\DashboardDataSourceTests.cs (108)
35
using
var
runStore = CreateRunStore(options);
37
var applicationDirectoryName =
DashboardRunStore
.GetApplicationDirectoryName("My Dashboard");
45
var applicationDirectoryName =
DashboardRunStore
.GetApplicationDirectoryName("My Dashboard");
51
Assert.Equal(expectedDirectory,
DashboardRunStore
.GetApplicationDirectory(dataRoot: null, "My Dashboard"));
65
var applicationDirectory =
DashboardRunStore
.GetApplicationDirectory(workspace.Path, "My Dashboard");
73
using
var
runStore = CreateRunStore(CreateOptions(workspace, "My Dashboard", persistenceMode));
86
using
var
runStore = CreateRunStore(CreateOptions(workspace), timeProvider);
98
using
var
firstRunStore = CreateRunStore(options, timeProvider);
110
using
var
runStore = CreateRunStore(options);
129
Assert.Equal(
DashboardRunStore
.SchemaVersion, metadata.RootElement.GetProperty("SchemaVersion").GetInt32());
130
Assert.Equal(
DashboardRunStore
.SchemaVersion, Assert.Single(runStore.GetRuns()).SchemaVersion);
141
using (
var
currentRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt)))
155
using
var
nextRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddMinutes(1)));
166
using
var
runStore = CreateRunStore(options);
191
using
var
runStore = new DashboardRunStore(
193
loggerFactory.CreateLogger<
DashboardRunStore
>(),
224
using (
var
runStore = CreateRunStore(options))
252
.AddSingleton<ILogger<
DashboardRunStore
>>(NullLogger<
DashboardRunStore
>.Instance)
256
.AddSingleton<
DashboardRunStore
>()
257
.AddSingleton<IDashboardRunStore>(serviceProvider => serviceProvider.GetRequiredService<
DashboardRunStore
>())
266
var
runStore = serviceProvider.GetRequiredService<
DashboardRunStore
>();
301
using
var
runStore = CreateRunStore(CreateOptions(workspace, persistenceMode: DashboardPersistenceMode.None));
319
using
var
activeRunStore = CreateRunStore(options);
323
using
var
secondRunStore = CreateRunStore(options);
338
using
var
runStore = CreateRunStore(CreateOptions(workspace, persistenceMode: DashboardPersistenceMode.None));
356
var logger = new TestLogger<
DashboardRunStore
>(new TestLoggerFactory(testSink, enabled: true));
358
using
var
runStore = new DashboardRunStore(
376
using (
var
firstRunStore = CreateRunStore(options))
384
var logger = new TestLogger<
DashboardRunStore
>(new TestLoggerFactory(testSink, enabled: true));
385
using
var
secondRunStore = new DashboardRunStore(options, logger, TimeProvider.System);
402
using
var
firstRunStore = CreateRunStore(options);
418
using (
var
firstRunStore = CreateRunStore(options))
429
var logger = new TestLogger<
DashboardRunStore
>(new TestLoggerFactory(testSink, enabled: true));
430
using
var
secondRunStore = new DashboardRunStore(options, logger, TimeProvider.System);
436
write => write.Message == $"Existing dashboard database at '{databasePath}' is incompatible with schema version {
DashboardRunStore
.SchemaVersion} and will be replaced.");
450
using (
var
firstRunStore = CreateRunStore(options))
493
var firstDirectoryName =
DashboardRunStore
.GetApplicationDirectoryName(firstName);
494
var secondDirectoryName =
DashboardRunStore
.GetApplicationDirectoryName(secondName);
496
Assert.Equal(
DashboardRunStore
.MaxApplicationDirectoryNameLength, firstDirectoryName.Length);
497
Assert.Equal(
DashboardRunStore
.MaxApplicationDirectoryNameLength, secondDirectoryName.Length);
501
Assert.Equal(firstDirectoryName,
DashboardRunStore
.GetApplicationDirectoryName(firstName));
511
using (
var
historicalRunStore = CreateRunStore(options))
518
using
var
currentRunStore = CreateRunStore(options);
541
using
var
runStore = CreateRunStore(CreateOptions(workspace));
553
using
var
runStore = CreateRunStore(CreateOptions(workspace));
569
using (
var
historicalRunStore = CreateRunStore(options))
576
using
var
activeRunStore = CreateRunStore(options);
579
using
var
currentRunStore = CreateRunStore(options);
605
foreach (var index in Enumerable.Range(1,
DashboardRunStore
.MaxRuns))
607
using
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(-index)));
612
using
var
currentRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt));
616
Assert.Equal(
DashboardRunStore
.MaxRuns, Directory.GetDirectories(runsDirectory).Length);
630
foreach (var index in Enumerable.Range(0,
DashboardRunStore
.MaxRuns - activeRunCount))
632
using
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddMilliseconds(index)));
636
var activeRunStores = new List<
DashboardRunStore
>();
637
foreach (var index in Enumerable.Range(
DashboardRunStore
.MaxRuns - activeRunCount, activeRunCount))
639
var
activeRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddMilliseconds(index)));
646
using
var
currentRunStore = CreateRunStore(
648
new FixedTimeProvider(startedAt.AddMilliseconds(
DashboardRunStore
.MaxRuns)));
653
foreach (
var
activeRunStore in activeRunStores)
662
Assert.Equal(
DashboardRunStore
.MaxRuns - activeRunCount, selectableRuns.Count);
679
using (
var
runStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(runIndex++))))
685
using
var
pinningRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(runIndex++)));
696
for (var index = 0; index <
DashboardRunStore
.MaxRuns - 1; index++)
698
using
var
runStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(runIndex++)));
702
using
var
finalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(runIndex)));
710
Assert.Equal(
DashboardRunStore
.MaxRuns - 1, runs.Count(run => !run.IsCurrent && !run.IsPinned));
722
foreach (var index in Enumerable.Range(1,
DashboardRunStore
.MaxRuns - 1))
724
using
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(-index)));
728
using
var
activeRunStore = CreateRunStore(
730
new FixedTimeProvider(startedAt.AddDays(-
DashboardRunStore
.MaxRuns)));
733
using
var
currentRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt));
738
Assert.Equal(
DashboardRunStore
.MaxRuns + 1, Directory.GetDirectories(runsDirectory).Length);
750
using (
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt)))
758
using
var
currentRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddMilliseconds(1)));
764
foreach (var index in Enumerable.Range(1,
DashboardRunStore
.MaxRuns - 2))
766
using
var
additionalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(index)));
771
using
var
pruningRunStore = new DashboardRunStore(
773
NullLogger<
DashboardRunStore
>.Instance,
782
using
var
nextPruningRunStore = new DashboardRunStore(
784
NullLogger<
DashboardRunStore
>.Instance,
799
using (
var
historicalRunStore = CreateRunStore(options))
806
using
var
currentRunStore = CreateRunStore(options);
849
using (
var
historicalRunStore = CreateRunStore(options))
856
using
var
currentRunStore = CreateRunStore(options);
879
foreach (var index in Enumerable.Range(1,
DashboardRunStore
.MaxRuns))
881
using
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(-index)));
888
var logger = loggerFactory.CreateLogger<
DashboardRunStore
>();
891
using
var
currentRunStore = new DashboardRunStore(
900
Assert.Equal(typeof(
DashboardRunStore
).FullName, warning.LoggerName);
915
using (
var
malformedRunStore = CreateRunStore(options))
927
using
var
currentRunStore = CreateRunStore(options);
959
using
var
currentRunStore = CreateRunStore(options);
962
var historicalDatabasePath = Path.Combine(historicalDirectory,
DashboardRunStore
.DatabaseFileName);
968
var malformedDatabasePath = Path.Combine(malformedDirectory,
DashboardRunStore
.DatabaseFileName);
994
DatabasePath = Path.Combine(workspace.Path, "unavailable",
DashboardRunStore
.DatabaseFileName),
1061
using (
var
historicalRunStore = CreateRunStore(options))
1091
using
var
currentRunStore = CreateRunStore(options);
1169
using
var
currentRunStore = CreateRunStore(options);
1192
using (
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(historicalRunTime)))
1197
using
var
currentRunStore = CreateRunStore(options, new FixedTimeProvider(historicalRunTime.AddMilliseconds(1)));
1246
private static async Task InitializeAndPublishRunAsync(
DashboardRunStore
runStore)
1255
private static async Task InitializeAndPublishRunWithoutPruningAsync(
DashboardRunStore
runStore)
1272
private static
DashboardRunStore
CreateRunStore(IOptions<DashboardOptions> options, TimeProvider? timeProvider = null)
1274
return new DashboardRunStore(options, NullLogger<
DashboardRunStore
>.Instance, timeProvider ?? TimeProvider.System);
1295
DashboardRunStore
.GetRunLockPath(runDirectory),
Shared\TestDashboardDataSource.cs (1)
47
[new("current",
DashboardRunStore
.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", databasePath ?? string.Empty, IsCurrent: true)])