This can be useful for debugging and for testing (since you will not
need to obtain query_id and look at query_log).
v2:
- mark test as long
- add option to docs
- add type of profile event into logs too
v3:
- resolve conflicts
- and fix onProfileEvents callback
v4:
- add --print-profile-events separate switch