Preprocessed traces: https://pastila.nl/?0006a09d/f3f1725be8a2ec8787b2d5c8b1eb6532
Report: https://s3.amazonaws.com/clickhouse-test-reports/40506/f2be18b3a644debbb882b8a9e8396b0375461b36/stress_test__undefined_.html
res.written_bytes     = progress_out.written_bytes;
    if (thread_group)
    {
        res.memory_usage = thread_group->memory_tracker.get();
        res.peak_memory_usage = thread_group->memory_tracker.getPeak();
        if (get_thread_list)
        {
            std::lock_guard lock(thread_group->mutex);
            res.thread_ids = thread_group->thread_ids;
        }
        if (get_profile_events)
            res.profile_counters = std::make_shared<ProfileEvents::Counters::Snapshot>(thread_group->performance_counters.getPartiallyAtomicSnapshot());
    }
    if (get_settings && getContext())
    {
        res.query_settings = std::make_shared<Settings>(getContext()->getSettings());
        res.current_database = getContext()->getCurrentDatabase();
    }
    return res;
}
ProcessList::Info ProcessList::getInfo(bool get_thread_list, bool get_profile_events, bool get_settings) const
{
    Info per_query_infos;
    std::lock_guard lock(mutex);
    per_query_infos.reserve(processes.size());
    for (const auto & process : processes)
        per_query_infos.emplace_back(process.getInfo(get_thread_list, get_profile_events, get_settings));
    return per_query_infos;
}
ProcessListForUser::ProcessListForUser(ProcessList * global_process_list)