Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env zendmd
- import uuid
- import time
- from MySQLdb import cursors
- MAX_CHANGES = 10000
- total_changes = 0
- start_changes = time.time()
- for d in dmd.Devices.getSubDevicesGen():
- for comp in d.getDeviceComponents():
- comp._random_attribute = str(uuid.uuid1())
- total_changes += 1
- # TODO: use setTitle() here to perform indexing
- d._random_attribute = str(uuid.uuid1())
- total_changes += 1
- if total_changes > MAX_CHANGES:
- break
- elapsed_changes = time.time() - start_changes
- print "Elapsed time in performing changes: %s" % elapsed_changes
- commit()
- elapsed_commit = time.time() - start_commit
- print "Elapsed time in commit: %s" % elapsed_commit
Add Comment
Please, Sign In to add comment