MCPcopy Create free account
hub / github.com/3rdparty/libprocess / run

Method run

src/tests/benchmarks.cpp:623–649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

621 }
622
623 void run(int submessages)
624 {
625 tests::Message message = createMessage(submessages);
626
627 std::string data;
628 bool success = message.SerializeToString(&data);
629 CHECK(success);
630
631 Stopwatch watch;
632 watch.start();
633
634 size_t count;
635
636 for (count = 0; watch.elapsed() < Seconds(1); count++) {
637 MessageEvent event(self(), self(), message.GetTypeName(),
638 data.c_str(), data.length());
639 consume(std::move(event));
640 }
641
642 watch.stop();
643
644 double messagesPerSecond = count / watch.elapsed().secs();
645
646 cout << "Size: " << std::setw(5) << message.ByteSizeLong() << " bytes,"
647 << " throughput: " << std::setw(9) << std::setprecision(0)
648 << std::fixed << messagesPerSecond << " messages/s" << endl;
649 }
650
651private:
652 // Returns a tree with the `submessages` number of sub-messages,

Callers

nothing calls this directly

Calls 3

secsMethod · 0.80
startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected