Mercurial > hg
comparison contrib/catapipe.py @ 40491:c311424ea579
catapult: add a bit more documentation on how to use catapult tracing
Differential Revision: https://phab.mercurial-scm.org/D5217
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Thu, 01 Nov 2018 16:51:21 -0700 |
parents | cb9b23ec093c |
children | ff562d711919 |
comparison
equal
deleted
inserted
replaced
40490:889424be7ad2 | 40491:c311424ea579 |
---|---|
3 # Copyright 2018 Google LLC. | 3 # Copyright 2018 Google LLC. |
4 # | 4 # |
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 """Tool read primitive events from a pipe to produce a catapult trace. | 7 """Tool read primitive events from a pipe to produce a catapult trace. |
8 | |
9 Usage: | |
10 Terminal 1: $ catapipe.py /tmp/mypipe /tmp/trace.json | |
11 Terminal 2: $ HGCATAPULTSERVERPIPE=/tmp/mypipe hg root | |
12 <ctrl-c catapipe.py in Terminal 1> | |
13 $ catapult/tracing/bin/trace2html /tmp/trace.json # produce /tmp/trace.html | |
14 <open trace.html in your browser of choice; the WASD keys are very useful> | |
15 (catapult is located at https://github.com/catapult-project/catapult) | |
8 | 16 |
9 For now the event stream supports | 17 For now the event stream supports |
10 | 18 |
11 START $SESSIONID ... | 19 START $SESSIONID ... |
12 | 20 |
22 because we have to emit it from the shell scripts produced by | 30 because we have to emit it from the shell scripts produced by |
23 run-tests.py. | 31 run-tests.py. |
24 | 32 |
25 Typically you'll want to place the path to the named pipe in the | 33 Typically you'll want to place the path to the named pipe in the |
26 HGCATAPULTSERVERPIPE environment variable, which both run-tests and hg | 34 HGCATAPULTSERVERPIPE environment variable, which both run-tests and hg |
27 understand. | 35 understand. To trace *only* run-tests, use HGTESTCATAPULTSERVERPIPE instead. |
28 """ | 36 """ |
29 from __future__ import absolute_import, print_function | 37 from __future__ import absolute_import, print_function |
30 | 38 |
31 import argparse | 39 import argparse |
32 import json | 40 import json |