Skip to content

Commit

Permalink
兼容性能测试调整,先删除再累加,否则redis不接受在字符串key上执行incr累加
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Oct 6, 2024
1 parent 30d6117 commit 4b3d76f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions NewLife.Redis/Redis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,19 @@ protected override Int32 GetTimesPerThread(Boolean rand, Int32 batch)
/// <param name="rand">随机读写</param>
/// <param name="batch">批量操作</param>
protected override Int64 BenchInc(String[] keys, Int64 times, Int32 threads, Boolean rand, Int32 batch)
{
//if (rand && batch > 10) times /= 10;
return base.BenchRemove(keys, times, threads, rand, batch);
}

/// <summary>删除测试</summary>
/// <param name="keys"></param>
/// <param name="times"></param>
/// <param name="threads"></param>
/// <param name="rand"></param>
/// <param name="batch"></param>
/// <returns></returns>
protected override Int64 BenchRemove(String[] keys, Int64 times, Int32 threads, Boolean rand, Int32 batch)
{
if (rand && batch > 10) times /= 10;
return base.BenchInc(keys, times, threads, rand, batch);
Expand Down

0 comments on commit 4b3d76f

Please sign in to comment.