~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/benchmarks/bench_sftp.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-18 23:08:44 UTC
  • mfrom: (1711.2.134 sftp-benchmarks)
  • Revision ID: pqm@pqm.ubuntu.com-20060818230844-138315adab4cfe22
(jam) add a couple more sftp benchmarks

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        tree, files = self.create_with_commits(100, 100, "a")
45
45
        self.time(bzrdir.BzrDir.open(self.get_url('a')).sprout, "b")
46
46
 
 
47
    def create_commit_and_pull(self, num_pull_revisions):
 
48
        os.mkdir("a")
 
49
        tree, files = self.create_with_commits(100, 100, "a")
 
50
        rbzrdir = bzrdir.BzrDir.open(self.get_url('a'))
 
51
        b2 = tree.bzrdir.sprout("b") # branch
 
52
        # change a few files and commit
 
53
        self.commit_some_revisions(tree, files, num_pull_revisions, 20)
 
54
        self.time(b2.open_branch().pull, rbzrdir.open_branch())
 
55
 
47
56
    def test_pull_1(self):
48
 
        os.mkdir("a")
49
 
        tree, files = self.create_with_commits(100, 100, "a")
50
 
        rbzrdir = bzrdir.BzrDir.open(self.get_url('a'))
51
 
        b2 = tree.bzrdir.sprout("b") # branch
52
 
        # change a few files and commit
53
 
        self.commit_some_revisions(tree, files, 1, 20)
54
 
        self.time(b2.open_branch().pull, rbzrdir.open_branch())
 
57
        self.create_commit_and_pull(1)
55
58
        
 
59
    def test_pull_10(self):
 
60
        self.create_commit_and_pull(10)
 
61
 
56
62
    def test_pull_100(self):
57
 
        os.mkdir("a")
58
 
        tree, files = self.create_with_commits(100, 100, "a")
59
 
        rbzrdir = bzrdir.BzrDir.open(self.get_url('a'))
60
 
        b2 = tree.bzrdir.sprout("b") # branch
61
 
        # change a few files and commit
62
 
        self.commit_some_revisions(tree, files, 100, 20)
63
 
        self.time(b2.open_branch().pull, rbzrdir.open_branch())
 
63
        self.create_commit_and_pull(100)
64
64
 
65
65
    def create_commit_and_push(self, num_push_revisions):
66
66
        os.mkdir("a")
75
75
            changes_per_commit=20)
76
76
        self.time(rbzrdir.open_branch().pull, wtree.branch)
77
77
 
 
78
    def test_initial_push(self):
 
79
        os.mkdir('a')
 
80
        tree, files = self.create_with_commits(100, 100, "a")
 
81
        self.time(tree.bzrdir.clone, self.get_url('b'),
 
82
                  revision_id=tree.last_revision())
 
83
 
78
84
    def test_push_1(self):
79
85
        self.create_commit_and_push(1)
80
86