Created
June 7, 2012 23:25
-
-
Save daniel-garcia/2892328 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment