Skip to content

Commit

Permalink
fix cache range
Browse files Browse the repository at this point in the history
  • Loading branch information
hggq committed Jan 5, 2024
1 parent 9e83da7 commit 400f8d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion controller/src/techempower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ std::string techempowercached_queries(std::shared_ptr<httppeer> peer)
{
for (unsigned int i = 0; i < get_num; i++)
{
unsigned int temp_rid = rand_range(1, 10000);
unsigned int temp_rid = rand_range(0, 9999);
myworld.record.push_back(allcachedata_array[temp_rid]);
}
}
Expand Down
15 changes: 10 additions & 5 deletions controller/src/testrand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ std::string testrand(std::shared_ptr<httppeer> peer)
httppeer &client = peer->getpeer();
client << " Number random number and character random generation 随机数测试 ";
client << "<p>100,999: " << rand_range(100, 999) << "</p>";
client << "<p>1-0 A-Z a-z: " << rand_string(8, 0) << "</p>"; //(length,type ) 1-0 A-Z a-z
client << "<p>1-0 A-Z: " << rand_string(8, 1) << "</p>"; //(length,type ) 1-0 A-Z
client << "<p>A-Z: " << rand_string(8, 2) << "</p>"; //(length,type ) A-Z
client << "<p>a-z: " << rand_string(8, 3) << "</p>"; //(length,type ) a-z
client << "<p>1-0 A-Z a-z: " << rand_string(8, 0) << "</p>";//(length,type ) 1-0 A-Z a-z
client << "<p>1-0 A-Z: " << rand_string(8, 1) << "</p>"; //(length,type ) 1-0 A-Z
client << "<p>A-Z: " << rand_string(8, 2) << "</p>"; //(length,type ) A-Z
client << "<p>a-z: " << rand_string(8, 3) << "</p>"; //(length,type ) a-z

for (unsigned int i = 0; i < 20; i++)
{
client << "<p>0,9: " << rand_range(0, 9) << "</p>";
}
return "";
}

} //namespace http
}//namespace http

0 comments on commit 400f8d6

Please sign in to comment.