How to Measure Terminal Load?

 

Just trying if someone has some idea on the topic. It is actually not directly MQL related, but rather a design question.

My problem is, that I have indicator which performs heavy computing work, but only occasionally. The calculations may block the MT4 GUI thread for a few seconds. It happens when the indicator starts, and after disconnection, and a few seconds is not really a problem.

But I want to avoid longer freezing periods when multiple of such indicators combine in the terminal.

My intention is measuring the load of the GUI/indicator thread over constant recent period, to avoid calculations when heavy load appears.

Does any one has an idea of how to detect/measure the indicator thread load?

 

Dear Ovo,

just one very old and basic source is TSK MANAGER,of course there would be more new methods,

regards

Files:
old_idea.png  140 kb
 

When you have to load .dll or function calls to other .ex4 it needs time. To optimize the code is one way (you see e.g. compiling time in Editor). To decrease the calculated bars another. Is MT4 multicore CPU compatible now? I don't really know. And I don't really understand what you do with the measured data. How do you want to avoid calculations in heavy duty? Disable the indi/s? I know my indis which needs its warming time.

 
krelian99:
When you have to load .dll or function calls to other .ex4 it needs time. To optimize the code is one way (you see e.g. compiling time in Editor). To decrease the calculated bars another. Is MT4 multicore CPU compatible now? I don't really know. And I don't really understand what you do with the measured data. How do you want to avoid calculations in heavy duty? Disable the indi/s? I know my indis which needs its warming time.

I am not looking for performance optimization. I have no problem with DLL calls or loads, I have an indicator which needs to recalculate all values from scratch. It is not critical when it happens, but it becomes very annoying if multiple indicators start this update at the same tick, causing the terminal non-responsive for long time.

So my idea was detecting for how long the terminal has already been in this non-responding state, to enable its recovering first and postpone the other indicator recalculation for a short while.