There are two ways to create threads in ATS:
1) By EventProcessor::spawn_event_threads(), such as ET_NET threads.
2) By EventProcessor::spawn_thread(), such as flush thread.
But I found that we can't stats the same things across these two type of threads.
For example, I used the following statement in _checkout_write() to do stats before add to flusher queue:
As _checkout_write() function will be executed at ET_NET threads and flush thread, the stats value will be incomplete – the value collected in flush thread will not be merged into the final result.