Further fixes for online dqm monitoring.

This improves the performance, a lot.
Even more fixes for the monitoring.
Merge pull request #5751 from dmitrijus/newmonitoringf

Further fixes for online dqm monitoring.