2
0

run-provider.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. #
  3. ###############
  4. # Pre-reqs:
  5. ###############
  6. # Add @profile decorator in all cloudbridge methods to profile
  7. # `pip install .`
  8. # in the modified cloudbridge directory (with tests as part of the library)
  9. # `pip install line-profiler`
  10. ###############
  11. # Usage:
  12. ###############
  13. # sh run-provider.sh [aws|azure|openstack|gcp|mock]
  14. ###############
  15. # Behavior:
  16. ###############
  17. # Will run the line-by-line profiler (https://github.com/rkern/line_profiler) on each test,
  18. # and generate a result file containing the test results and the line-by-line runtime for
  19. # each profiled function
  20. export CB_TEST_PROVIDER=$1
  21. kernprof -l -v run_single.py block_store > ../results/${CB_TEST_PROVIDER}-block_store.res
  22. kernprof -l -v run_single.py cloud_factory > ../results/${CB_TEST_PROVIDER}-cloud_factory.res
  23. kernprof -l -v run_single.py cloud_helpers > ../results/${CB_TEST_PROVIDER}-cloud_helpers.res
  24. kernprof -l -v run_single.py compute > ../results/${CB_TEST_PROVIDER}-compute.res
  25. kernprof -l -v run_single.py image > ../results/${CB_TEST_PROVIDER}-image.res
  26. kernprof -l -v run_single.py network > ../results/${CB_TEST_PROVIDER}-network.res
  27. kernprof -l -v run_single.py object_life_cycle > ../results/${CB_TEST_PROVIDER}-object_life_cycle.res
  28. kernprof -l -v run_single.py object_store > ../results/${CB_TEST_PROVIDER}-object_store.res
  29. kernprof -l -v run_single.py region > ../results/${CB_TEST_PROVIDER}-region.res
  30. kernprof -l -v run_single.py security > ../results/${CB_TEST_PROVIDER}-security.res
  31. kernprof -l -v run_single.py vm_types > ../results/${CB_TEST_PROVIDER}-vm_types.res