| 765 | } |
| 766 | |
| 767 | void ReadRandom(ThreadState* thread) { |
| 768 | ReadOptions options; |
| 769 | std::string value; |
| 770 | int found = 0; |
| 771 | for (int i = 0; i < reads_; i++) { |
| 772 | char key[100]; |
| 773 | const int k = thread->rand.Next() % FLAGS_num; |
| 774 | snprintf(key, sizeof(key), "%016d", k); |
| 775 | if (db_->Get(options, key, &value).ok()) { |
| 776 | found++; |
| 777 | } |
| 778 | thread->stats.FinishedSingleOp(); |
| 779 | } |
| 780 | char msg[100]; |
| 781 | snprintf(msg, sizeof(msg), "(%d of %d found)", found, num_); |
| 782 | thread->stats.AddMessage(msg); |
| 783 | } |
| 784 | |
| 785 | void ReadMissing(ThreadState* thread) { |
| 786 | ReadOptions options; |
nothing calls this directly
no test coverage detected