diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/src/hiperf.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/utils/src/hiperf.cc b/utils/src/hiperf.cc index 3f9cffd0c..b62173be8 100644 --- a/utils/src/hiperf.cc +++ b/utils/src/hiperf.cc @@ -610,15 +610,23 @@ class HIperfServer { void produceContent(uint32_t suffix) { core::Name name = configuration_.name.getName(); - std::string content(configuration_.download_size, '?'); + auto b = utils::MemBuf::create(configuration_.download_size); + std::memset(b->writableData(), '?', configuration_.download_size); + b->append(configuration_.download_size); uint32_t total; + utils::TimePoint t0 = utils::SteadyClock::now(); + total = producer_socket_->produce( - name, reinterpret_cast<const uint8_t *>(content.data()), content.size(), - !configuration_.multiphase_produce_, suffix); + name, std::move(b), !configuration_.multiphase_produce_, suffix); - std::cout << "Written " << total << "pieces of data in output buffer" - << std::endl; + utils::TimePoint t1 = utils::SteadyClock::now(); + + std::cout + << "Written " << total + << " data packets in output buffer (Segmentation time: " + << std::chrono::duration_cast<utils::Microseconds>(t1 - t0).count() + << " us)" << std::endl; } std::shared_ptr<utils::Identity> setProducerIdentity( |