Skip to content

Commit

Permalink
redis压测直接-server参数和-pass参数,方便在云服务器测试
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Nov 25, 2024
1 parent e49d77b commit 35e7d95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion Test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using NewLife;
using NewLife.Caching;
using NewLife.Caching.Clusters;
using NewLife.Configuration;
using NewLife.Log;
using NewLife.Security;
using NewLife.Serialization;
Expand Down Expand Up @@ -97,7 +98,16 @@ static void Test1()
/// <summary>性能压测</summary>
static void Test2()
{
var ic = new FullRedis("127.0.0.1", null, 3);
var args = Environment.GetCommandLineArgs();
var cp = new CommandParser();
var dic = cp.Parse(args);

if (!dic.TryGetValue("server", out var server)) server = "127.0.0.1";
if (!dic.TryGetValue("pass", out var pass)) pass = "";

if (server.IsNullOrEmpty()) server = "127.0.0.1";

var ic = new FullRedis(server, pass, 3);

// 性能压测
//ic.AutoPipeline = -1;
Expand Down
2 changes: 1 addition & 1 deletion Test/Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net45;net461;net8.0</TargetFrameworks>
<TargetFrameworks>net45;net461;net8.0;net9.0</TargetFrameworks>
<Company>新生命开发团队</Company>
<Copyright>©2002-2024 新生命开发团队</Copyright>
<VersionPrefix>1.0</VersionPrefix>
Expand Down

0 comments on commit 35e7d95

Please sign in to comment.