Loging performance

Ask general questions here.
kOoO
Posts: 18
Joined: Wed Oct 17, 2018 11:15 am
Location: Zlin, CR

Loging performance

Post by kOoO » Thu Aug 29, 2019 2:11 pm

When "Tracing screenshots" setting is set to on (foreground), screenshot is silently taken for every little debug message that is logged. Why? The screenshot is not even displayed in report. It affects performance - every log message takes about 30 - 50 ms. When screenshots are off, every log message takes about 0.5 ms

Is there any way how to turn off screenshot capturing for logging actions?

For example:

Code: Select all

for(int x=0;x<150;x++){
        		Ranorex.Core.Reporting.TestReport.EnableTracingScreenshots = false;
        		Report.Debug("Debug" + x.ToString());
        		Ranorex.Core.Reporting.TestReport.EnableTracingScreenshots = true;
        	}
takes ~600ms

Code: Select all

Ranorex.Core.Reporting.TestReport.EnableTracingScreenshots = true;
for(int x=0;x<150;x++){
        		Report.Debug("Debug" + x.ToString());
        	}
takes ~10s

User avatar
Stub
Posts: 266
Joined: Fri Jul 15, 2016 1:35 pm

Re: Loging performance

Post by Stub » Fri Aug 30, 2019 7:58 am

The screenshots are displayed in the log when an error occurs. It displays the last few images so you can see the state of the system as the error occured, which is exceedingly useful.

I think you can adjust the number of screenshots, but I don't recall how. I may have read that somewhere on this forum though.

There is a "Capture a screenshot for each step" option in the Settings dialog, under "Recorder defaults." Perhaps that does something?

kOoO
Posts: 18
Joined: Wed Oct 17, 2018 11:15 am
Location: Zlin, CR

Re: Loging performance

Post by kOoO » Fri Aug 30, 2019 8:42 am

Stub wrote:
Fri Aug 30, 2019 7:58 am
The screenshots are displayed in the log when an error occurs. It displays the last few images so you can see the state of the system as the error occured, which is exceedingly useful.
I understand that for action steps, like clicking, keypressing ... but for loging it's rather exceedingly time consuming than useful .. nothing in the state of the system changes when I log a message, so why to take a screenshot?
Stub wrote:
Fri Aug 30, 2019 7:58 am
I think you can adjust the number of screenshots, but I don't recall how. I may have read that somewhere on this forum though.
There is a "Ranorex.Core.Reporting.TestReport.TracingScreenshotCountLocal", it may be what you are refering to. But it doesn't solve anything. If I set it to 0, no screenshots are taken at all (even in case of error), if I set it to 1+, it will still take one screenshot for every log message.
Stub wrote:
Fri Aug 30, 2019 7:58 am
There is a "Capture a screenshot for each step" option in the Settings dialog, under "Recorder defaults." Perhaps that does something?
It maybe does something, but it has nothing to do with this.

ahoisl
Certified Professional
Certified Professional
Posts: 181
Joined: Fri Sep 07, 2007 8:16 am

Re: Loging performance

Post by ahoisl » Mon Sep 02, 2019 10:11 am

kOoO wrote:
Thu Aug 29, 2019 2:11 pm
When "Tracing screenshots" setting is set to on (foreground), screenshot is silently taken for every little debug message that is logged. Why? The screenshot is not even displayed in report. It affects performance - every log message takes about 30 - 50 ms. When screenshots are off, every log message takes about 0.5 ms
Screenshots are only shown if there are failures (and you can set how many are shown using the "Ranorex.Core.Reporting.TestReport.TracingScreenshotCountLocal" setting), but we need to take the screenshots anyway, because we don't know in advance if something will fail.
kOoO wrote:
Fri Aug 30, 2019 8:42 am
I understand that for action steps, like clicking, keypressing ... but for loging it's rather exceedingly time consuming than useful .. nothing in the state of the system changes when I log a message, so why to take a screenshot?
The tracing screenshots are bound to logging, not to actions, i.e. if you turn off logging, you will also not have tracing screenshots.
If you do a lot of logging and want better performance, try changing the "Tracing mode" to "Background", which might result into less accurate screenshots (because done in parallel without blocking execution), but should definitely improve speed.

Regards,
Alex
Ranorex Team

kOoO
Posts: 18
Joined: Wed Oct 17, 2018 11:15 am
Location: Zlin, CR

Re: Loging performance

Post by kOoO » Mon Sep 02, 2019 12:20 pm

I have lot of debug logs in some areas, but I do like taking synchronous screenshots in case of error so Off or Background are not ideal.

I was hoping for some "DontDoScreenshotWhenLogingAMessageWithLevelDebug" setting (btw it would be nice to be able to define screenshot settings for every log level separately), but if there is none, some wrapper method around Report.Debug will have to do it ..