Skip to content

Commit ba2381c

Browse files
author
Richard Jones
committed
Some doc / comment fixes.
Added tools/load_tracker.py - see its usage string. Used to load a tracker with data for load testing. Preliminary results: sqlite, mysql, postgresql and metakit break *no* sweat with 2000 issues (approx 1700-1800 "open").
1 parent f8b5635 commit ba2381c

File tree

3 files changed

+94
-5
lines changed

3 files changed

+94
-5
lines changed

roundup/backends/rdbms_common.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.91 2004-04-18 05:31:02 richard Exp $
1+
# $Id: rdbms_common.py,v 1.92 2004-04-20 05:47:33 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -391,6 +391,9 @@ def create_class_table_indexes(self, spec):
391391
print >>hyperdb.DEBUG, 'create_index', (self, index_sql3)
392392
self.cursor.execute(index_sql3)
393393

394+
# TODO: create indexes on (selected?) Link property columns, as
395+
# they're more likely to be used for lookup
396+
394397
def drop_class_table_indexes(self, cn, key):
395398
# drop the old table indexes first
396399
l = ['_%s_id_idx'%cn, '_%s_retired_idx'%cn]
@@ -1709,8 +1712,6 @@ def setkey(self, propname):
17091712
None, or a TypeError is raised. The values of the key property on
17101713
all existing nodes must be unique or a ValueError is raised.
17111714
'''
1712-
# XXX create an index on the key prop column. We should also
1713-
# record that we've created this index in the schema somewhere.
17141715
prop = self.getprops()[propname]
17151716
if not isinstance(prop, String):
17161717
raise TypeError, 'key properties must be String'

roundup/roundupdb.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: roundupdb.py,v 1.107 2004-04-18 06:13:48 richard Exp $
18+
# $Id: roundupdb.py,v 1.108 2004-04-20 05:47:33 richard Exp $
1919

2020
"""Extending hyperdb with types specific to issue-tracking.
2121
"""
@@ -121,7 +121,6 @@ def addmessage(self, nodeid, summary, text):
121121
appended to the "messages" field of the specified issue.
122122
"""
123123

124-
# XXX "bcc" is an optional extra here...
125124
def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
126125
from_address=None, cc=[], bcc=[]):
127126
"""Send a message to the members of an issue's nosy list.
@@ -133,6 +132,15 @@ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
133132
134133
If 'msgid' is None, the message gets sent only to the nosy
135134
list, and it's called a 'System Message'.
135+
136+
The "cc" argument indicates additional recipients to send the
137+
message to that may not be specified in the message's recipients
138+
list.
139+
140+
The "bcc" argument also indicates additional recipients to send the
141+
message to that may not be specified in the message's recipients
142+
list. These recipients will not be included in the To: or Cc:
143+
address lists.
136144
"""
137145
authid = self.db.msg.safeget(msgid, 'author')
138146
recipients = self.db.msg.safeget(msgid, 'recipients', [])

tools/load_tracker.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#! /usr/bin/env python
2+
# $Id: load_tracker.py,v 1.1 2004-04-20 05:47:33 richard Exp $
3+
4+
'''
5+
Usage: %s <tracker home> <N>
6+
7+
Load up the indicated tracker with N issues and N/100 users.
8+
'''
9+
10+
import sys, os, random
11+
from roundup import instance
12+
13+
# open the instance
14+
if len(sys.argv) < 2:
15+
print "Error: Not enough arguments"
16+
print __doc__.strip()%(sys.argv[0], username)
17+
sys.exit(1)
18+
tracker_home = sys.argv[1]
19+
N = int(sys.argv[2])
20+
21+
# open the tracker
22+
tracker = instance.open(tracker_home)
23+
db = tracker.open('admin')
24+
25+
priorities = db.priority.list()
26+
statuses = db.status.list()
27+
28+
names = ['alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta', 'eta',
29+
'theta', 'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi', 'omicron', 'pi',
30+
'rho']
31+
32+
titles = '''Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
33+
Duis nibh purus, bibendum sed, condimentum ut, bibendum ut, risus.
34+
Fusce pede enim, nonummy sit amet, dapibus a, blandit eget, metus.
35+
Nulla risus.
36+
Vivamus tincidunt.
37+
Donec consequat convallis quam.
38+
Sed convallis vehicula felis.
39+
Aliquam laoreet, dui quis pharetra vehicula, magna justo.
40+
Euismod felis, eu adipiscing eros metus id tortor.
41+
Suspendisse et turpis.
42+
Aenean non felis.
43+
Nam egestas eros.
44+
Integer tellus quam, mattis ac, vestibulum sed, egestas quis, mauris.
45+
Nulla tincidunt diam sit amet dui.
46+
Nam odio mauris, dignissim vitae, eleifend eu, consectetuer id, risus.
47+
Suspendisse potenti.
48+
Donec tincidunt.
49+
Vestibulum gravida.
50+
Fusce luctus, neque id mattis fringilla, purus pede sodales pede.
51+
Quis ultricies urna odio sed orci.'''.splitlines()
52+
53+
try:
54+
M = N/100
55+
print
56+
for i in range(M):
57+
print '\ruser', i*100./M,
58+
sys.stdout.flush()
59+
db.user.create(username=names[i%17]+str(i/17))
60+
61+
users = db.user.list()
62+
users.remove(db.user.lookup('anonymous'))
63+
print
64+
65+
# now create the issues
66+
for i in range(N):
67+
print '\rissue', i*100./N,
68+
sys.stdout.flush()
69+
db.issue.create(
70+
title=random.choice(titles),
71+
priority=random.choice(priorities),
72+
status=random.choice(statuses),
73+
assignedto=random.choice(users))
74+
print
75+
76+
db.commit()
77+
finally:
78+
db.close()
79+
80+
# vim: set filetype=python ts=4 sw=4 et si

0 commit comments

Comments
 (0)