Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct estimation of the operation execution time #514

Open
debugger1979 opened this issue Jan 18, 2024 · 2 comments
Open

Correct estimation of the operation execution time #514

debugger1979 opened this issue Jan 18, 2024 · 2 comments

Comments

@debugger1979
Copy link

debugger1979 commented Jan 18, 2024

Hello!
Please help me with the following question. You have described the r.timer() function. According to the description, it measures the execution time of the previous operation. My task is to measure the execution time of the document saving operation. I'm doing the following steps:
r.click("Save.png")
save_time = r.timer()
What does save_time contain? Variants:

  1. The search time for the "Save button" + clicking on the button area
  2. Item 1 + the time of the save operation

How can I evaluate the effective execution time of operations?

I checked the options with turbo = true and without.

The script:

`r.init(visual_automation=True, chrome_browser=False, turbo_mode=True)

start = r.timer()
r.click('folder.png')

fin_folder = r.timer()
r.click('downloads.png')
fin_downlds = r.timer()
r.dclick('excel-file.png')
fin_dclk = r.timer()
r.click('r7_trial_ok.png')
fin_trial = r.timer()
r.rclick('r7-row2.png')
fin_rclick = r.timer()
r.click('r7-insert-string.png')
fin_click = r.timer()
r.keyboard('kljsdhcvfkesdbvfkdjhb[tab]wleqjfcbewkljbhfkewb[tab]qwefdjewabrkgvberkbver[tab]sdfklvjnbsedkfvb[tab]edrfg;vkertmlgnrlnb[tab]wfv,jerbkvfberkbe[tab]weflkjerwkfbekb')
fin_write_text = r.timer()
r.click('r7-save.png')
fin_save = r.timer()

print('start = ' + str(start))
print('folder = ' + str(fin_folder))
print('downloads = ' + str(fin_downlds))
print('dclick = ' + str(fin_dclk))
print('trial = ' + str(fin_trial))
print('rclick = ' + str(fin_rclick))
print('click = ' + str(fin_click))
print('write text = ' + str(fin_write_text))
print('save file = ' + str(fin_save))
print('all = ' + str(start + fin_folder + fin_downlds + fin_dclk + fin_trial + fin_rclick + fin_click + fin_write_text + fin_save))`

turbo = False

start = 0.07
folder = 7.011
downloads = 2.006
dclick = 2.006
trial = 4.117
rclick = 2.013
click = 2.004
writetext = 11.004
save file = 2.006
all = 32.237

turbo = True

start = 0.072
folder = 5.089
downloads = 0.558
dclick = 0.806
trial = 1.88
rclick = 4.192
click = 0.51
write text = 11.306
save file = 0.406
all = 24.819

Do I understand correctly that in turbo mode, manipulations are performed immediately with the found area (button), without the side costs of "moving the mouse"?
In general, is it possible to track the execution time of the operation by the application?

@debugger1979
Copy link
Author

Example of a script:

r.click('Start_menu.png')
r.click('Open_file.png')

How can I determine that the first line of the script has already been executed? Do I understand correctly that a screenshot of the screen is compared before the operation and after the operation? If the screenshots do not match, then there is some result after the click and you can set the result of the function to True? Do I understand the logic correctly?

@debugger1979
Copy link
Author

Hello!
Conducted the following research on measuring the execution time of a test script:
Source data:
A qemu/kvm-based virtual machine.
AlmaLinux OS 9, office suite R7-Office

The script uses the following algorithm (turbo_mode = True):

  1. Open the home folder [r.click()]
  2. Select the Download folder [r.click()]
  3. Open the Excel file [r.dclick()]
  4. Confirm the message about the trial version office suite [r.click()]
  5. Open the drop-down menu in the row numbers field of the table [r.click()]
  6. Select "Add line" [r.click()]
  7. In the added line, fill in all the fields [r.keyboard() + modifier [tab]]
  8. Click the "Save document" icon [r.click()]
  9. Exit from the Office programm [r.click()]

Time measurements were performed in 3 ways:

  1. r.timer() after each command was executed, then the sum of the time values of all points was completed
  2. datetime.datetime.now(), the start time before point 1 and the finish time after point 9, then the difference between them is calculated
  3. Manual measurement + manual execution of all stages - stopwatch on a smartphone

The values obtained:

  1. sum_rtimer = 44.39
  2. delta_datetime = 32.64
  3. Stopwatch = 34.90 (human factor)

The analysis of the timer() function showed that no measurements are made inside rpa-python, but simply the contents of the file are read rpa_python.txt , which creates an external tagui component, which presumably contains the execution time of the next request (operation). Logically, it is fair to take time costs directly from the query executor. But it is unclear why the results are so big? Or does it imply other information?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant