Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
willhoy authored Jan 12, 2024
2 parents a90b46b + 68bcaa8 commit 98a7e38
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Checks

on:
push:
Expand All @@ -25,6 +25,8 @@ jobs:

Documentation:
name: Doxygenize
#Only run for push to main
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
26 changes: 19 additions & 7 deletions examples/rmqperftest/rmqperftest_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
namespace BloombergLP {
namespace rmqperftest {
namespace {

typedef bsl::pair<bsl::shared_ptr<rmqa::Producer>, bsl::string>
ProducerRoutingKeyPair;

class ConsumerCallback {
public:
ConsumerCallback(const ConsumerArgs& args,
Expand Down Expand Up @@ -96,6 +100,18 @@ bsl::string_view queueNameOrRoutingKey(bsl::string_view routingKey,
}
}

void finalizeProducers(bsl::vector<ProducerRoutingKeyPair>& producers)
{
bsl::cout << producers.size() << " producers finished, exiting producers"
<< bsl::endl;
for (bsl::vector<ProducerRoutingKeyPair>::iterator it = producers.begin();
it != producers.end();
++it) {
it->first->waitForConfirms();
}
producers.clear();
}

} // namespace

int Runner::run(const PerfTestArgs& args)
Expand Down Expand Up @@ -179,8 +195,6 @@ int Runner::run(const PerfTestArgs& args)
}

// Create producer
typedef bsl::pair<bsl::shared_ptr<rmqa::Producer>, bsl::string>
ProducerRoutingKeyPair;
bsl::vector<ProducerRoutingKeyPair> producers;
{
bsl::vector<rmqt::QueueHandle>::const_iterator queues;
Expand Down Expand Up @@ -311,12 +325,10 @@ int Runner::run(const PerfTestArgs& args)

producerMessagesSent += 1;

if ((int)producerMessagesSent ==
if ((int)producerMessagesSent >=
args.producer.producerMessageCount) {
bsl::cout << producers.size()
<< " producers finished, exiting producers"
<< bsl::endl;
producers.clear();

finalizeProducers(producers);
}
}
}
Expand Down

0 comments on commit 98a7e38

Please sign in to comment.