-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved PR comments.
- Loading branch information
Showing
3 changed files
with
77 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Columns; | ||
using BenchmarkDotNet.Configs; | ||
using Embedded.perftest; | ||
using Garnet.server; | ||
|
||
namespace BDN.benchmark | ||
{ | ||
public class CustomConfig : ManualConfig | ||
{ | ||
public CustomConfig() | ||
{ | ||
AddColumn(StatisticColumn.Mean); | ||
AddColumn(StatisticColumn.StdDev); | ||
AddColumn(StatisticColumn.Median); | ||
AddColumn(StatisticColumn.P90); | ||
AddColumn(StatisticColumn.P95); | ||
} | ||
} | ||
|
||
[Config(typeof(CustomConfig))] | ||
public class RecoveryBenchmark | ||
{ | ||
[ParamsSource(nameof(CommandLineArgsProvider))] | ||
public string LogDir { get; set; } | ||
|
||
public IEnumerable<string> CommandLineArgsProvider() | ||
{ | ||
// Return the command line arguments as an enumerable | ||
return Environment.GetCommandLineArgs().Skip(1); | ||
} | ||
|
||
[Params("100m")] | ||
public string MemorySize { get; set; } | ||
|
||
EmbeddedRespServer server; | ||
|
||
[IterationSetup] | ||
public void Setup() | ||
{ | ||
Console.WriteLine($"LogDir: {LogDir}"); | ||
server = new EmbeddedRespServer(new GarnetServerOptions() | ||
{ | ||
EnableStorageTier = true, | ||
LogDir = LogDir, | ||
CheckpointDir = LogDir, | ||
IndexSize = "1m", | ||
DisableObjects = true, | ||
MemorySize = MemorySize, | ||
PageSize = "32k", | ||
}); | ||
} | ||
|
||
[IterationCleanup] | ||
public void Cleanup() | ||
{ | ||
server.Dispose(); | ||
} | ||
|
||
[Benchmark] | ||
public void Recover() | ||
{ | ||
server.StoreWrapper.RecoverCheckpoint(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters