Skip to content

Commit

Permalink
Making things a bit more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
0gap committed Dec 12, 2021
1 parent abbecb8 commit eafaaa8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
msg_logging
# msg_logging

Testing flatbuffers with zmq and grpc.

The idea is to see which setup is better:
- Logging directly into file
- Sending to a zmq service(co-located or remote)
- Sending to a grpc service(co-located or remote)

**Compiler:** `ubuntu 20.04, g++ 9.3`
**Conan:** `1.42.1`
**CMake:** `3.16.3`
4 changes: 2 additions & 2 deletions bench/benchmarks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ BENCHMARK(log_in_file)->Iterations(150000);
zmq::context_t ctx(1);
zmq::socket_t sock1(ctx, zmq::socket_type::push);
uint64_t msg_count{ 0 };
static void runzmq(benchmark::State &state)
static void bench_pull_sub_proxy(benchmark::State &state)
{
for (auto _ : state)
{
Expand All @@ -71,7 +71,7 @@ static void runzmq(benchmark::State &state)
}
}

BENCHMARK(runzmq)->Iterations(150000);
BENCHMARK(bench_pull_sub_proxy)->Iterations(150000);

// You need to have grpc_server running
static void rungrpc2(benchmark::State &state)
Expand Down
2 changes: 1 addition & 1 deletion bench/load_balance_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void runzmq(benchmark::State &state)
}
}

BENCHMARK(runzmq)->Iterations(150000);
BENCHMARK(bench_pull_sub_proxy)->Iterations(150000);

// You need to have nginx load balance compose
// Messages will be load balanced between all grpc servers
Expand Down
6 changes: 0 additions & 6 deletions pull_sub_zmq_proxy/pull_sub_zmq_proxy_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@

int main(int argc, char** argv)
{
// FLAGS_log_dir = "/var/log/pull_sub_proxy";
// FLAGS_logbufsecs = 0;
// gflags::ParseCommandLineFlags(&argc, &argv, true);
// google::InstallFailureSignalHandler();
// google::InitGoogleLogging("pull_sub_proxy");

zmq::context_t ctx(1);
PullSubProxy proxy(std::move(Binding("tcp://127.0.0.1:19999")),
Binding("tcp://127.0.0.1:38888"),
Expand Down

0 comments on commit eafaaa8

Please sign in to comment.