diff options
| author | mo khan <mokhan@users.noreply.github.com> | 2019-04-20 09:32:24 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-20 09:32:24 -0600 |
| commit | bc2274ce4183bee7523665bf8a905a584f20081a (patch) | |
| tree | b336f1e4c305a3d22a2177b5b8e14f2b68989348 /lib/killjoy/experiments.rb | |
| parent | a7cd8453ab61f3a7b6ab59cda9d051dc725cdead (diff) | |
| parent | 85bd0e5d520109f29011f6eff69e9d2f2e20af26 (diff) | |
Merge pull request #2 from mokhan/kafkamain
Kafka
Diffstat (limited to 'lib/killjoy/experiments.rb')
| -rw-r--r-- | lib/killjoy/experiments.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/killjoy/experiments.rb b/lib/killjoy/experiments.rb index 2977eb3..8bc4578 100644 --- a/lib/killjoy/experiments.rb +++ b/lib/killjoy/experiments.rb @@ -42,6 +42,22 @@ module Killjoy end end + def kafka_cassandra_non_blocking_writes + profile('tmp/kafka-cassandra-cpu-non-blocking-writes.dump') do + run(Kafka::MessageBus.new, 1) do |shard| + Cassandra::NonBlockingWritesConsumer.new(writers, shard) + end + end + end + + def kafka_mongo_writes + profile('tmp/kafka-mongo-cpu-non-blocking-writes.dump') do + run(Kafka::MessageBus.new, 1) do |shard| + Mongo::Consumer.new(@mongo_client, shard) + end + end + end + private def profile(filename) @@ -54,9 +70,10 @@ module Killjoy end end - def run + def run( + message_bus = MessageBus.new, queue_shards = ENV.fetch("RMQ_SHARDS", 4).to_i - message_bus = MessageBus.new + ) publish_messages(message_bus) queue = Queue.new |
