/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/time_graph.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-02 02:35:46 UTC
  • mfrom: (7309 work)
  • mto: This revision was merged to the branch mainline in revision 7319.
  • Revision ID: jelmer@jelmer.uk-20190602023546-lqco868tnv26d8ow
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
    branch,
9
9
    commands,
10
10
    graph,
 
11
    osutils,
11
12
    ui,
12
13
    trace,
13
14
    _known_graph_py,
24
25
trace.enable_default_logging()
25
26
ui.ui_factory = text.TextUIFactory()
26
27
 
27
 
begin = time.clock()
 
28
begin = osutils.perf_counter()
28
29
if len(args) >= 1:
29
30
    b = branch.Branch.open(args[0])
30
31
else:
32
33
with b.lock_read():
33
34
    g = b.repository.get_graph()
34
35
    parent_map = dict(p for p in g.iter_ancestry([b.last_revision()])
35
 
                         if p[1] is not None)
36
 
end = time.clock()
 
36
                      if p[1] is not None)
 
37
end = osutils.perf_counter()
37
38
 
38
39
print('Found %d nodes, loaded in %.3fs' % (len(parent_map), end - begin))
39
40
 
73
74
    graph._counters[1] = 0
74
75
    graph._counters[2] = 0
75
76
 
76
 
    begin = time.clock()
 
77
    begin = osutils.perf_counter()
77
78
    g = graph_klass(parent_map)
78
79
    if opts.lsprof is not None:
79
80
        heads = commands.apply_lsprofiled(opts.lsprof, all_heads_comp, g, comb)
80
81
    else:
81
82
        heads = all_heads_comp(g, comb)
82
 
    end = time.clock()
 
83
    end = osutils.perf_counter()
83
84
    return dict(elapsed=(end - begin), graph=g, heads=heads)
84
85
 
85
86
def report(name, g):