-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Separate out ACL stress to its own BDN subclass * Allow debugging in process
- Loading branch information
Showing
3 changed files
with
91 additions
and
44 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
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,38 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
using BenchmarkDotNet.Attributes; | ||
using Garnet.server.Auth.Settings; | ||
|
||
namespace BDN.benchmark.Resp | ||
{ | ||
[MemoryDiagnoser] | ||
public unsafe class RespParseACLStress : RespParseStress | ||
{ | ||
[Params(false, true)] | ||
public bool UseACLs { get; set; } | ||
|
||
public new void GlobalSetup() | ||
{ | ||
string aclFile = null; | ||
|
||
try | ||
{ | ||
if (UseACLs) | ||
{ | ||
aclFile = Path.GetTempFileName(); | ||
File.WriteAllText(aclFile, @"user default on nopass -@all +ping +set +get"); | ||
authSettings = new AclAuthenticationPasswordSettings(aclFile); | ||
} | ||
base.GlobalSetup(); | ||
} | ||
finally | ||
{ | ||
if (aclFile != null) | ||
{ | ||
File.Delete(aclFile); | ||
} | ||
} | ||
} | ||
} | ||
} |
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