Guest User

Untitled

a guest
Oct 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #!/usr/bin/env zendmd
  2.  
  3. import uuid
  4. import time
  5. from MySQLdb import cursors
  6.  
  7. MAX_CHANGES = 10000
  8. total_changes = 0
  9. start_changes = time.time()
  10. for d in dmd.Devices.getSubDevicesGen():
  11. for comp in d.getDeviceComponents():
  12. comp._random_attribute = str(uuid.uuid1())
  13. total_changes += 1
  14. # TODO: use setTitle() here to perform indexing
  15. d._random_attribute = str(uuid.uuid1())
  16. total_changes += 1
  17. if total_changes > MAX_CHANGES:
  18. break
  19. elapsed_changes = time.time() - start_changes
  20. print "Elapsed time in performing changes: %s" % elapsed_changes
  21.  
  22. commit()
  23. elapsed_commit = time.time() - start_commit
  24. print "Elapsed time in commit: %s" % elapsed_commit
Add Comment
Please, Sign In to add comment