Skip to content

Commit 8a5202e

Browse files
committed
minor: fix microbenchmark compilations
1 parent 409442b commit 8a5202e

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

benchmark/microbench.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <algorithm>
2020
#include <set>
21+
#include <string>
2122
#include <unordered_map>
2223
#include <vector>
2324

benchmark/multi_doc/gridfs_upload.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <vector>
2020

21+
#include <bsoncxx/string/to_string.hpp>
2122
#include <mongocxx/client.hpp>
2223
#include <mongocxx/gridfs/bucket.hpp>
2324
#include <mongocxx/instance.hpp>
@@ -68,8 +69,8 @@ void gridfs_upload::setup() {
6869
void gridfs_upload::before_task() {
6970
auto db = _conn["perftest"];
7071
_bucket = db.gridfs_bucket();
71-
db[_bucket.bucket_name().to_string() + ".chunks"].drop();
72-
db[_bucket.bucket_name().to_string() + ".files"].drop();
72+
db[bsoncxx::string::to_string(_bucket.bucket_name()) + ".chunks"].drop();
73+
db[bsoncxx::string::to_string(_bucket.bucket_name()) + ".files"].drop();
7374
auto uploader = _bucket.open_upload_stream("one_byte_gridfs_file");
7475
std::uint8_t byte[1] = {72};
7576
uploader.write(byte, 1);
@@ -85,4 +86,4 @@ void gridfs_upload::task() {
8586
uploader.write(_gridfs_file.data(), _gridfs_file.size());
8687
uploader.close();
8788
}
88-
} // namespace benchmark
89+
} // namespace benchmark

benchmark/parallel/gridfs_multi_import.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <thread>
2222
#include <vector>
2323

24+
#include <bsoncxx/string/to_string.hpp>
2425
#include <mongocxx/gridfs/bucket.hpp>
2526
#include <mongocxx/instance.hpp>
2627
#include <mongocxx/pool.hpp>
@@ -75,8 +76,8 @@ void gridfs_multi_import::before_task() {
7576
auto conn = _pool.acquire();
7677
auto db = (*conn)["perftest"];
7778
auto bucket = db.gridfs_bucket();
78-
db[bucket.bucket_name().to_string() + ".chunks"].drop();
79-
db[bucket.bucket_name().to_string() + ".files"].drop();
79+
db[bsoncxx::string::to_string(bucket.bucket_name()) + ".chunks"].drop();
80+
db[bsoncxx::string::to_string(bucket.bucket_name()) + ".files"].drop();
8081
auto uploader = bucket.open_upload_stream("one_byte_gridfs_file");
8182
std::uint8_t byte[1] = {72};
8283
uploader.write(byte, 1);
@@ -118,4 +119,4 @@ void gridfs_multi_import::concurrency_task(std::uint32_t start_file, std::uint32
118119
auto uploader = bucket.upload_from_stream(file_name, &stream);
119120
}
120121
}
121-
} // namespace benchmark
122+
} // namespace benchmark

0 commit comments

Comments
 (0)