Skip to content

Instantly share code, notes, and snippets.

@johnwason
Created October 25, 2022 19:27
Show Gist options
  • Select an option

  • Save johnwason/b8ed419b6496b0b154756dd3f8030885 to your computer and use it in GitHub Desktop.

Select an option

Save johnwason/b8ed419b6496b0b154756dd3f8030885 to your computer and use it in GitHub Desktop.
benchmark_rws_upload
import abb_motion_program_exec_client as abb
import time
client = abb.MotionProgramExecClient(base_url = 'http://127.0.0.1')
ramdisk = client.get_ramdisk_path()
small_file = b'0'*1024
small_t1 = time.perf_counter()
client.upload_file(ramdisk + "/small.bin", small_file)
small_t2 = time.perf_counter()
print(f"small: {small_t2-small_t1}")
med_file = b'0'*1024*16
med_t1 = time.perf_counter()
client.upload_file(ramdisk + "/med.bin", med_file)
med_t2 = time.perf_counter()
print(f"med: {med_t2-med_t1}")
large_file = b'0'*1024*1024
large_t1 = time.perf_counter()
client.upload_file(ramdisk + "/large.bin", large_file)
large_t2 = time.perf_counter()
print(f"large: {large_t2-large_t1}")
signal_t1 = time.perf_counter()
client._do_get("rw/iosystem/signals/motion_program_executing")
signal_t2 = time.perf_counter()
print(f"signal: {signal_t2-signal_t1}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment