Add some usefull metrics on processing times.
Reopen sqlite file with statistics on SIGHUP if non-memory file is used.
Integrate the thread stats and query api to agent and standard feat gateway.
Prioritize image/png content type higher than application/json for internal
feat gateway if we are running with thread stats.