Additional spreader tracing

This commit is contained in:
Eric Harding committed 2019-03-10 16:19:15 -04:00
1 parent dce856e4af
commit 19ce3a7dd4
13 files changed
+86 -43

No files matched your search

@@ -44,24 +44,25 @@ struct ActorThread {
stats.publish(loop_metric);
}
void start() {
void start(trace::PerfLog& log) {
if (cfg.poll())
thread = threading::make_thread(cfg.thread_name(), [this]() {
thread = threading::make_thread(cfg.thread_name(), [this,&log]() {
for (;;)
executor.do_work();
executor.do_work(log);
});
else
thread = threading::make_thread(cfg.thread_name(), [this]() {
else {
thread = threading::make_thread(cfg.thread_name(), [this,&log]() {
const auto inner_iter = 1000;
while (!done) {
auto start = Timer::now();
for (auto i = 0; i < inner_iter; i++)
executor.do_work();
executor.do_work(log);
auto stop = Timer::now();
loop_metric->observe(ns_diff(stop, start) / inner_iter);
std::this_thread::sleep_for(10ms);
}
});
}
}
~ActorThread() {
@@ -212,7 +213,7 @@ OrderServiceServer::OrderServiceServer(
// spin up threads
for (auto &t : me->actor_threads)
t->start();
t->start(log);
// wait for the service bridge to be ready
me->service_bridge->block_until_ready();